Here are a few sentences with the same meaning:
* El examen me lo da la profesora. (This uses a pronoun shift to emphasize "me")
* La profesora me entrega el examen. (This uses a different verb for "give" that implies handing something over)
* Recibo el examen de la profesora. (This focuses on receiving the exam)
The best choice for you depends on the specific context and the nuance you want to convey.