it's pretty weird. If you find an essay on google and memorise it exactly as it is with the same plot and descriptions and characters and etc, then you will be flagged for plagiarism. If you write, say, a chapter of Harry Potter in your exam, you'll be flagged for plagiarism. Instead, you should, look at example essays online and adapt it quite a lot to ensure that it looks like your own original work. For example, change the plot, setting, dialogue, etc, significantly so you aren't plagiarising.
As for memorising, YES, absolutely, as long as you haven't plagiarised the text, use a good piece of writing and ask your teacher to mark it, then adapt it to the question,
best of luck for your exams!