Heat oven to 180C/160C fan/ gas 4. Coarsely grate the potatoes into a tea towel and wring dry, then transfer to a bowl.
Melt the butter in a large ovenproof frying pan, and add the onion, garlic and black pudding. Cook until the onion is soft but not coloured, about 6-8 mins, then take off the heat and combine with the potatoes and cheese. Season, then bring together with your hands to shape into four generous potato cakes. Put in the fridge to chill for 30 mins.
Wipe out the pan, then heat the oil. Fry the cakes until they are lightly brown, taking care when you flip them, for 2-3 mins either side. Transfer to the oven and cook for about 15 mins until they are cooked through and crisp. Serve each one topped with a fried egg.