.NET Interview Questions and answers Guide
.NET Interview Questions and answers Guide
1) Constructor :-
* constructor is special type of function inside class .
2) Static function :-
* static function calling hum class ke name ke sath karate hai.
3) Function :-
* function is block of code and reusable of code that performs a specific task.
4) function overloading :-
* Multiple method of same name in single class.
* in the function overriding in which All methods have same parameter (signature).
6) Default Constructor :-
* A constructor which has no argument is known as default constructor.
7) Parameterized Constructor :-
* A constructor which has parameters is called parameterized constructor.
8) Abstract class :-
* Abstract class contains both Declaration & Definition of methods.
9) Interface Class :-
* mostly Interface Class contain Declaration of methods.
* in jagged array column value is not fixed but row value is fixed.
* the out parameters dos not need to initialized before pass to the method.
* when we don't define any constructor in class that time bydefault call default constructor.
* class ke member function ko initialize karwane ke liye hum non static constructor use karte hai.
* in non static constructor we can access static variable and non static variable.
21) Encapsulation :-
* Encapsulation is the main feature of object oriented programing.
22) Inheritance :-
* inheritance is the main feature of object oriented programing.
* 1. single inheritance in which there is one base class and one derived class.
* 2. Hierarchical inheritance in which one class feature that is needed in multiple classes.
23) Abstraction :-
* Abstraction is the main feature of object oriented programing.
* Abstraction means showing only required things and hide the BACKGROUND information.
* Ex. remote of your TV. you can change the channels, volume up, volume
down means you can use only functionalities and background things you don’t know.
24) Polymorphism :-
* Polymorphism is the main feature of object oriented programing.
* Polymorphism is divided into two Greek words poly means many and
32) Properties :-
* using properties we can access private variable outside of the class.
* In C#, array index starts from 0. We can store only fixed set of elements in C# array.
* there are three types of array in c# Single Dimensional, Multidimensional and jagged array.
* To create single dimensional array, you need to use square brackets [] after the type.
* To create multidimensional array, we need to use comma inside the square brackets.
* Static declared variables are globally accessible without creating an instance of the class.
* Void is a type modifier that specifies that the method doesn't return any value.
* You can add and remove the elements from an ArrayList at runtime.
* meanse hum kisi object ko stream of bytes through kisi file, memory
by any method in the inherited classes and any method within the same class.
* Delegates are mainly used in implementing the call-back methods and events.
* The interface is similar to an abstract class because its methods are abstract.
* Ajax in ASP.net helps in reducing the traffic between server and client.
* Key Concepts:
Asynchronous: The communication with the server happens in the background, allowing
Partial Updates: Only a part of the web page is updated instead of the whole page.
The browser sends a request to the server using JavaScript (usually via XMLHttpRequest or the
newer fetch API).
The server processes the request and sends back data (in formats like JSON or XML).
JavaScript then updates the web page based on the server's response, without reloading it.
Key Concepts:
can have multiple threads running at the same time, each performing different tasks.
Main Thread: Every C# application starts with one thread, called the main thread.
The Model represents the data and the business logic of the application.
View:
Controller:
It processes the data from the Model and decides what View to render based on the user's
actions.
data sources. It is a part of the .NET Framework, which connects the .NET Application
(Console, WCF, WPF, Windows, MVC, Web Form, etc.) and different data sources.
The Data Sources can be SQL Server, Oracle, MySQL, XML, etc. ADO.NET consists
update, and delete data (i.e., performing CRUD operation) from data sources.
* What Types of Applications Use ADO.NET?
⦁ Desktop Applications
⦁ Web Applications
⦁ Console Applications
⦁ Service Applications
the form of “Key-Value Pairs”. The data in the Hashtable are organized based
on the hash code of the key. The key in the HashTable is defined by us and
more importantly, that key can be of any data type. Once we created the
Hashtable collection, then we can access the elements by using the keys.
The Keys can be of any data type but they must be unique and not null.
The capacity of a Hashtable is the number of elements that a Hashtable can hold.
* LINQ is uniform query syntax in C# and VB.NET to retrieve data from different sources
and format.
* LINQ provides a query syntax similar to SQL, allowing developers to write queries using
* LINQ is strongly typed, ensuring compile-time checking and reducing runtime errors.
* LINQ simplifies complex data queries, making code more readable and maintainable.
* LINQ reduces the amount of code required for data manipulation and analysis.
* JS programs are run by an interpreter built into the user's web browser.
* It is a case-sensitive language.
MODAL:-
* What it does: Manages the data and business logic of the application.
* Purpose: It represents the application's data and handles operations like retrieving or updating
data in a database.
VIEW:-
* What it does: Displays the data to the user and handles the user interface.
* Purpose: Responsible for rendering the data from the Model to the screen (HTML, CSS, etc.)
so the user can see it.
CONTROLLER:-
* What it does: It handles user input, processes it, and determines what happens next.
* Purpose: It takes user requests, processes the request, interacts with the Model to fetch or
modify data, and decides which View to display next.
* It is provided by Microsoft.
* Using the ASP.Net we can build dynamic websites, web applications, and web services.
* ASP.NET provides tools, libraries, and a structure to make it easier to create websites and web
apps.
* ASP.NET has built-in features to handle security and performance optimization, which helps
websites run faster and be more secure.
* 8. Freeing up of memory.
* Application State: Store data on the server shared among all users.
ViewData: Dictionary object for passing data data from controller to view.
Works like a key-value pair.
Used when you need to transfer data between two actions or during redirects.
database load. It can be used at various levels (application, page, or data caching).
* 3. Memory Optimization.
* It contains shared sections, like a header, footer, or navigation bar, which remain consistent
across multiple pages.
* Individual pages (child pages) inherit the design from the master page and only define the
content specific to that page.
Section of SQL
Syntax:
SELECT column_name(s)
FROM TableA
ON TableA.col_name = TableB.Col_name
* LEFT JOIN: Return all data of Left table and also return matched data from Right table.
Syntax:
SELECT column_name(s)
FROM TableA
ON TableA.col_name = TableB.Col_name
* RIGHT JOIN: Return all data of Right table and also return matched data from Left table.
Syntax:
SELECT column_name(s)
FROM TableA
ON TableA.col_name = TableB.Col_name
* FULL JOIN: Return all data from both table Right Table or Left Table.
Syntax:
SELECT column_name(s)
FROM TableA
ON TableA.col_name = TableB.Col_name
* The unique key is also a unique identifier for records when the primary key is not present in the
table.
* We can store NULL value in the unique key column, but only one NULL is allowed.
5) SQL Commands.
* DDL - Data Definition Language.
* SQL triggers have two main components one is action, and another is an event.
* when user delete a record from a table then the record store in bacup table.
* Atomicity
* Consistency
* Isolation
* Durability
API SECTION
1) What is an API?
* API stands for Application Programming Interface. It's a set of rules and tools that allow
different software applications to communicate with each other. Think of it as a bridge between
two programs, allowing them to exchange information or perform certain tasks together.
* Mobile apps: Many apps use APIs to communicate with servers for data.
* Software systems: APIs help different parts of a system work together, like connecting a
database to a web application.
4) Types of APIs.
* Open APIs (Public APIs): These are available to any developers, usually for free or with a
subscription, like Google Maps API.
* Internal APIs (Private APIs): These are used within a company to connect internal systems.
* Partner APIs: These are shared with specific business partners to provide services.
* Composite APIs: These combine multiple APIs to work together and return one set of data.
* SOAP: Heavier, uses XML, and offers more security features, used for complex enterprise
systems.
* Web Service: A specific kind of API that operates over a network (usually the internet).
200: Success
* What is API testing? API testing checks if an API is working correctly by sending requests and
verifying the responses. It ensures the API meets the expected behavior.