Capgemini
10+ Tata Motors Interview Questions and Answers
Q1. What is the difference between IEnumerable and IQueryable?
IEnumerable is used for in-memory collection operations, while IQueryable is used for database query operations.
IEnumerable is used for querying data from in-memory collections like arrays, lists, etc.
IQueryable is used for querying data from a database using LINQ to SQL or Entity Framework.
IEnumerable executes the query in-memory, while IQueryable executes the query on the database server.
IEnumerable is suitable for LINQ to Objects, while IQueryable is suitable for LINQ to E...read more
Q2. How many session can have in application ?
The number of sessions in an application is not fixed and can vary based on the application's design and requirements.
The number of sessions in an application can depend on factors such as user activity, server capacity, and session management techniques.
For example, a simple web application may have a limited number of sessions based on the server's capacity, while a complex enterprise application may have a larger number of sessions to handle multiple users and tasks.
Sessio...read more
Q3. What is temp table in sql
Temp table is a temporary table that is created in the memory or on the disk and is used to store data temporarily.
Temp table is created using the CREATE TABLE statement with the # symbol before the table name.
It is used to store intermediate results during complex queries or stored procedures.
Temp tables are automatically dropped when the session that created them ends or when the connection is closed.
Example: CREATE TABLE #tempTable (id INT, name VARCHAR(50))
Example: INSERT...read more
Q4. What is the repository design pattern?
Repository design pattern is a design pattern that separates the data access logic from the business logic in an application.
It helps in achieving separation of concerns by isolating the data access code in a separate layer.
It provides a centralized way to access data from various sources such as databases, web services, etc.
It makes the codebase more maintainable and testable by abstracting the data access logic.
Example: Using a repository pattern to handle database operatio...read more
Q5. How Authentication works in Web api ?
Authentication in Web API involves verifying the identity of a user or system before granting access to resources.
Authentication headers like Authorization header are used to send credentials
Web API can use various authentication methods like JWT, OAuth, Basic Authentication
Authentication middleware is used to validate credentials and generate tokens
Access control lists (ACLs) can be used to define permissions for different users
Q6. Explain pillars of OOP & SOLID principles
Pillars of OOP are Abstraction, Encapsulation, Inheritance, and Polymorphism. SOLID principles are Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.
Pillars of OOP: Abstraction - hiding complex implementation details, Encapsulation - bundling data and methods together, Inheritance - creating new classes from existing ones, Polymorphism - ability to use objects of different classes interchangeably
SOLID principles: Single R...read more
Q7. SQL procedure and function difference
SQL procedure is used to perform an action, while function returns a value.
Procedures can modify data, while functions cannot.
Functions can be used in SQL statements, while procedures cannot.
Functions must return a value, while procedures do not have to.
Example of a procedure: CREATE PROCEDURE myProcedure AS SELECT * FROM myTable;
Example of a function: CREATE FUNCTION myFunction() RETURNS INT AS BEGIN RETURN 5; END;
Q8. What is dependency injection?
Dependency injection is a design pattern where components are given their dependencies rather than creating them internally.
Dependency injection helps in achieving loose coupling between classes.
It allows for easier testing by providing a way to mock dependencies.
There are three types of dependency injection - constructor injection, setter injection, and interface injection.
Q9. Explain join with example of self join.
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 based on a related column.
Self join is when a table is joined with itself.
Example: SELECT e1.name, e2.name FROM employees e1, employees e2 WHERE e1.manager_id = e2.employee_id;
Q10. What is MVC ?
MVC stands for Model-View-Controller, a software design pattern for organizing code in a web application.
MVC separates the application into three main components: Model (data), View (UI), and Controller (logic).
Model represents the data and business logic of the application.
View is responsible for displaying the data to the user.
Controller handles user input, updates the model, and selects the view to display.
MVC promotes code reusability, modularity, and separation of concer...read more
Q11. What is async-await?
Async-await is a feature in C# that allows asynchronous programming for better performance and responsiveness.
Async-await allows methods to run asynchronously, improving performance by not blocking the main thread.
It simplifies asynchronous programming by using keywords 'async' and 'await'.
Example: async Task
GetDataAsync() { await Task.Delay(1000); return 1; }
Q12. DI Concept in .net core
DI concept in .NET Core allows for loosely coupled components by injecting dependencies at runtime.
DI stands for Dependency Injection
It helps in achieving Inversion of Control (IoC)
Reduces tight coupling between components
Improves testability and maintainability of code
Example: Services are injected into controllers in ASP.NET Core
Q13. Explain Millewares and DI ?
Middleware is software that acts as a bridge between an operating system or database and applications, while DI (Dependency Injection) is a design pattern used to increase flexibility and maintainability of code.
Middleware is software that provides common services and capabilities to applications, such as authentication, logging, and routing.
DI is a design pattern where the dependencies of a class are injected from the outside rather than created within the class itself.
Middl...read more
More about working at Capgemini
Interview Process at Tata Motors
Top DOT NET Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month