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 326–350 of 963

Career & HR topics

By tech stack

Popular tracks

Junior PDF
What is polymorphism in OOP?

Short answer: Polymorphism means “many forms”. It allows objects of different types to be treated as objects of a common base type. Achieved through method overloading, overriding, and interfaces. Real-world example (Sho…

Junior PDF
What is compile-time polymorphism?

Short answer: Also called static polymorphism. Resolved at compile time. Achieved through method overloading or operator overloading. class Calculator Example code { public int Add(int a, int b) => a + b; public doubl…

Junior PDF
What is runtime polymorphism?

Short answer: Also called dynamic polymorphism. Resolved at runtime using method overriding. class Vehicle { public virtual void Start() => Console.WriteLine("Vehicle starts"); } class Car : Vehicle { public…

Junior PDF
What is method overloading?

Short answer: Same method name with different parameters in the same class. Enables compile-time polymorphism. class MathHelper Example code { public int Multiply(int a, int b) => a * b; public int Multiply(int a, int…

Junior PDF
What is operator overloading?

Short answer: Defining custom behavior for operators (+, -, *, etc.) for a class. class Point Example code { public int X, Y; public static Point operator +(Point a, Point b) => new Point { X = a.X + b.X, Y = a.Y + b.…

Junior PDF
What is the difference between overriding and overloading?

Short answer: Feature Overloading Overriding Compile/Runtime Compile-time Runtime Same signature? No, different parameters Same signature Virtual required? No Yes Inheritance required? Not required Required Real-world ex…

Junior PDF
What is late binding and early binding?

Short answer: Early binding → Resolved at compile time (e.g., method overloading). Late binding → Resolved at runtime (e.g., method overriding with virtual/override). Say this in the interview Define — one clear sentence…

Junior PDF
What is the object class in C# and its relation to polymorphism?

Short answer: object is the base class for all C# types. Enables polymorphism, as any object can be referred using object type. object obj = new Car(); Example code object is the base class for all C# types. Enables poly…

Junior PDF
What is the role of interfaces in achieving polymorphism?

Short answer: Interfaces allow different classes to implement the same contract, enabling dynamic behavior at runtime. interface IDriveable { void Drive(); } class Car : IDriveable { public void Drive() => Console.Wri…

Junior PDF
What is dynamic polymorphism?

Short answer: Another term for runtime polymorphism, achieved via method overriding. Real-world example (ShopNest) Checkout calls IPaymentGateway.Charge() . Razorpay and Stripe adapters implement the same interface, so S…

Junior PDF
What is an interface?

Short answer: An interface is a contract that defines method signatures, properties, events, or indexers without providing implementation. Classes or structs that implement the interface must provide the implementation.…

Junior PDF
How do you define an interface in C#?

Short answer: Use the interface keyword. interface IDriveable Example code { void Drive(); int Speed { get; set; } } Real-world example (ShopNest) Checkout calls IPaymentGateway.Charge() . Razorpay and Stripe adapters im…

Junior PDF
What is the syntax to implement an interface?

Short answer: Use the colon (:) symbol and implement all members. class Car : IDriveable Example code { public int Speed { get; set; } public void Drive() => Console.WriteLine("Car is driving"); } Real-world…

Junior PDF
What is the difference between an interface and a class?

Short answer: Feature Interface Class Implementatio No implementation (except default methods) Can have full implementation Fields Cannot have fields Can have fields Instantiation Cannot instantiate Can instantiate Inher…

Junior PDF
What is explicit interface implementation?

Short answer: Implementing an interface member explicitly so it can only be called via interface reference, not class object. IDriveable car = new Car(); car.Drive(); // Works // Car c = new Car(); c.Drive(); // Won't co…

Junior PDF
What is the purpose of using interfaces?

Short answer: Define contracts for classes. Achieve abstraction, polymorphism, and loose coupling. Real-world example (ShopNest) Checkout calls IPaymentGateway.Charge() . Razorpay and Stripe adapters implement the same i…

Junior PDF
What is the IComparable interface?

Short answer: Provides a standard method to compare objects for sorting. class Employee : IComparable<Employee> Example code { public int Id { get; set; } public int CompareTo(Employee other) => this.Id.CompareT…

Junior PDF
What is the IDisposable interface?

Short answer: Provides Dispose() method for releasing unmanaged resources. class FileHandler : IDisposable Example code { public void Dispose() => Console.WriteLine("Resources released"); } Real-world exampl…

Junior PDF
What is the difference between IEnumerable and IEnumerator?

Short answer: IEnumerable → Provides collection traversal capability (GetEnumerator() method). IEnumerator → Used to iterate over a collection (MoveNext(), Current, Reset()). Real-world example (ShopNest) Think of ShopNe…

Junior PDF
What is an abstract class?

Short answer: An abstract class is a class that cannot be instantiated directly. Can contain abstract methods (without implementation) and concrete methods (with implementation). Used to define a common base for other cl…

Junior PDF
What is an abstract method?

Short answer: A method declared with abstract without implementation. Must be overridden in a derived class. abstract class Vehicle { Example code public abstract void Start(); } class Car : Vehicle { public override voi…

Junior PDF
What is the difference between an abstract method and a virtual method?

Short answer: llow derived class to optionally override Real-world example (ShopNest) ShopNest has a base PaymentMethod with virtual decimal Fee() . UpiPayment and CardPayment override the fee logic without changing the…

Junior PDF
What is the difference between an abstract method and a virtual method?

Short answer: Feature Abstract Method Virtual Method Implementatio No implementation Has implementation Must override? Must be overridden Optional to override Class type Must be in abstract class Can be in any class Purp…

Junior PDF
What is the difference between an abstract class and a normal class?

Short answer: Feature Abstract Class Normal Class Instantiation Cannot instantiate Can instantiate Methods Can have abstract methods All methods must have implementation Purpose Serve as base for inheritance General purp…

Junior PDF
What is the key difference between abstract classes and interfaces?

Short answer: Feature Abstract Class Interface Implementation Can have full/partial implementation Cannot have full implementation (except default methods in C# 8+) Fields Can have fields Cannot have fields Inheritance S…

C# OOP C# Programming Tutorial · OOP

Short answer: Polymorphism means “many forms”. It allows objects of different types to be treated as objects of a common base type. Achieved through method overloading, overriding, and interfaces.

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Also called static polymorphism. Resolved at compile time. Achieved through method overloading or operator overloading. class Calculator

Example code

{
public int Add(int a, int b) => a + b;
public double Add(double a, double b) => a + b; // Overloaded method }

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Also called dynamic polymorphism. Resolved at runtime using method overriding. class Vehicle { public virtual void Start() => Console.WriteLine("Vehicle starts"); } class Car : Vehicle { public override void Start() => Console.WriteLine("Car starts"); } Vehicle v = new Car(); v.Start(); // Calls Car's Start() at runtime

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Same method name with different parameters in the same class. Enables compile-time polymorphism. class MathHelper

Example code

{
public int Multiply(int a, int b) => a * b;
public int Multiply(int a, int b, int c) => a * b * c; // Overloaded }

Real-world example (ShopNest)

Think of ShopNest’s Product, Cart, and Order classes: each object holds data + behavior, so pricing rules stay next to the data they use.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Defining custom behavior for operators (+, -, *, etc.) for a class. class Point

Example code

{
public int X, Y;
public static Point operator +(Point a, Point b) => new Point {
X = a.X + b.X, Y = a.Y + b.Y };
}

Real-world example (ShopNest)

Think of ShopNest’s Product, Cart, and Order classes: each object holds data + behavior, so pricing rules stay next to the data they use.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Feature Overloading Overriding Compile/Runtime Compile-time Runtime Same signature? No, different parameters Same signature Virtual required? No Yes Inheritance required? Not required Required

Real-world example (ShopNest)

Think of ShopNest’s Product, Cart, and Order classes: each object holds data + behavior, so pricing rules stay next to the data they use.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Early binding → Resolved at compile time (e.g., method overloading). Late binding → Resolved at runtime (e.g., method overriding with virtual/override).

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

C# OOP C# Programming Tutorial · OOP

Short answer: object is the base class for all C# types. Enables polymorphism, as any object can be referred using object type. object obj = new Car();

Example code

object is the base class for all C# types. Enables polymorphism, as any object can be referred using object type. object obj = new Car();

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Interfaces allow different classes to implement the same contract, enabling dynamic behavior at runtime. interface IDriveable { void Drive(); } class Car : IDriveable { public void Drive() => Console.WriteLine("Car drives"); } class Bike : IDriveable { public void Drive() => Console.WriteLine("Bike drives"); }

Example code

Interfaces allow different classes to implement the same contract, enabling dynamic behavior at runtime. interface IDriveable { void Drive(); }
class Car : IDriveable { public void Drive() => Console.WriteLine("Car drives"); } class Bike : IDriveable { public void Drive() => Console.WriteLine("Bike drives"); }

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Another term for runtime polymorphism, achieved via method overriding.

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: An interface is a contract that defines method signatures, properties, events, or indexers without providing implementation. Classes or structs that implement the interface must provide the implementation.

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Use the interface keyword. interface IDriveable

Example code

{ void Drive(); int Speed { get; set; }
}

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Use the colon (:) symbol and implement all members. class Car : IDriveable

Example code

{
public int Speed { get; set; }
public void Drive() => Console.WriteLine("Car is driving");
}

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Feature Interface Class Implementatio No implementation (except default methods) Can have full implementation Fields Cannot have fields Can have fields Instantiation Cannot instantiate Can instantiate Inheritance Can inherit multiple interfaces Single class inheritance only

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Implementing an interface member explicitly so it can only be called via interface reference, not class object. IDriveable car = new Car(); car.Drive(); // Works // Car c = new Car(); c.Drive(); // Won't compile

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Define contracts for classes. Achieve abstraction, polymorphism, and loose coupling.

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Provides a standard method to compare objects for sorting. class Employee : IComparable<Employee>

Example code

{
public int Id { get; set; }
public int CompareTo(Employee other) => this.Id.CompareTo(other.Id); }

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Provides Dispose() method for releasing unmanaged resources. class FileHandler : IDisposable

Example code

{
public void Dispose() => Console.WriteLine("Resources released"); }

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: IEnumerable → Provides collection traversal capability (GetEnumerator() method). IEnumerator → Used to iterate over a collection (MoveNext(), Current, Reset()).

Real-world example (ShopNest)

Think of ShopNest’s Product, Cart, and Order classes: each object holds data + behavior, so pricing rules stay next to the data they use.

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

C# OOP C# Programming Tutorial · OOP

Short answer: An abstract class is a class that cannot be instantiated directly. Can contain abstract methods (without implementation) and concrete methods (with implementation). Used to define a common base for other classes.

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: A method declared with abstract without implementation. Must be overridden in a derived class. abstract class Vehicle {

Example code

public abstract void Start();
}
class Car : Vehicle
{
public override void Start() => Console.WriteLine("Car started"); }

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: llow derived class to optionally override

Real-world example (ShopNest)

ShopNest has a base PaymentMethod with virtual decimal Fee(). UpiPayment and CardPayment override the fee logic without changing the checkout caller.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Feature Abstract Method Virtual Method Implementatio No implementation Has implementation Must override? Must be overridden Optional to override Class type Must be in abstract class Can be in any class Purpose Force derived classes to implement Allow derived class to optionally override

Real-world example (ShopNest)

ShopNest has a base PaymentMethod with virtual decimal Fee(). UpiPayment and CardPayment override the fee logic without changing the checkout caller.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Feature Abstract Class Normal Class Instantiation Cannot instantiate Can instantiate Methods Can have abstract methods All methods must have implementation Purpose Serve as base for inheritance General purpose use

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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

C# OOP C# Programming Tutorial · OOP

Short answer: Feature Abstract Class Interface Implementation Can have full/partial implementation Cannot have full implementation (except default methods in C# 8+) Fields Can have fields Cannot have fields Inheritance Single class inheritance Multiple interface inheritance allowed Constructors Allowed Not allowed Access Modifiers Can have public, protected, private Members are public by default

Real-world example (ShopNest)

Checkout calls IPaymentGateway.Charge(). Razorpay and Stripe adapters implement the same interface, so ShopNest can switch gateways without rewriting the order service.

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