Tag: QnA

  • Program to get 2nd highest salary using C#

    Read More: Program to get 2nd highest salary using C#
  • Code-First approach in EF Core, including migrations.

    The Code-First approach allows you to define your database schema using .NET classes. EF Core uses these classes to generate the database schema. Migrations:

    Read More: Code-First approach in EF Core, including migrations.
  • Middleware in ASP.NET Core with custom middleware

    Read More: Middleware in ASP.NET Core with custom middleware
  • Dependency Injection (DI) in ASP.NET Core, including different lifetime scopes.

    DI is a design pattern that allows classes to receive their dependencies from an external source, promoting loose coupling and testability. ASP.NET Core has built-in support for DI. Lifetime Scopes:

    Read More: Dependency Injection (DI) in ASP.NET Core, including different lifetime scopes.
  • Explain polymorphism in detail, including method overloading and overriding.

    Polymorphism allows objects of different classes to be treated as objects of a common type. Method Overloading: Method Overriding:

    Read More: Explain polymorphism in detail, including method overloading and overriding.
  • What are the four pillars of OOP?

    Encapsulation: Hiding data and implementation details. Achieved through access modifiers (public, private, protected). Inheritance: Creating new classes based on existing classes. Promotes code reuse. Polymorphism: Allowing objects to take on multiple forms. Method overloading (same name, different parameters). Method overriding (derived class provides a different implementation of a base class method). Abstraction: Focusing on essential features and hiding unnecessary…

    Read More: What are the four pillars of OOP?
  • What is the difference between == and .Equals()?

    ==: Checks for reference equality (whether two references point to the same object) for reference types and value equality for value types. .Equals(): Virtual method. Can be overridden to provide custom equality logic. Example:

    Read More: What is the difference between == and .Equals()?
  • What is boxing and unboxing?

    Boxing: Converting a value type to an object (reference type). Unboxing: Converting an object back to a value type. Example:

    Read More: What is boxing and unboxing?
  • What are events?

    Events are a mechanism for objects to notify other objects about actions or changes. They are based on delegates and follow a publisher-subscriber pattern.

    Read More: What are events?
  • What are delegates?

    Delegates are type-safe function pointers. They allow you to pass methods as arguments to other methods, enabling event handling and callback mechanisms. Type-safe function pointers. Purpose: Allow you to pass methods as arguments. Example:

    Read More: What are delegates?