DOT NET Developer
500+ DOT NET Developer Interview Questions and Answers
Q51. Coding Question: Count the number of words "My Name is Nikhil"
Count the number of words 'My Name is Nikhil'
Split the sentence into individual words
Count the number of words in the sentence
Q52. Singlton architecture give examples
Singleton architecture is a design pattern that restricts the instantiation of a class to one object.
Singleton pattern ensures that only one instance of a class is created and provides a global point of access to it.
Examples of Singleton pattern include database connections, logging classes, and configuration settings.
Singleton pattern can be implemented using lazy initialization, eager initialization, or thread-safe initialization.
Singleton pattern can also be implemented us...read more
Q53. What is diff between data table and dataset
Data table is a single table while dataset is a collection of tables.
Data table is a single table that represents a single database table.
Dataset is a collection of tables that can hold multiple tables from different databases.
Data table can be used to store and manipulate data from a single table.
Dataset can be used to store and manipulate data from multiple tables.
Data table is a part of dataset.
Dataset can hold multiple data tables.
Q54. What are access Modifiers? What are its types?
Access modifiers are keywords in programming languages that define the accessibility of classes, methods, and other members.
Types of access modifiers in C# are public, private, protected, internal, protected internal.
Public - accessible from any other class.
Private - accessible only within the same class.
Protected - accessible within the same class or derived classes.
Internal - accessible within the same assembly.
Protected Internal - accessible within the same assembly or der...read more
Q55. What is MVC? What is MVC page Life Cycle?
MVC stands for Model-View-Controller. It is a software architectural pattern for implementing user interfaces.
MVC separates the application into three main components: Model (data), View (UI), and Controller (logic)
MVC page life cycle involves the following stages: Routing, Controller Initialization, Action Execution, Result Execution, and Rendering
Q56. write a program to print ***** (n=5) and next line 4*, then 3*... I did all theoretical questions well, but didnt complete this program, and in 5 minutes, he took the laptop and asked be to go back.
Program to print decreasing number of asterisks in each line
Create a loop to iterate from n to 1
In each iteration, print the corresponding number of asterisks
Use a nested loop to print the asterisks in each line
Share interview questions and help millions of jobseekers 🌟
Q57. Difference between .NET core, .NET framework and .NET
NET core is a cross-platform, open-source framework for building modern, cloud-based, internet-connected applications. NET framework is a Windows-only framework for building Windows desktop applications. NET is a general term encompassing both .NET core and .NET framework.
NET core is cross-platform and open-source, while .NET framework is Windows-only.
.NET core is modular and lightweight, allowing for faster performance and easier updates.
.NET core is designed for building mo...read more
Q58. Difference between Unique, Primary Key. Clustered and Non-Clustered Indices.
Unique, Primary Key, Clustered, and Non-Clustered Indices are all used in database management to enforce data integrity and improve query performance.
Unique constraint ensures that all values in a column are unique, but allows NULL values.
Primary Key constraint ensures that all values in a column are unique and not NULL. Each table can have only one Primary Key.
Clustered Index physically reorders the way records in the table are stored. Each table can have only one Clustered ...read more
DOT NET Developer Jobs
Q59. Find the second highest salary employee names in Employee table?
Use SQL query to find the second highest salary employee names in Employee table.
Use ORDER BY clause to sort the salaries in descending order.
Use LIMIT 1 OFFSET 1 to get the second highest salary.
Join the Employee table with itself to get the employee names corresponding to the second highest salary.
Q60. what is application pool,what is IIS,how to host app in dev env,abstarction vs encapsulation,how to optimize databse to improve performance,where to start check is application crashses
Application pool is a group of one or more worker processes, IIS is a web server, hosting app in dev env involves setting up IIS, abstraction focuses on hiding implementation details, encapsulation bundles data and methods together, optimizing database involves indexing and query optimization, check for application crashes in event logs or monitoring tools.
Application pool is a group of one or more worker processes that share the same configuration and application boundaries....read more
Q61. How to create automated jobs in application?
Automated jobs can be created using scheduling tools or by writing custom code to run at specific intervals.
Use scheduling tools like Windows Task Scheduler or Cron to run jobs at specific intervals
Write custom code using libraries like Quartz.NET or Hangfire to schedule and run jobs
Jobs can perform tasks like data backups, sending emails, or running reports
Q62. If we truncate a table, the new row will start from 1 or continue?
The new row will start from 1 after truncating a table.
Truncating a table removes all rows from the table, resetting the row count to 1.
The next row inserted after truncation will have an ID of 1.
Truncating a table does not reset the auto-increment value of the primary key column.
Q63. Type of data,garbage collector etc What kind of project have you done before
I have worked on various projects including web applications, desktop applications, and mobile applications.
Developed a web application using ASP.NET MVC and Entity Framework
Created a desktop application using WPF and MVVM pattern
Built a mobile application using Xamarin.Forms
Used garbage collector to manage memory in all projects
Handled different types of data such as text, images, and videos
Q64. What is difference between VB.Net and MVC?
VB.Net is a programming language while MVC is a design pattern for organizing code in web applications.
VB.Net is a programming language used for developing applications, while MVC is a design pattern used for organizing code in web applications.
VB.Net is a part of the .NET framework, whereas MVC is a design pattern that separates an application into three main components: Model, View, and Controller.
VB.Net can be used with or without the MVC pattern, depending on the project ...read more
Q65. What are the types and number of constraints in your specific context?
There are various types of constraints in DOT NET development, including primary key, foreign key, unique, check, and default constraints.
Primary key constraints ensure each record in a table is unique.
Foreign key constraints enforce referential integrity between tables.
Unique constraints ensure that all values in a column are distinct.
Check constraints validate the data before it is inserted or updated.
Default constraints provide a default value for a column if no value is s...read more
Q66. What is the difference between an independent class and an abstract class?
Independent class can be instantiated while abstract class cannot be instantiated directly.
Independent class can be directly instantiated using the 'new' keyword.
Abstract class cannot be instantiated directly, it can only be used as a base class for other classes.
Independent class does not require any derived class to implement its members.
Abstract class can have abstract methods that must be implemented by derived classes.
Q67. What are components of Dot Net Framework?
Components of Dot Net Framework include Common Language Runtime (CLR), Class Library, and ASP.NET.
Common Language Runtime (CLR) provides environment for executing .NET programs
Class Library provides reusable code for common programming tasks
ASP.NET is a web application framework for building dynamic web sites and web applications
Q68. What is difference between and VB.Net and MVC?
VB.Net is a programming language while MVC is a design pattern for organizing code in web applications.
VB.Net is a programming language used to develop applications, while MVC is a design pattern used to organize code in web applications.
VB.Net is a part of the .NET framework, while MVC is a design pattern that separates an application into three main components: Model, View, and Controller.
VB.Net can be used with or without the MVC design pattern, depending on the project re...read more
Q69. What is difference between char and varchar?
Char is fixed length data type while varchar is variable length data type in SQL.
Char stores fixed length strings, while varchar stores variable length strings.
Char is padded with spaces to reach fixed length, while varchar does not pad with spaces.
Char is faster for fixed length data, while varchar is more flexible for variable length data.
Q70. What was the recent intersting task in current project?
Implementing a new feature to automate data migration process
Developing a custom data migration tool using C# and SQL Server
Creating scripts to extract data from legacy system and load into new system
Testing the tool with sample data to ensure accuracy and efficiency
Q71. What is inheritance and Examples in inheritance.
Inheritance is a mechanism in object-oriented programming where a class is based on another class.
Inheritance allows a subclass to inherit properties and methods from a superclass.
The subclass can also add its own properties and methods.
Examples include a Car class inheriting from a Vehicle class, or a Dog class inheriting from an Animal class.
Q72. Ngrx state management, how do you manage state in your current project?
I use Ngrx for state management in my current project by defining actions, reducers, effects, and selectors.
Define actions to describe user events or interactions
Create reducers to specify how state should change in response to actions
Implement effects to manage side effects like API calls
Use selectors to retrieve specific pieces of state for components
Q73. Can a table have multiple primary key?
Yes, a table can have multiple primary keys.
A table can have a composite primary key, which consists of multiple columns.
Each column in the composite primary key contributes to uniquely identifying each row.
Example: CREATE TABLE Employee (emp_id INT, dept_id INT, PRIMARY KEY (emp_id, dept_id));
Q74. Examples of Server side session Management? Types of Session State?
Server side session management involves storing user data on the server to maintain state. Types include in-process, out-of-process, and database.
In-process session state: Data stored in memory on the same server as the application.
Out-of-process session state: Data stored in a separate server or service, such as a state server or Redis cache.
Database session state: Data stored in a database, such as SQL Server or MySQL.
Examples: ASP.NET session state, PHP session management,...read more
Q75. Query for finding ID, Name for employee with Maximum Salary
Query to find ID and Name of employee with maximum salary
Use SQL query with MAX() function to find the maximum salary
Join the result with employee table to get ID and Name
Q76. What are the important pillars of OOPs?
The important pillars of OOPs are Inheritance, Encapsulation, Abstraction, and Polymorphism.
Inheritance allows a class to inherit properties and behavior from another class.
Encapsulation hides the internal state of an object and only exposes necessary information.
Abstraction focuses on the essential features of an object while hiding the implementation details.
Polymorphism allows objects to be treated as instances of their parent class, enabling flexibility and reusability.
Q77. Rownumber and partition by in sql or how to find duplicate in table .
ROW_NUMBER() and PARTITION BY are used in SQL to assign a unique row number to each row within a partition.
Use ROW_NUMBER() function along with PARTITION BY clause to assign a unique row number to each row within a partition.
To find duplicates in a table, you can use a combination of ROW_NUMBER() and PARTITION BY to identify rows with row numbers greater than 1.
Example: SELECT * FROM (SELECT *, ROW_NUMBER() OVER(PARTITION BY column_name ORDER BY column_name) AS row_num FROM t...read more
Q78. What is tha difference between .net framework and .net core framework
The .NET Framework is a Windows-only framework, while .NET Core is cross-platform and open-source.
The .NET Framework is a Windows-only framework, while .NET Core is cross-platform and open-source.
.NET Framework is a mature framework with a large number of libraries, while .NET Core is a lightweight framework with fewer libraries.
.NET Framework requires Windows to run, while .NET Core can run on Windows, Linux, and macOS.
The .NET Framework is not open-source, while .NET Core i...read more
Q79. What is MVC , Life cycle of MVC
MVC stands for Model-View-Controller. It is a software architectural pattern used in web development.
MVC separates the application into three interconnected components: Model, View, and Controller.
Model represents the data and business logic of the application.
View is responsible for rendering the user interface.
Controller handles user input, updates the model, and interacts with the view.
MVC follows a specific life cycle: Request is received, routing determines the appropria...read more
Q80. How can we return multiple data with different data types from a function in .c#
To return multiple data with different data types from a function in .c#, use Tuple or create a custom class with properties for each data type.
Use Tuple to return multiple data with different data types. For example: Tuple
Create a custom class with properties for each data type and return an instance of that class. For example: public class CustomData { public int Number { get; set; } public string Text { get; set; } public bool IsTrue { get; set; }}
Q81. what are the characteristics of singleton pattern and how to use
Singleton pattern ensures a class has only one instance and provides a global point of access to it.
Characteristics include private constructor, static instance variable, static method to access instance, lazy initialization, and thread safety.
Example: public class Singleton { private static Singleton instance; private Singleton() {} public static Singleton getInstance() { if (instance == null) { instance = new Singleton(); } return instance; }}
Q82. What is Object-Oriented Programming (OOP), and what are its applications?
OOP is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.
OOP focuses on creating reusable and modular code by organizing data and behavior into objects.
Key principles of OOP include encapsulation, inheritance, and polymorphism.
Examples of OOP languages include Java, C++, and C#.
Applications of OOP include software development, game development, and web development.
Q83. What is the process for inserting data in ASP.NET MVC?
The process for inserting data in ASP.NET MVC involves creating a model, a view, and a controller to handle the data insertion.
Create a model class to represent the data you want to insert
Create a view with form fields to input the data
Create a controller action method to handle the form submission and insert the data into the database
Use Entity Framework or other data access technologies to interact with the database
Q84. What is the Difference between Synchronous and Asynchronous
Synchronous means waiting for a task to complete before moving on, while Asynchronous means not waiting for a task to complete before moving on.
Synchronous operations block the execution of code until the task is completed.
Asynchronous operations allow the code to continue executing while the task is being completed.
Synchronous operations are easier to understand and debug, but can cause performance issues.
Asynchronous operations are more complex, but can improve performance ...read more
Q85. What is abstract class, method overriding, dictionary,dispose. Write instance or syntax
Abstract class is a class that cannot be instantiated, method overriding is when a subclass provides a specific implementation of a method in its superclass, dictionary is a collection of key-value pairs, dispose is a method used to release unmanaged resources.
Abstract class: Cannot be instantiated, can have abstract methods. Example: abstract class Shape { public abstract void Draw(); }
Method overriding: Subclass provides specific implementation of a method in superclass. Ex...read more
Q86. Can we have multiple Layout page?
Yes, we can have multiple Layout pages in ASP.NET MVC.
Multiple Layout pages can be created in ASP.NET MVC to provide different layouts for different sections of the website.
Each View can specify which Layout page to use by setting the Layout property in the View file.
Layout pages can be nested, allowing for a hierarchy of layouts to be used.
Example: _Layout.cshtml, _AdminLayout.cshtml, _UserLayout.cshtml
Q87. How view is created from Model?
A view is created from a model by using a view engine to render the model data into HTML markup.
Use a view engine like Razor in ASP.NET to create views from models
Pass the model data from the controller to the view using ViewBag or strongly-typed models
Use HTML helpers to display model data in the view
Q88. What are different types of Joins?
Different types of joins are Inner Join, Left Join, Right Join, and Full Join.
Inner Join: Returns rows when there is a match in both tables.
Left Join: Returns all rows from the left table and the matched rows from the right table.
Right Join: Returns all rows from the right table and the matched rows from the left table.
Full Join: Returns rows when there is a match in one of the tables.
Q89. What are types of filters in MVC?
Types of filters in MVC include Authorization filters, Action filters, Result filters, and Exception filters.
Authorization filters restrict access to actions based on user roles or permissions.
Action filters execute code before and after an action method is called.
Result filters execute code before and after the result of an action method is executed.
Exception filters handle exceptions thrown during the execution of an action method.
Q90. What is Abstract Class and Interface?
Abstract class is a class that cannot be instantiated and may contain abstract methods. Interface is a contract that defines methods that a class must implement.
Abstract class can have abstract methods as well as concrete methods.
Interface can only have method signatures, no method bodies.
A class can implement multiple interfaces but can inherit from only one abstract class.
Example: Abstract class - Animal with abstract method 'eat'. Interface - IShape with method signatures ...read more
Q91. What is Asp.Net Page Life Cycle?
ASP.NET Page Life Cycle is the series of events that occur from the time a page is requested to the time the page is fully rendered and sent to the client.
Page Request: When a page is requested by a user, ASP.NET creates an instance of the page class.
Page Initialization: The page's properties are set and controls on the page are initialized.
Page Load: The page's controls are loaded with data and events are handled.
Postback Event Handling: If the page is posted back, the event...read more
Q92. What is Equality and Equal in Sql?
Equality in SQL refers to comparing two values to see if they are the same.
In SQL, equality is determined using the = operator.
It is used in WHERE clauses to filter data based on specific values.
Example: SELECT * FROM table WHERE column_name = 'value';
Q93. What is Garbage collection in C#?
Garbage collection in C# is an automatic memory management process that deallocates memory that is no longer in use.
Garbage collection is a process where the runtime environment automatically deallocates memory that is no longer needed by the program.
It helps in preventing memory leaks and ensures efficient memory usage.
Garbage collection in C# is performed by the Common Language Runtime (CLR) and uses algorithms like Mark and Sweep, Reference Counting, and Generational Garba...read more
Q94. What is Ref and Out parameters?
Ref and Out parameters are used in C# to pass arguments by reference instead of by value.
Ref parameters are used to pass arguments by reference, allowing the called method to modify the value of the argument.
Out parameters are similar to ref parameters, but they do not require the caller to initialize the parameter before calling the method.
Example: void CalculateArea(ref int length, int width) { length = length * width; }
Example: void GetUserInfo(out string name, out int age...read more
Q95. What is ViewBag, ViewData and TempData?
ViewBag, ViewData, and TempData are used to pass data from controller to view in ASP.NET MVC.
ViewBag is a dynamic property that allows you to pass data from controller to view.
ViewData is a dictionary object that allows you to pass data from controller to view.
TempData is a dictionary object that allows you to pass data from one controller action to another.
Q96. how can you set authorization and authentication in web api ?
Authorization and authentication in web API can be set using various methods like JWT, OAuth, and Identity Framework.
Use JWT (JSON Web Tokens) for token-based authentication
Implement OAuth for secure authorization and authentication
Utilize Identity Framework for managing user authentication and authorization
Set up roles and policies to control access to resources
Q97. Different between Abstract class and interface.
Abstract class is a class that cannot be instantiated and can have both abstract and non-abstract methods. Interface is a contract that a class must adhere to.
Abstract class can have fields, constructors, and non-abstract methods, while interface cannot.
A class can inherit only one abstract class, but can implement multiple interfaces.
Abstract class can provide default implementations for some methods, while interface cannot.
Abstract class is used when there is a need for com...read more
Q98. How to transfer value from controller to view in .net?
Value can be transferred from controller to view in .NET using ViewBag, ViewData, and Model.
ViewBag is a dynamic object that can be used to transfer data from controller to view.
ViewData is a dictionary object that can be used to transfer data from controller to view.
Model is a strongly typed object that can be used to transfer data from controller to view.
Example: ViewBag.Message = "Hello World!";
Example: ViewData["Message"] = "Hello World!";
Example: return View(model);
Q99. Sarah cover 600 m streat in 5 minutes.what is the speed of Sarah in km/h?
Sarah's speed is 7.2 km/h.
Convert 600 meters to kilometers (600m = 0.6 km)
Calculate the speed using the formula: Speed = Distance / Time
Speed = 0.6 km / 5 minutes = 0.12 km/min
Convert minutes to hours (1 hour = 60 minutes)
Speed = 0.12 km/min * 60 min/hour = 7.2 km/h
Q100. Difference between Union And Union All in SQL?
Union combines and removes duplicates, Union All combines all rows including duplicates.
Union merges the results of two or more SELECT statements into a single result set.
Union All returns all rows from all SELECT statements, including duplicates.
Union requires the same number of columns in all SELECT statements, while Union All does not.
Union sorts the result set and removes duplicates, while Union All does not.
Union is slower than Union All because it performs additional pr...read more
Interview Questions of Similar Designations
Top Interview Questions for DOT NET Developer Related Skills
Interview experiences of popular companies
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month