Here's how to get top exam marks in Persona 5 Royal:
In order to be top of the class in Persona 5 Royal, you'll need to satisfy these two requirements:
Answer all exam questions correctly.
Your Knowledge Level must be maxed. This is impossible to achieve in time for your first exam — even if you spend every second of free time studying. In order to top the class for every exam, you'll need to start New Game + with your Knowledge Level already maxed.