Peel the potatoes and cut into roughly equal-sized chunks. Boil in salted water over medium-high heat for 15-20 minutes until tender and easily pierced with a fork.
While the potatoes cook, heat margarine in a large pan over medium heat. Add finely diced onions and sauté for 3-5 minutes until golden. Add the chopped corned beef, cover, and cook for 3 minutes. Stir in the diced pickled cucumbers with a generous splash of cucumber liquid. Season with salt, pepper, and ground allspice. If desired, add some diced beetroot. Simmer gently for 10 minutes.
Drain the cooked potatoes and lightly mash them—keep them chunky, not smooth like mashed potatoes. Stir in the corned beef mixture. If the mixture seems too firm, add a bit more cucumber liquid to loosen it.
Heat margarine in a skillet over medium heat and fry the eggs until cooked to your liking. Divide the potato and corned beef mixture among serving plates, top each with a fried egg, and serve with a herring fillet alongside if you like.