Dot Net Core Developer
30+ Dot Net Core Developer Interview Questions and Answers

Asked in Infosys

Q. How do you return and handle a large number of records in a web API?
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

Q. Why should we use Entity Framework rather than writing SQL queries?
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

Asked in Infosys

Q. What is dependency injection and life cycle methods
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

Q. Where have you used generic concepts in your projects?
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

Asked in Infosys

Q. How do you improve your Web API performance?
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

Q. What is the difference between scoped, transient, and singleton?
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




Asked in Infosys

Q. Explain how to do dependency injection.
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

Q. What is the use of delegates?
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 🌟

Asked in Infosys

Q. Explain the structure of the project?
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

Q. How do you secure your web API?
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

Asked in Zobi Web Solutions

Q. What is a constructor and what are its types?
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.

Asked in Zobi Web Solutions

Q. What is Primary, foreign key and different
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

Q. Write a join query using Entity Framework.
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

Q. What are the differences between Transient, AddScoped, and AddSingleton?
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

Q. How do you create a table using MySQL?
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

Q. What is a SQL Join and why do we need it?
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

Q. What is the difference between generics and delegates?
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

Asked in Zobi Web Solutions

Q. What are the differences between DELETE, TRUNCATE, and DROP statements in SQL?
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

Q. Explain any design pattern.
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

Q. Write a program to reverse the letters in a string.
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
Asked in CARE Analytics and Advisory

Q. How do you handle global exceptions?
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

Q. Write a program to find prime numbers.
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

Q. What is the difference between .Net and .Net Core?
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

Q. What is a filter in .NET Core?
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.

Asked in Zobi Web Solutions

Q. What are contracts in SQL?
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.

Asked in MBit Computraining

Q. What is the difference between a dataset and a datareader?
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

Q. What are the basic concepts of OOP?
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

Q. Explain the purpose of Program.cs and Startup.cs.
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

Q. What is dependency injection?
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

Q. Describe the startup class.
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.
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for Dot Net Core Developer Related Skills

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

