Wipro
Bahwan CyberTek Interview Questions and Answers
Q1. How to use DI in .Net Core
DI in .Net Core allows for loosely coupled and testable code.
Add services to the DI container in Startup.cs
Inject dependencies into classes using constructor injection
Use built-in DI or third-party libraries like Autofac
Configure lifetime of services with AddScoped, AddTransient, or AddSingleton
Q2. Ho to add validation in MVC
Validation in MVC
Use data annotations for server-side validation
Use jQuery validation for client-side validation
Customize validation messages using ErrorMessage property
Use ModelState.IsValid to check if validation passed
Use ModelState.AddModelError to add validation errors
Q3. Ho to Use Transactions in Sql
Transactions in SQL ensure data consistency and integrity during multiple operations.
Transactions group multiple SQL statements into a single unit of work.
They ensure that all statements are executed or none are executed.
They provide data consistency and integrity during multiple operations.
Transactions can be started with BEGIN TRANSACTION and committed with COMMIT or rolled back with ROLLBACK.
They are useful in situations where multiple operations need to be performed atomi...read more
Q4. Ho to call DI in controller
To call DI in controller, inject the required service in the constructor of the controller.
Add required service in ConfigureServices method of Startup.cs
Inject the service in the constructor of the controller
Use the service in the controller methods
Q5. How to Use Webapi
WebAPI is a framework for building HTTP services that can be consumed by a broad range of clients.
Create a new WebAPI project in Visual Studio
Define API endpoints using HTTP verbs (GET, POST, PUT, DELETE)
Use attribute routing to map URLs to actions
Return data in JSON format
Secure the API using authentication and authorization
Q6. Clustered vs Non-Clustered
Clustered indexes determine physical order of data, non-clustered indexes are separate structures.
Clustered indexes sort and store data rows in the table based on their key values.
Non-clustered indexes have a separate structure that includes the indexed columns and a pointer to the data row.
Tables can have only one clustered index, but multiple non-clustered indexes.
Clustered indexes are faster for retrieving large amounts of data, while non-clustered indexes are faster for r...read more
Q7. Query Optimization in Sql
Query optimization in SQL
Use indexes to speed up queries
Avoid using SELECT *
Use JOINs instead of subqueries
Avoid using functions in WHERE clauses
Use EXPLAIN to analyze query performance
Q8. Inner vs Outer Join
Inner join returns only matching records while outer join returns all records from both tables.
Inner join is used to retrieve records that have matching values in both tables.
Outer join is used to retrieve all records from both tables, even if there are no matching values.
Left outer join returns all records from the left table and matching records from the right table.
Right outer join returns all records from the right table and matching records from the left table.
Reviews
Interviews
Salaries
Users/Month