Dot Net Core Developer

30+ Dot Net Core Developer Interview Questions and Answers

Updated 3 Jul 2025
search-icon

Asked in Infosys

1d ago

Q. How do you return and handle a large number of records in a web API?

Ans.

To handle large number of records in a web API, you can use pagination, streaming, or compression techniques.

  • Implement pagination to retrieve records in smaller chunks

  • Use streaming to process and return records in real-time

  • Apply compression techniques like GZIP to reduce the size of the response

  • Consider caching strategies to improve performance

Asked in Infosys

5d ago

Q. Why should we use Entity Framework rather than writing SQL queries?

Ans.

Entity Framework provides a higher level of abstraction, simplifies database operations, improves productivity, and reduces code complexity.

  • Entity Framework abstracts away the underlying database, allowing developers to work with a higher level of abstraction.

  • It simplifies database operations by providing an object-oriented approach to data access.

  • Entity Framework improves productivity by reducing the amount of code needed to perform database operations.

  • It reduces code comple...read more

Dot Net Core Developer Interview Questions and Answers for Freshers

illustration image

Asked in Infosys

4d ago

Q. What is dependency injection and life cycle methods

Ans.

Dependency injection is a design pattern that allows objects to be loosely coupled by providing their dependencies externally.

  • Dependency injection is a way to achieve inversion of control in software development.

  • It helps in creating loosely coupled and modular code.

  • In dependency injection, the dependencies of a class are provided externally rather than being created within the class itself.

  • This allows for easier testing, maintainability, and flexibility in the codebase.

  • There ...read more

Asked in Infosys

3d ago

Q. Where have you used generic concepts in your projects?

Ans.

Generics can be used in projects to create reusable code that can work with different types.

  • Generics can be used in data structures like lists, dictionaries, and queues to store and retrieve different types of data.

  • Generics can be used in algorithms and functions to work with different types of inputs and outputs.

  • Generics can be used in database operations to handle different types of data.

  • Generics can be used in user interfaces to create generic controls that can work with d...read more

Are these interview questions helpful?

Asked in Infosys

2d ago

Q. How do you improve your Web API performance?

Ans.

Improving web API performance involves optimizing code, caching, using asynchronous programming, and scaling infrastructure.

  • Optimize code by reducing unnecessary database queries, using efficient algorithms, and minimizing network calls.

  • Implement caching to store frequently accessed data and reduce the load on the server.

  • Use asynchronous programming to handle multiple requests concurrently and improve responsiveness.

  • Scale infrastructure by adding more servers, using load bala...read more

Asked in Infosys

6d ago

Q. What is the difference between scoped, transient, and singleton?

Ans.

Scoped, transient and singleton are three different lifetimes for services in .NET Core.

  • Scoped services are created once per request and are disposed at the end of the request.

  • Transient services are created each time they are requested.

  • Singleton services are created once and are reused throughout the lifetime of the application.

  • Use scoped services for components that are request-specific, transient services for lightweight stateless components, and singleton services for stat...read more

Dot Net Core Developer Jobs

Kogta Finance Limited logo
Lead .Net Core Developer - C#/SQL (5-10 yrs) 5-10 years
Kogta Finance Limited
4.7
Infosys Limited logo
.Net core Developer 3-5 years
Infosys Limited
3.6
Bangalore / Bengaluru
Infosys logo
Dot Net Core Developer - N 5-10 years
Infosys
3.6
Hyderabad / Secunderabad

Asked in Infosys

6d ago

Q. Explain how to do dependency injection.

Ans.

Dependency injection is a design pattern used to inject dependencies into a class or method.

  • Create an interface for the dependency

  • Create a class that implements the interface

  • Register the class with the dependency injection container

  • Inject the dependency into the class or method

  • Use the dependency in the class or method

Asked in Infosys

1d ago

Q. What is the use of delegates?

Ans.

Delegates are used to create references to methods, allowing methods to be passed as parameters or stored as variables.

  • Delegates provide a way to achieve callback functionality in C#.

  • Delegates can be used to implement event handling.

  • Delegates enable loose coupling and separation of concerns.

  • Delegates can be used to create and invoke anonymous methods.

  • Delegates can be used to implement the observer pattern.

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in Infosys

2d ago

Q. Explain the structure of the project?

Ans.

The project structure in Dot Net Core typically consists of folders for source code, configuration files, and dependencies.

  • The source code is usually organized into folders based on the application's modules or layers, such as Controllers, Models, and Views.

  • Configuration files like appsettings.json store application settings and connection strings.

  • Dependencies are managed using a package manager like NuGet, and their versions are specified in the project file (csproj).

  • The pro...read more

Asked in Infosys

5d ago

Q. How do you secure your web API?

Ans.

