Grate the cheese on a coarse grater, finely chop the garlic.
Peel the potatoes, wash them and grate them on a coarse grater.
Place the potatoes in a deep bowl, add half of the grated cheese, one egg, garlic and mayonnaise.
In another bowl, combine the remaining cheese, egg and mayonnaise.
Place the potatoes in a pan greased with vegetable oil and distribute evenly.
Next, spread the cheese and egg mixture evenly and bake in an oven preheated to 180 degrees for 40 minutes.
When the potato casserole is ready and nicely browned on top, turn off the oven, remove the pan with the potatoes and let rest for about 5 minutes.