Professional Documents
Culture Documents
One of my friend attended TCS dotnet interview in Bangalore. Below is his Interview experience.
6. Does Tempdata hold the data for other request in ASP.Net MVC?
7. Explain Peek method in Tempdata in ASP.Net MVC?
Ans : Similar to Keep method we have one more method called "Peek" which is used for the
same purpose. This method used to read data in Tempdata and it maintains the data for
subsequent request.
string A4str = TempData.Peek("TT").ToString();
8. How you can send the result back in JSON format in MVC?
Ans : return Json( objCustomer,JsonRequestBehavior.AllowGet);
a9. What are the action filters available in asp.net mvc?
Ans : An action filter is an attribute that you can apply to a controller action -- or an entire controller -- that modifies the way
in which the action is executed. The ASP.NET MVC framework includes several action filters.
OutputCache – This action filter caches the output of a controller action for a specified amount
of time.
Handle Error – This action filter handles errors raised when a controller action executes.
Authorize – This action filter enables you to restrict access to a particular user or role
10. What methods do we need to overrider to implement custom action filter?
Ans :
1. OnActionExecuting()
2. OnActionExecuted()
3. OnResultExecuting()
4. OnResultExecuted
11. Can we use multiple models for a single view? How do you achieve this?
No, we can't use multiple models for a single view at a time. But we can handle this scenario,
by creating a view model.
Yes http://www.c-sharpcorner.com/UploadFile/ff2f08/multiple-models-in-single-view-in-mvc/
12. What are the design patterns followed in your project?
Ans : I said we followed Repository patter, factory pattern
13. What is the single ton pattern? In which scenario we can use singleton pattern?
14. Difference between abstract class and interface?
Sr.No Abstract Classes Interface
1 Abstract class can extend only one class or Interface can extend any
one abstract class at a time. number of interfaces at a
time.
2 Abstract class can extend from a class or Interface can have only
from an abstract class. abstract methods.
3 Abstract class can have both abstract and Interface can have only
concrete methods. abstract methods.
4 A class can implement any
A class can extend only one abstract class.
number of interfaces.
5 Interface can have only
Abstract class can have protected public and
public abstract methods i.e.
public abstract methods.
by default.
6 Interface can have only
Abstract class can have static, final or static
static final (constant)
final variable with any access specifier.
variable i.e. by default.
15. Does the abstract class should contain at least one abstract method?
Ans : No, not required
Hi Friends,
One of my friend attended Dotnet Interview at Capgemini, Mumbai Location. Below are
the Questions, Hope these questions may helpful for the people who are searching for a Job.
Interview is conducted for 4-6 years of experience on Asp.net MVC, C# and sql server.
First round Technical Questions.
1. What are the Design patterns used in your project? What is the advantage of using
Dependency Injection?
2. Tell about your project architecture? How do you call Entities?
3. For Ex : I have two classes, customer and CustomerAddress , How do you Initialize lazy
loading ?
4. Consider a class "Customer" having below fields CustomerID, CustomerName, Age, Gender,
email, and mobileno Write a query lambda expression to filter customer details (CustomerID,
CustomerName, email and Mobile No ,exclude Gender and age) having age greater than 20.
5. Difference between var and dynamic key word?
6. What are Delegates in C# ? Explain with a Scenario where we can use Delegates?
7. How to create custom event Handlers?
8. What are collection classes in C#? Name few of the collection classes?
9. Difference between collection classes and Generic collection classes? What are the advantages
of Generic collections?
https://msdn.microsoft.com/en-us/library/mt654013.aspx
Sql Server :
1. What is the use of CTE ?
2. When to use @table variable and temp table?
3. What steps do you consider while Optimizing Query ?
4. Interviewer provided laptop and asked to write a Query from below table
Retrieve count of different statuses, month wise
RequestSubje Created
ct RequestDetails Status Date
PaymentFaile 14-10-
d PaymentFailed New 2016
Transaction Transaction is failed due to 14-10-
Error techinical error WIP 2016
InSufficent Transaction is failed due to Compl 17-10-
Funds InSufficient funds eted 2016
OrderNotRec 20-10-
evied Still awaiting for the Order WIP 2016
PaymentFaile Transaction Declined due to Compl 21-10-
d Insufficient funds eted 2016
Transaction 02-11-
Error Unable to place an order New 2016
03-11-
Fund transfer Failed to transfer funds WIP 2016
PaymentFaile Transaction failed due to 11-11-
d technical issues New 2016
Order Order cancelled in valid Compl 15-11-
Cancelled communication address eted 2016
Expected Output:
Coun Mont
Status t h
Oct-
NEW 1 16
Oct-
WIP 2 16
Compl Oct-
eted 2 16
Nov-
NEW 2 16
Nov-
WIP 1 16
Compl Nov-
eted 1 16