Many departments use a written exam as a major component of the graduate degree requirements.
Typically, the exam covers three areas of your major in depth equivalent to one or two graduate level courses plus their prerequisites. Sometimes, though, the purpose is to ensure breadth at an undergraduate level, and the exam might cover the content of perhaps 5 undergraduate courses. Thus, there is no chance to adapt to the style of your examiners' questions and grading idiosyncrasies. Ideally, the exam tests whether you have assimilated the material in a way that draws connections among courses. Know when and how you are are going to master each component.