Interview Q&A

Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.

4608 total questions 4508 technical 100 career & HR 4272 from PDF library

Showing 1751–1775 of 4608

Career & HR topics

By tech stack

Popular tracks

Mid PDF
Separation of Construction and Representation:?

Short answer: The Builder Pattern separates the construction of a complex object from its representation. You can change the construction process without changing the way the object is represented or structured. Real-wor…

GoF Patterns Read answer
Mid PDF
Product (Pizza):?

Short answer: The Pizza class is the Product that we are constructing. It has properties for Dough, Sauce, and a list of Toppings. The ToString() method is overridden to provide a string representation of the pizza. publ…

GoF Patterns Read answer
Mid PDF
Decouples Abstraction and Implementation:?

Short answer: The Bridge pattern allows you to modify the abstraction (shapes) and the implementation (drawing API) independently, providing a cleaner and more modular design. Real-world example (ShopNest) Use a GoF patt…

GoF Patterns Read answer
Mid PDF
Abstraction:?

Short answer: The Shape class is the abstraction. It holds a reference to the IDrawingAPI and delegates the drawing task to it. It defines the common interface Draw() that all shapes must implement. Example code public a…

GoF Patterns Read answer
Mid PDF
Interface Compatibility:?

Short answer: The Adapter pattern allows you to integrate existing systems or third-party libraries without modifying their code. It enables compatibility between incompatible interfaces. Real-world example (ShopNest) Us…

GoF Patterns Read answer
Mid PDF
Target Interface:?

Short answer: The ITarget interface defines the expected interface that the client will use. It has a method Request() that the client expects to call. public interface ITarget Example code { void Request(); } Real-world…

GoF Patterns Read answer
Mid PDF
Separation of Concerns:?

Short answer: The pattern separates the UI creation logic from the client application. The application does not need to know about the specific UI components; it simply relies on the factory to provide them. Real-world e…

GoF Patterns Read answer
Mid PDF
Abstract Factory Interface:?

Short answer: The IUIFactory interface defines methods for creating abstract product types like buttons and checkboxes. This ensures that every concrete factory will implement the same methods, but each will provide plat…

GoF Patterns Read answer
Mid PDF
When you need to add new operations to an object structure without modifying

Short answer: the existing classes. This pattern allows you to keep your object classes stable and add functionality through new visitor classes. Real-world example (ShopNest) Use a GoF pattern in ShopNest only when it r…

GoF Patterns Read answer
Mid PDF
Concrete Strategies: ○ Each concrete strategy (BubbleSort, QuickSort) implements the sorting?

Short answer: lgorithm. These algorithms can be tested, optimized, or replaced without ffecting the context or the other algorithms. Real-world example (ShopNest) Discount rules are Strategy objects: PercentageOff, FlatO…

GoF Patterns Read answer
Mid PDF
Centralized Control: ○ The mediator controls the communication between all the colleagues, which makes it easier to modify or extend how messages are passed. For example,

Short answer: dding new features like message filtering or logging can be done in the mediator without affecting the users. Real-world example (ShopNest) Use a GoF pattern in ShopNest only when it removes duplication or…

GoF Patterns Read answer
Mid PDF
Simplified Client Code: ○ The client code doesn't need to know the internal implementation of the collection (e.g., whether it's a list or a tree). It can use the iterator interface to

Short answer: ccess the elements sequentially, leading to cleaner and more maintainable code. Real-world example (ShopNest) Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain t…

GoF Patterns Read answer
Mid PDF
Aggregate Interface (IAggregate<T>): ○ The IAggregate<T> interface is implemented by any collection that needs to be iterated over. It provides the CreateIterator() method that returns

Short answer: n iterator for that collection. 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…

GoF Patterns Read answer
Mid PDF
Multithreading Considerations: ○ When using the Flyweight pattern in a multithreaded environment, care should be taken to ensure thread safety. The flyweight factory could use a concurrent dictionary or apply locking mechanisms to prevent concurrent

Short answer: ccess to the shared flyweight objects. Real-world example (ShopNest) ShopNest’s NotificationFactory creates Email or SMS senders based on user preference. Say this in the interview Define — one clear senten…

GoF Patterns Read answer
Mid PDF
Asynchronous Operations: ○ In a more advanced scenario, you could make the methods in the facade?

Short answer: synchronous, allowing components (like the DVD player) to load or process content in the background, improving user experience. Real-world example (ShopNest) Use a GoF pattern in ShopNest only when it remov…

GoF Patterns Read answer
Mid PDF
Decoupling: ○ The Facade class decouples the client from the subsystems. The client doesn't need to know about the internal workings of the components like the

Short answer: mplifier or DVDPlayer, reducing tight coupling between them. Real-world example (ShopNest) Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the problem it solve…

GoF Patterns Read answer
Mid PDF
Graphic Design Software: ○ In graphic design tools, shapes can be composed into larger structures (like a group of shapes). Each shape (a circle, a rectangle, etc.) can be treated as