Securing a web API involves implementing authentication, authorization, and encryption.

  • Implement authentication to verify the identity of the client accessing the API

  • Implement authorization to control what actions the client can perform

  • Use HTTPS to encrypt the communication between the client and the API

  • Implement rate limiting to prevent abuse and protect against denial-of-service attacks

  • Apply input validation and output encoding to protect against common security vulnerabili...read more

3d ago

Q. What is a constructor and what are its types?

Ans.

A contractor is a person or company hired to perform work on a specific project or task.

  • Contractors can be individuals or companies who are hired on a temporary basis.

  • There are different types of contractors such as independent contractors, general contractors, and subcontractors.

  • Contractors are typically responsible for their own taxes, insurance, and equipment.

  • Examples of contractors include freelance developers, construction companies, and consulting firms.

3d ago

Q. What is Primary, foreign key and different

Ans.

Primary key uniquely identifies a record in a table, foreign key links two tables, and unique key ensures uniqueness of values in a column.

  • Primary key: uniquely identifies each record in a table, cannot have duplicate values

  • Foreign key: links two tables together, enforces referential integrity

  • Unique key: ensures uniqueness of values in a column, allows null values but only one null per column

Asked in Infosys

2d ago

Q. Write a join query using Entity Framework.

Ans.

Join query using Entity Framework

  • Use the LINQ query syntax to perform joins in Entity Framework

  • Use the 'join' keyword to specify the join condition

  • Use 'into' keyword to create a group join

  • Use 'on' keyword to specify the join condition

  • Use 'equals' keyword to define the equality condition

Asked in TraviYo

5d ago

Q. What are the differences between Transient, AddScoped, and AddSingleton?

Ans.

Transient creates a new instance every time it is requested, Scoped creates a new instance per scope, Singleton creates a single instance for the entire application.

  • Transient: Creates a new instance every time it is requested.

  • AddScoped: Creates a new instance per scope, such as per HTTP request.

  • AddSingleton: Creates a single instance for the entire application.

  • Example: Transient can be used for lightweight services that don't hold state, Scoped for services that need to maint...read more

Asked in TraviYo

1d ago

Q. How do you create a table using MySQL?

Ans.

To create a table using MYSQL, use the CREATE TABLE statement followed by the table name and column definitions.

  • Use the CREATE TABLE statement to create a new table

  • Specify the table name after the CREATE TABLE statement

  • Define the columns and their data types within parentheses

  • Add any additional constraints or attributes to the columns

  • Example: CREATE TABLE employees (id INT, name VARCHAR(50), age INT)

Asked in TraviYo

6d ago

Q. What is a SQL Join and why do we need it?

Ans.

SQL Join is used to combine rows from two or more tables based on a related column between them.

  • Join is used to retrieve data from multiple tables in a single query.

  • It helps in avoiding data redundancy and improving query performance.

  • Different types of joins include inner join, left join, right join, and full outer join.

  • Join conditions are specified using the ON keyword.

  • Example: SELECT * FROM table1 JOIN table2 ON table1.column = table2.column;

Asked in Infosys

2d ago

Q. What is the difference between generics and delegates?

Ans.

Delegates are function pointers used to encapsulate methods, while generics are used to create reusable code for different data types.

  • Delegates are used to create callbacks and event handlers.

  • Generics allow the creation of classes, methods, and interfaces that can work with different data types.

  • Delegates can be used to define and invoke methods dynamically at runtime.

  • Generics provide type safety and eliminate the need for boxing and unboxing operations.

  • Delegates can be multic...read more

4d ago

Q. What are the differences between DELETE, TRUNCATE, and DROP statements in SQL?

Ans.

Delete removes specific rows, truncate removes all rows, drop removes entire table in SQL.

  • Delete is used to remove specific rows from a table based on a condition.

  • Truncate removes all rows from a table but keeps the table structure.

  • Drop removes the entire table along with its structure from the database.

  • Delete is slower than truncate as it logs individual row deletions.

  • Truncate is faster than delete as it deallocates the data pages in one go.

  • Drop is irreversible and deletes t...read more

Asked in Infosys

5d ago

Q. Explain any design pattern.

Ans.

Factory pattern. Creates objects without exposing the instantiation logic to the client.

  • Defines an interface for creating objects, but lets subclasses decide which classes to instantiate.

  • Client only knows the abstract type, not the concrete type.

  • Used when a class cannot anticipate the type of objects it must create.

  • Examples: Abstract Factory, Singleton, Builder, Prototype.

Asked in Infosys

5d ago

Q. Write a program to reverse the letters in a string.

Ans.

A program to reverse the letters of a given string.

  • Create an empty string to store the reversed string

  • Iterate through the original string from the end to the beginning

  • Append each character to the empty string

  • Return the reversed string

