Concrete Class (PastaRecipe):?
Short answer: The PastaRecipe class is a concrete subclass that implements the specific details of the steps defined in the abstract Recipe class.
Explain a bit more
The steps like gathering ingredients, preparing, and cooking are all tailored to pasta. public class PastaRecipe : Recipe { protected override void GatherIngredients() { Console.WriteLine("Gathering pasta, sauce, and cheese."); } protected override void Prepare() { Console.WriteLine("Boiling pasta and preparing sauce."); } protected override void CookMethod() { Console.WriteLine("Cooking pasta with sauce."); }
Real-world example (ShopNest)
Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the problem it solves in the interview.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png