Short answer: n individual object, while a group of shapes can be treated as a composite object. The Composite Pattern makes it easier to manage complex graphical objects that contain simple shapes. Real-world example (S…

GoF Patterns Read answer
Mid PDF
Leaf (File): ○ The File class is a leaf node in the composite structure. It doesn’t contain?

Short answer: ny child components but implements the ShowInfo() method to display its name. Real-world example (ShopNest) Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the…

GoF Patterns Read answer
Mid PDF
Undo/Redo Functionality: ○ The Command Pattern is particularly useful for implementing undo/redo functionality. The stack of executed commands allows for easy reversion of

Short answer: ctions without needing to track individual changes manually. Real-world example (ShopNest) Use a GoF pattern in ShopNest only when it removes duplication or makes a change safer—explain the problem it solve…

GoF Patterns Read answer
Mid PDF
Increased Complexity:?

Short answer: The pattern introduces additional classes (visitors), which can make the system more complex, especially when the number of elements and visitors increases. Real-world example (ShopNest) Use a GoF pattern i…

GoF Patterns Read answer
Mid PDF
Adding New Operations Without Modifying Classes:?

Short answer: You can add new operations (like taxes or shipping costs) by simply creating new visitor classes without needing to modify the existing elements (Book, Fruit). This makes it easier to extend functionality i…

GoF Patterns Read answer
Mid PDF
Visitor Interface:?

Short answer: The visitor interface defines a visit method for each type of element. Each Visit method encapsulates the operation to be performed on the corresponding element. Real-world example (ShopNest) Use a GoF patt…

GoF Patterns Read answer
Mid PDF
Element Interface (IShoppingCartElement):?

Short answer: The IShoppingCartElement interface declares the Accept method, which allows the element to accept a visitor. Each element (like Book, Fruit) will implement this interface to allow a visitor to operate on it…

GoF Patterns Read answer
Mid PDF
Complexity with Many Steps:?

Short answer: If the template method involves a large number of steps, or if there are many subclasses with different variations of steps, the code can become harder to manage and maintain. Explain a bit more Conclusion:…

GoF Patterns Read answer
Mid PDF
Framework Creation:?

Short answer: If you are creating a framework where clients need to customize only certain steps of a predefined process, the Template Method Pattern allows them to override the necessary methods while ensuring the commo…

GoF Patterns Read answer

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: The Builder Pattern separates the construction of a complex object from its representation. You can change the construction process without changing the way the object is represented or structured.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: The Pizza class is the Product that we are constructing. It has properties for Dough, Sauce, and a list of Toppings. The ToString() method is overridden to provide a string representation of the pizza. public class Pizza

Example code

{
public string Dough { get; set; }
public string Sauce { get; set; }
public List<string> Toppings { get; } = new List<string>();
public override string ToString() => $"Pizza with {Dough} dough, {Sauce} sauce and toppings: {string.Join(", ", Toppings)}"; }

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: The Bridge pattern allows you to modify the abstraction (shapes) and the implementation (drawing API) independently, providing a cleaner and more modular design.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: The Shape class is the abstraction. It holds a reference to the IDrawingAPI and delegates the drawing task to it. It defines the common interface Draw() that all shapes must implement.

Example code

public abstract class Shape
{ protected IDrawingAPI _drawingAPI; protected Shape(IDrawingAPI drawingAPI) => _drawingAPI = drawingAPI; public abstract void Draw();
}

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: The Adapter pattern allows you to integrate existing systems or third-party libraries without modifying their code. It enables compatibility between incompatible interfaces.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: The ITarget interface defines the expected interface that the client will use. It has a method Request() that the client expects to call. public interface ITarget

Example code

{ void Request(); }

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: The pattern separates the UI creation logic from the client application. The application does not need to know about the specific UI components; it simply relies on the factory to provide them.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: The IUIFactory interface defines methods for creating abstract product types like buttons and checkboxes. This ensures that every concrete factory will implement the same methods, but each will provide platform-specific products. public interface IUIFactory

Example code

{ IButton CreateButton(); ICheckbox CreateCheckbox(); }

Real-world example (ShopNest)

ShopNest’s NotificationFactory creates Email or SMS senders based on user preference.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: the existing classes. This pattern allows you to keep your object classes stable and add functionality through new visitor classes.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: lgorithm. These algorithms can be tested, optimized, or replaced without ffecting the context or the other algorithms.

Real-world example (ShopNest)

Discount rules are Strategy objects: PercentageOff, FlatOff, BuyOneGetOne—checkout picks one without a huge if/else.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: dding new features like message filtering or logging can be done in the mediator without affecting the users.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: ccess the elements sequentially, leading to cleaner and more maintainable code.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: n iterator for that collection.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: ccess to the shared flyweight objects.

Real-world example (ShopNest)

ShopNest’s NotificationFactory creates Email or SMS senders based on user preference.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: synchronous, allowing components (like the DVD player) to load or process content in the background, improving user experience.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: mplifier or DVDPlayer, reducing tight coupling between them.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: n individual object, while a group of shapes can be treated as a composite object. The Composite Pattern makes it easier to manage complex graphical objects that contain simple shapes.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: ny child components but implements the ShowInfo() method to display its name.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: ctions without needing to track individual changes manually.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: The pattern introduces additional classes (visitors), which can make the system more complex, especially when the number of elements and visitors increases.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: You can add new operations (like taxes or shipping costs) by simply creating new visitor classes without needing to modify the existing elements (Book, Fruit). This makes it easier to extend functionality in the future.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: The visitor interface defines a visit method for each type of element. Each Visit method encapsulates the operation to be performed on the corresponding element.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: The IShoppingCartElement interface declares the Accept method, which allows the element to accept a visitor. Each element (like Book, Fruit) will implement this interface to allow a visitor to operate on it.

Example code

public interface IShoppingCartElement
{ void Accept(IShoppingCartVisitor visitor); }

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: If the template method involves a large number of steps, or if there are many subclasses with different variations of steps, the code can become harder to manage and maintain.

Explain a bit more

Conclusion: The Template Method Pattern is a powerful way to define the structure of an algorithm while allowing subclasses to customize specific steps.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Gang of Four Patterns Design Patterns in C# · GoF Patterns

Short answer: If you are creating a framework where clients need to customize only certain steps of a predefined process, the Template Method Pattern allows them to override the necessary methods while ensuring the common workflow remains intact.

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

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details