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 301–325 of 963

Career & HR topics

By tech stack

Popular tracks

Junior PDF
What is a class in OOP?

Short answer: A blueprint or template for creating objects. Defines properties (data) and methods (behavior) that the objects will have. public class Car Example code { public string Model { get; set; } public void Start…

Junior PDF
What is an object?

Short answer: An instance of a class with actual values. Represents a real-world entity in memory. Car myCar = new Car(); // Object of Car class Example code An instance of a class with actual values. Represents a real-w…

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

Short answer: Feature Class Object Definition Blueprint/Template Instance of a class Memory Does not occupy memory Occupies memory Example class Car { } Car myCar = new Car(); Real-world example (ShopNest) Think of ShopN…

Junior PDF
What is a constructor?

Short answer: A special method used to initialize objects when they are created. Has the same name as the class and no return type. public class Car Example code { public string Model; public Car(string model) { Model =…

Junior PDF
What is a destructor?

Short answer: A method called automatically when an object is destroyed. Used to release resources before the object is removed from memory. In C#, destructors are rarely needed due to garbage collection. ~Car() { Consol…

Junior PDF
What is encapsulation?

Short answer: The practice of hiding internal details of a class and exposing only necessary functionality through access modifiers and properties. private int speed; Example code public int Speed { get { return speed; }…

Junior PDF
What is abstraction?

Short answer: Hiding implementation details and showing only the essential features of an object. Achieved using abstract classes and interfaces. abstract class Vehicle { Example code public abstract void Start(); } Real…

Junior PDF
What is inheritance?

Short answer: Mechanism where a class (derived/child) inherits properties and methods from another class (base/parent). Promotes code reusability. class Car : Vehicle Example code { public override void Start() { Console…

Junior PDF
What is polymorphism?

Short answer: Ability of an object to take multiple forms. Types: Compile-time (method overloading) Run-time (method overriding) Vehicle v = new Car(); v.Start(); // Run-time polymorphism Real-world example (ShopNest) Ch…

Junior PDF
What is a real-world example of OOP?

Short answer: Car object: Class → Car Objects → myCar, yourCar Properties → Color, Model, Speed Methods → Start(), Stop(), Accelerate() Shows encapsulation, inheritance (e.g., ElectricCar : Car), and polymorphism in acti…

Junior PDF
What is encapsulation in OOP?

Short answer: Encapsulation is the mechanism of hiding internal details of an object and exposing only necessary functionalities. It helps in protecting data and maintaining control over how it is accessed or modified. E…

Junior PDF
What is the role of private and public access modifiers in encapsulation?

Short answer: Private → Hides data from outside access, ensuring security. Public → Provides controlled access through properties or methods. Example: private decimal balance; // hidden Example code public decimal Balanc…

Junior PDF
What is the use of internal, protected, and protected internal?

Short answer: Internal → Accessible only within the same assembly. Protected → Accessible in the class and derived classes. Protected Internal → Accessible in derived classes or within the same assembly. Example code pro…

Junior PDF
What is the use of properties in encapsulation?

Short answer: Properties provide controlled access to private fields. Enable validation, read-only/write-only access, and future flexibility. Example: private int score; Example code public int Score { get { return score…

Junior PDF
What is abstraction in OOP?

Short answer: Abstraction is the process of hiding the internal implementation details of a system and exposing only the essential features. It allows developers to focus on what an object does, not how it does it. Examp…

Junior PDF
What is the difference between interface-based and abstract class-based abstraction?

Short answer: Feature Abstract Class Interface Methods Can have abstract + concrete methods Only abstract methods (C# 8+ allows default implementation) Fields Can have fields Cannot have fields Inheritance Single inherit…

Junior PDF
What is the purpose of abstraction in large systems?

Short answer: Reduces system complexity by focusing on essential features. Decouples modules, making large systems easier to maintain and extend. Promotes code reuse and flexibility. Real-world example (ShopNest) Checkou…

Junior PDF
What is the base class and derived class?

Short answer: Base Class (Parent) → Class whose members are inherited. Derived Class (Child) → Class that inherits from base class. class Vehicle { public void Start() {} } // Base Example code class Car : Vehicle {} //…

Junior PDF
What is the workaround for multiple inheritance in C#?

Short answer: Use interfaces to achieve multiple inheritance. A class can implement multiple interfaces. interface IFlyable { void Fly(); } interface IDriveable { void Drive(); } class FlyingCar : IFlyable, IDriveable {…

Junior PDF
What is the difference between inheritance and composition?

Short answer: Feature Inheritance Composition Relationship "is-a" "has-a" Reuse Derived class reuses base class Object contains other objects Flexibility Less flexible More flexible Example: Inheritan…

Junior PDF
What is method overriding?

Short answer: A derived class provides a new implementation of a base class method marked virtual. Achieves run-time polymorphism. class Vehicle { public virtual void Start() => Console.WriteLine("Vehicle starts&…

Junior PDF
What is the use of the virtual and override keywords?

Short answer: virtual → Marks a base class method as overridable. override → Overrides a virtual method in the derived class. Real-world example (ShopNest) ShopNest has a base PaymentMethod with virtual decimal Fee() . U…

Junior PDF
What is the sealed keyword?

Short answer: Prevents a class from being inherited or a method from being overridden. sealed class FinalClass { } class Car : FinalClass { } // Not allowed Real-world example (ShopNest) Think of ShopNest’s Product , Car…

Junior PDF
What is the difference between new and override in inheritance?

Short answer: override → Overrides a virtual method in base class (runtime polymorphism). new → Hides a base class method (compile-time hiding, not true overriding). class Vehicle { public void Start() => Console.Writ…

Junior PDF
What is the constructor order in inheritance?

Short answer: Base class constructor executes first, then derived class constructor. Ensures base members are initialized before derived members. Real-world example (ShopNest) ShopNest has a base PaymentMethod with virtu…

C# OOP C# Programming Tutorial · OOP

Short answer: A blueprint or template for creating objects. Defines properties (data) and methods (behavior) that the objects will have. public class Car

Example code

{
public string Model { get; set; }
public void Start() { Console.WriteLine("Car started"); }
}

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 instance of a class with actual values. Represents a real-world entity in memory. Car myCar = new Car(); // Object of Car class

Example code

An instance of a class with actual values. Represents a real-world entity in memory. Car myCar = new Car(); // Object of Car class

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 Class Object Definition Blueprint/Template Instance of a class Memory Does not occupy memory Occupies memory Example class Car { } Car myCar = new Car();

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: A special method used to initialize objects when they are created. Has the same name as the class and no return type. public class Car

Example code

{
public string Model;
public Car(string model) { Model = model; }
}
Car car = new Car("Tesla");

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: A method called automatically when an object is destroyed. Used to release resources before the object is removed from memory. In C#, destructors are rarely needed due to garbage collection. ~Car() { Console.WriteLine("Car object destroyed"); }

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: The practice of hiding internal details of a class and exposing only necessary functionality through access modifiers and properties. private int speed;

Example code

public int Speed
{ get { return speed; } set { speed = value; }
}

Real-world example (ShopNest)

ShopNest’s Order keeps _items private and exposes AddItem() so totals stay correct—callers cannot put a negative quantity directly into the list.

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: Hiding implementation details and showing only the essential features of an object. Achieved using abstract classes and interfaces. abstract class Vehicle {

Example code

public abstract void Start();
}

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: Mechanism where a class (derived/child) inherits properties and methods from another class (base/parent). Promotes code reusability. class Car : Vehicle

Example code

{
public override void Start() { Console.WriteLine("Car started");
}
}

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: Ability of an object to take multiple forms. Types: Compile-time (method overloading) Run-time (method overriding) Vehicle v = new Car(); v.Start(); // Run-time polymorphism

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: Car object: Class → Car Objects → myCar, yourCar Properties → Color, Model, Speed Methods → Start(), Stop(), Accelerate() Shows encapsulation, inheritance (e.g., ElectricCar : Car), and polymorphism in action.

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: Encapsulation is the mechanism of hiding internal details of an object and exposing only necessary functionalities. It helps in protecting data and maintaining control over how it is accessed or modified. Example: A BankAccount class hides its balance and only allows deposit/withdraw operations: private decimal balance;

Example code

public void Deposit(decimal amount) { if(amount > 0) balance += amount; }

Real-world example (ShopNest)

ShopNest’s Order keeps _items private and exposes AddItem() so totals stay correct—callers cannot put a negative quantity directly into the list.

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: Private → Hides data from outside access, ensuring security. Public → Provides controlled access through properties or methods. Example: private decimal balance; // hidden

Example code

public decimal Balance { get { return balance; } } // read-only access

Real-world example (ShopNest)

ShopNest’s Order keeps _items private and exposes AddItem() so totals stay correct—callers cannot put a negative quantity directly into the list.

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: Internal → Accessible only within the same assembly. Protected → Accessible in the class and derived classes. Protected Internal → Accessible in derived classes or within the same assembly.

Example code

protected string accountType; // accessible in derived classes internal string branchCode; // accessible within same assembly

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: Properties provide controlled access to private fields. Enable validation, read-only/write-only access, and future flexibility. Example: private int score;

Example code

public int Score
{ get { return score; } set { if (value >= 0) score = value; } // validation
}

Real-world example (ShopNest)

ShopNest’s Order keeps _items private and exposes AddItem() so totals stay correct—callers cannot put a negative quantity directly into the list.

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: Abstraction is the process of hiding the internal implementation details of a system and exposing only the essential features. It allows developers to focus on what an object does, not how it does it.

Example code

A Vehicle class exposes Start() method without revealing engine details.

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 Methods Can have abstract + concrete methods Only abstract methods (C# 8+ allows default implementation) Fields Can have fields Cannot have fields Inheritance Single inheritance Multiple interfaces can be implemented Constructo Can have constructors Cannot have constructors

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: Reduces system complexity by focusing on essential features. Decouples modules, making large systems easier to maintain and extend. Promotes code reuse and flexibility.

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: Base Class (Parent) → Class whose members are inherited. Derived Class (Child) → Class that inherits from base class. class Vehicle { public void Start() {} } // Base

Example code

class Car : Vehicle {} // Derived

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: Use interfaces to achieve multiple inheritance. A class can implement multiple interfaces. interface IFlyable { void Fly(); } interface IDriveable { void Drive(); } class FlyingCar : IFlyable, IDriveable { public void Fly() {} public void Drive() {} }

Example code

Use interfaces to achieve multiple inheritance. A class can implement multiple interfaces. interface IFlyable { void Fly(); }
interface IDriveable { void Drive(); }
class FlyingCar : IFlyable, IDriveable { public void Fly() {} public void Drive() {} }

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 Inheritance Composition Relationship "is-a" "has-a" Reuse Derived class reuses base class Object contains other objects Flexibility Less flexible More flexible Example: Inheritance → Car is a Vehicle Composition → Car has a Engine

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: A derived class provides a new implementation of a base class method marked virtual. Achieves run-time polymorphism. class Vehicle { public virtual void Start() => Console.WriteLine("Vehicle starts"); } class Car : Vehicle { public override void Start() => Console.WriteLine("Car starts"); }

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: virtual → Marks a base class method as overridable. override → Overrides a virtual method in the derived class.

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: Prevents a class from being inherited or a method from being overridden. sealed class FinalClass { } class Car : FinalClass { } // Not allowed

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: override → Overrides a virtual method in base class (runtime polymorphism). new → Hides a base class method (compile-time hiding, not true overriding). class Vehicle { public void Start() => Console.WriteLine("Vehicle");

Example code

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

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: Base class constructor executes first, then derived class constructor. Ensures base members are initialized before derived members.

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
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