ASP .NET Interview Questions (Part-1)

The interview is the most challenging part of getting the job. You have to do your best at the time of the interview.  I’m here to discuss with you the most important interview questions and their answers related to Object-Oriented Programming. It is not possible to discuss all the questions and their answers in just one article, so in this article, I’ll start with Basic Object-Oriented Programming (OOP) concepts and will discuss more questions in upcoming articles.

If you are good enough that you can give a good interview for the job then that’s great but if you are not confident about the interview and want to revise some interview Questions and answers, then this article will definitely help you a lot.

Question # 1: What are Classes and Objects?

Class: Class is a logical entity that doesn’t reserve any space in memory. Class is a template for creating the object.

Object: Object is an instance of the class and it’s a physical entity. Object reserves space in memory.

Example: For Example, a Student is a class, and Hussnain, Ali, Ahmad are multiple objects of the class Student.

Question # 2: What is Inheritance?

Inheritance is a mechanism in which one class inherits the properties and fields of the other class.

The class from which the other class is inherited is called Parent Class and the class which inherits the properties of other class is called the child class.

Example: For example, both students and teacher are users and they contain the same common properties of the User Class. So because of their same common properties, they can be inherited from the User Class.

Question # 3: What is Multiple Inheritance?

To inherit a class from multiple classes or multiple interfaces is called multiple inheritance. C# does not support inheritance using multiple classes but we can achieve multiple inheritance using multiple interfaces in C#.

Example: For example, BMW M3 is a sports car so it can be inherited from two interfaces (Car and Sports Car)

Question # 4: What is an Interface?

Interface, just like class, is the collection of Methods and Properties but in the interface, we can only perform Declaration of Methods, not their Initialization. It is used for creating the layout of the class and achieving multiple Inheritance.

Question # 5: What is the Difference between Abstract Class and Interface?

Abstract Class is a class in which we can create methods with or without body while Interface can never have a body of any method. Direct Object Creation is not possible in Interface and Abstract Class rather we can create the indirect objects and for this, some class has to inherit them, and then the object of that class will be created.

Here is a video where I explained these questions in very easy words.

Must watch this video (In Urdu):

Posted: 29 Apr 2021

Visit for more

Joined in Nov 2020

I am Programmer, I love writing about technology. You can contact me for any suggestions & feedback about this website. Keep writing & reading awesome articles.

() ()