Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Answer: No, private members are hidden from derived classes. Can access protected, internal, or public members. class Vehicle { private int id; protected string model; } class Car : Vehicle { /* cannot access id, can acc…
Answer: Yes, constructors can have multiple signatures in the same class. class Car { public Car() { } public Car(string model) { } } What interviewers expect A clear definition tied to OOP in C# OOP projects Trade-offs…
Answer: No, constructors cannot be inherited or overridden. Base class constructor can be called using : base(), but cannot be overridden. What interviewers expect A clear definition tied to OOP in C# OOP projects Trade-…
Through: What interviewers expect A clear definition tied to OOP in C# OOP projects Trade-offs (performance, maintainability, security, cost) When you would and would not use it in production Real-world example In a prod…
abstract class Shape { public abstract void Draw(); } class Circle : Shape { public override void Draw() => Console.WriteLine("Drawing Circle"); } class Rectangle : Shape { public override void Draw() => Console.Wr…
Answer: Code depends on interfaces or base classes, not concrete implementations. Makes system flexible, extendable, and easier to maintain. void StartVehicle(Vehicle v) { v.Start(); } // Works with any derived type What…
Answer: Advantages: Promotes code reuse and flexibility Enables loose coupling Supports extensible architecture Disadvantages: May introduce runtime overhead Can make code harder to understand if overused Requires carefu…
Answer: No, interfaces cannot have fields. Only methods, properties, events, or indexers. What interviewers expect A clear definition tied to OOP in C# OOP projects Trade-offs (performance, maintainability, security, cos…
No, interfaces cannot have constructors. What interviewers expect A clear definition tied to OOP in C# OOP projects Trade-offs (performance, maintainability, security, cost) When you would and would not use it in product…
Answer: Yes, starting from C# 8, interfaces can contain static methods. interface IUtility { static void Show() => Console.WriteLine("Static method in interface"); } What interviewers expect A clear definition tie…
Answer: Yes, methods can have default implementations in interfaces. interface ILogger { void Log(string message); void LogWarning(string message) => Console.WriteLine("Warning: " + message); } What interviewers e…
Answer: Yes, a class can implement multiple interfaces, solving multiple inheritance issues. class FlyingCar : IDriveable, IFlyable { public void Drive() => Console.WriteLine("Driving"); public void Fly() =&gt…
Answer: The implementing class must provide a single implementation for both interfaces. Or use explicit interface implementation to differentiate. What interviewers expect A clear definition tied to OOP in C# OOP projec…
Answer: Yes, explicit implementation allows a class to implement interface members separately. class Car : IDriveable { void IDriveable.Drive() => Console.WriteLine("Explicit drive"); } What interviewers expect A…
Answer: Expose method signatures without implementation. Users interact with the interface, not the underlying implementation. What interviewers expect A clear definition tied to OOP in C# OOP projects Trade-offs (perfor…
Answer: Code depends on interface, not concrete class. Makes it easier to swap implementations without changing dependent code. void StartVehicle(IDriveable vehicle) { vehicle.Drive(); } What interviewers expect A clear…
Interfaces allow DI frameworks to inject concrete implementations at runtime. Promotes flexibility and testability. public class CarService { private readonly IDriveable _vehicle; public CarService(IDriveable vehicle) {…
Answer: Yes, interfaces can inherit from other interfaces, forming a hierarchy. interface IFlyable { void Fly(); } interface IAdvancedFlyable : IFlyable { void Loop(); } What interviewers expect A clear definition tied t…
Answer: Interfaces with no methods or properties, used to mark classes for special behavior. Example: ISerializable marks classes as serializable. What interviewers expect A clear definition tied to OOP in C# OOP project…
Answer: Use the abstract keyword. bstract class Vehicle { public abstract void Start(); public void Stop() => Console.WriteLine("Vehicle stopped"); } What interviewers expect A clear definition tied to OOP in C# O…
Answer: Yes, abstract classes can have fields, properties, and constants. bstract class Vehicle { protected string Brand; } What interviewers expect A clear definition tied to OOP in C# OOP projects Trade-offs (performan…
Yes, abstract classes can implement interfaces partially or fully. Derived classes must implement any remaining abstract members. interface IDriveable { void Drive(); } bstract class Vehicle : IDriveable { public abstrac…
Answer: No, abstract classes cannot be sealed. A sealed class cannot be inherited, while abstract classes are meant to be inherited. What interviewers expect A clear definition tied to OOP in C# OOP projects Trade-offs (…
Answer: Yes, abstract classes can have private members, but derived classes cannot ccess them. Private members can be accessed via protected or public methods. What interviewers expect A clear definition tied to OOP in C…
Answer: No, a class cannot be both abstract and static. Abstract classes are for inheritance, static classes cannot be inherited. What interviewers expect A clear definition tied to OOP in C# OOP projects Trade-offs (per…
C# OOP C# Programming Tutorial · OOP
Answer: No, private members are hidden from derived classes. Can access protected, internal, or public members. class Vehicle { private int id; protected string model; } class Car : Vehicle { /* cannot access id, can access model */ }
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Yes, constructors can have multiple signatures in the same class. class Car { public Car() { } public Car(string model) { } }
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: No, constructors cannot be inherited or overridden. Base class constructor can be called using : base(), but cannot be overridden.
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Through:
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
abstract class Shape { public abstract void Draw(); }
class Circle : Shape { public override void Draw() =>
Console.WriteLine("Drawing Circle"); }
class Rectangle : Shape { public override void Draw() =>
Console.WriteLine("Drawing Rectangle"); }
Shape s1 = new Circle();
Shape s2 = new Rectangle();
s1.Draw(); // Circle's Draw
s2.Draw(); // Rectangle's Draw
C# OOP C# Programming Tutorial · OOP
Answer: Code depends on interfaces or base classes, not concrete implementations. Makes system flexible, extendable, and easier to maintain. void StartVehicle(Vehicle v) { v.Start(); } // Works with any derived type
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Advantages: Promotes code reuse and flexibility Enables loose coupling Supports extensible architecture Disadvantages: May introduce runtime overhead Can make code harder to understand if overused Requires careful design to avoid ambiguity
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: No, interfaces cannot have fields. Only methods, properties, events, or indexers.
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
No, interfaces cannot have constructors.
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Yes, starting from C# 8, interfaces can contain static methods. interface IUtility { static void Show() => Console.WriteLine("Static method in interface"); }
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Yes, methods can have default implementations in interfaces. interface ILogger { void Log(string message); void LogWarning(string message) => Console.WriteLine("Warning: " + message); }
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Yes, a class can implement multiple interfaces, solving multiple inheritance issues. class FlyingCar : IDriveable, IFlyable { public void Drive() => Console.WriteLine("Driving"); public void Fly() => Console.WriteLine("Flying"); }
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: The implementing class must provide a single implementation for both interfaces. Or use explicit interface implementation to differentiate.
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Yes, explicit implementation allows a class to implement interface members separately. class Car : IDriveable { void IDriveable.Drive() => Console.WriteLine("Explicit drive"); }
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Expose method signatures without implementation. Users interact with the interface, not the underlying implementation.
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Code depends on interface, not concrete class. Makes it easier to swap implementations without changing dependent code. void StartVehicle(IDriveable vehicle) { vehicle.Drive(); }
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
public class CarService
{
private readonly IDriveable _vehicle;
public CarService(IDriveable vehicle) { _vehicle = vehicle; }
}C# OOP C# Programming Tutorial · OOP
Answer: Yes, interfaces can inherit from other interfaces, forming a hierarchy. interface IFlyable { void Fly(); } interface IAdvancedFlyable : IFlyable { void Loop(); }
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Interfaces with no methods or properties, used to mark classes for special behavior. Example: ISerializable marks classes as serializable.
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Use the abstract keyword. bstract class Vehicle { public abstract void Start(); public void Stop() => Console.WriteLine("Vehicle stopped"); }
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Yes, abstract classes can have fields, properties, and constants. bstract class Vehicle { protected string Brand; }
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
interface IDriveable { void Drive(); }
bstract class Vehicle : IDriveable { public abstract void Drive();
}
class Car : Vehicle { public override void Drive() =>
Console.WriteLine("Car drives"); }
C# OOP C# Programming Tutorial · OOP
Answer: No, abstract classes cannot be sealed. A sealed class cannot be inherited, while abstract classes are meant to be inherited.
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: Yes, abstract classes can have private members, but derived classes cannot ccess them. Private members can be accessed via protected or public methods.
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
C# OOP C# Programming Tutorial · OOP
Answer: No, a class cannot be both abstract and static. Abstract classes are for inheritance, static classes cannot be inherited.
In a production C# OOP application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.