Q. How do you handle global exceptions?

Ans.

Global exception handling in .NET Core allows centralized management of errors in web applications.

  • Use middleware to catch exceptions globally. Example: app.UseMiddleware<ExceptionHandlingMiddleware>();

  • Implement custom exception filters for specific scenarios. Example: [ServiceFilter(typeof(CustomExceptionFilter))]

  • Return standardized error responses. Example: new ObjectResult(new { error = ex.Message }) { StatusCode = 500 };

  • Log exceptions using built-in logging services. Exam...read more

Asked in TCS

5d ago

Q. Write a program to find prime numbers.

Ans.

WAP to find the prime number

  • Loop through numbers and check if divisible by any number less than it

  • Exclude 1 and the number itself

  • 2 is the only even prime number

Asked in Infosys

5d ago

Q. What is the difference between .Net and .Net Core?

Ans.

The main difference between .NET and .NET Core is that .NET Core is a cross-platform, open-source framework while .NET is a Windows-only framework.

  • NET Core is cross-platform and can run on Windows, macOS, and Linux, while .NET is limited to Windows.

  • .NET Core is open-source and community-driven, while .NET is developed and maintained by Microsoft.

  • .NET Core is modular and lightweight, allowing developers to include only the necessary components in their applications, while .NET...read more

Asked in TraviYo

4d ago

Q. What is a filter in .NET Core?

Ans.

Filters in .NET Core are used to intercept HTTP requests and responses.

  • Filters are used to add cross-cutting concerns to MVC applications.

  • They can be used for authentication, authorization, logging, exception handling, etc.

  • Filters can be applied globally, at the controller level, or at the action level.

  • Examples of filters include AuthorizeFilter, ExceptionFilter, and ActionFilter.

4d ago

Q. What are contracts in SQL?

Ans.

Contracts in SQL are agreements between two or more parties defining the terms of a relationship or operation.

  • Contracts in SQL are used to enforce business rules and ensure data integrity.

  • They can include constraints, triggers, stored procedures, and other database objects.

  • Examples of contracts in SQL include foreign key constraints, check constraints, and unique constraints.

5d ago

Q. What is the difference between a dataset and a datareader?

Ans.

Dataset is an in-memory representation of a relational database, while DataReader is a forward-only, read-only stream of data.

  • Dataset is a disconnected architecture, while DataReader is a connected architecture.

  • Dataset can hold multiple tables and relationships, while DataReader can only hold a single table.

  • Dataset can be used for data manipulation and updates, while DataReader is read-only.

  • Dataset requires more memory as it loads all data at once, while DataReader loads data...read more

Asked in Infosys

1d ago

Q. What are the basic concepts of OOP?

Ans.

OOPs concepts include encapsulation, inheritance, polymorphism, and abstraction, essential for structured programming.

  • Encapsulation: Bundling data and methods that operate on the data within one unit, e.g., a class.

  • Inheritance: Mechanism where one class inherits properties and methods from another, e.g., a 'Dog' class inheriting from an 'Animal' class.

  • Polymorphism: Ability to present the same interface for different data types, e.g., method overloading and overriding.

  • Abstract...read more

Asked in Infosys

5d ago

Q. Explain the purpose of Program.cs and Startup.cs.

Ans.

Program.cs is the entry point of a .NET Core application, while Startup.cs configures services and middleware.

  • Program.cs contains the Main method which is the entry point of the application

  • Startup.cs configures services and middleware for the application

  • In Program.cs, you can configure the host and call the Startup class

  • Startup.cs typically includes ConfigureServices and Configure methods

Asked in Infosys

6d ago

Q. What is dependency injection?

Ans.

Dependency injection is a design pattern that allows objects to be loosely coupled and dependencies to be injected at runtime.

  • Dependency injection is a way to achieve inversion of control.

  • It helps in creating modular and testable code.

  • Dependencies are provided to a class through constructor injection, property injection, or method injection.

  • It promotes code reusability and maintainability.

  • Example: In a .NET Core application, services can be registered in the dependency inject...read more

Asked in Infosys

3d ago

Q. Describe the startup class.

Ans.

Startup class is a class in ASP.NET Core that is used to configure services and middleware for the application.

  • It is responsible for configuring the application's request pipeline.

  • It is used to register services that the application will use.

  • It is where middleware components are added to the pipeline.

  • It can be used to configure the application's logging and exception handling.

  • It is typically found in the Startup.cs file in the root of the project.

1
2
Next

Interview Experiences of Popular Companies

Infosys Logo
3.6
 • 7.9k Interviews
Chetu Logo
3.3
 • 197 Interviews
Fingent Logo
4.2
 • 25 Interviews
View all

Top Interview Questions for Dot Net Core Developer Related Skills

interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

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

Dot Net Core Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits