Showing posts with label .Net Faq's. Show all posts
Showing posts with label .Net Faq's. Show all posts

Wednesday, February 15, 2023

Infosys .net Interview Questions

Infosys .net Interview Questions

2022-Jan

Position :SSE ,Skills : Asp.net Core, C#.net , Oops, Design Patterns ,Sql Server

  1. How do you use dependency Injection in asp.net core ?
  2. Can you please explain DI container service lifetime ?
  3. Can you explain the concept of async programming in C# and give an example of how you have used it in a project? 
  4. Can you write a sample Asynchronous programming code to serve the web api request ?
  5. how you would implement security in an ASP.NET Core web application and how can you handle authentication and authorization ?
  6. Can you give an example of how to implement a RESTful API in ASP.NET Core?
  7. Can you walk me through how you would implement unit testing in an ASP.NET Core application using xUnit or MSTest ?
  8. Can you discuss your experience with designing and implementing multithreaded applications in C#?
  9. Can you give an example of using delegates in C#?
  10. Can you write a sample piece of code to query a Employeecontext with dynamic parameters by using lambda expressions, let’s say I have dictionary variable
  11. Eg:   Dictionary<string, string> employe= 
  12.            new Dictionary<string, string>();
  13.             employe.Add("EmpName", "Subhash");
  14.             employe.Add("Department", "IT");
  15.  
  16.  Can you explain how do you implemented security for web API ?
  17. Ans : I said like we implemented JWT tokens
  18. Can you walk through the how JWT token works ? and how do you validate the token is expired or not ?
  19. How do you identify from execution plan the query is not optimized ?

Wednesday, February 8, 2017

TCS Dot net interview questions




TCS Dot net interview questions for experienced Candidates

One of my friend attended TCS dotnet interview in Bangalore. Below is his Interview experience.

First Round of technical Interview:
Interviewer started with, asking about the personal details, work experience and skill rating on asp.net mvc , c#,Oops and sqlserver.


1.       How does ‘page lifecycle’ of ASP.Net MVC works?

2.       How route table has been created in ASP.NET ASP.Net MVC?
Ans : In short,  Method : "RegisterRoutes()" is used for registering the routes which will be added in "Application_Start()" method of global.asax file, which is fired when the application is loaded or started.

3.       Why to use "{resource}.axd/{*pathInfo}" in routing in ASP.Net MVC?

4.       How can we call a JavaScript function on the change of a Dropdown List in ASP.Net MVC? Asked to write the sample code.


5.       How stage-management concept works in asp.net MVC?
Ans : Interviewer asked about the  uses of Tempdata, Viewbag, ViewData,Sessions.

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.

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 one abstract class at a time.
 Interface can extend any number of interfaces at a time.
2
Abstract class can extend from a class or from an abstract class.
Interface can have only abstract methods.
3
 Abstract class can have both abstract and concrete methods.
Interface can have only abstract methods.
4
 A class can extend only one abstract class.
 A class can implement any number of interfaces.
5
 Abstract class can have protected public and public abstract methods.
 Interface can have only public abstract methods i.e. by default.
6
 Abstract class can have static, final or static final variable with any access specifier.
Interface can have only static final (constant) variable i.e. by default.
 

15.   Does the abstract class should contain at least one abstract method?
     Ans : No, not required

16.   Why we have interface as we can do everything with abstract class?

17.  How do you maintain security for your application?
Ans: Since, our applications is an intranet, we used windows authentication

18.  How to implement windows authentication? How do you specify roles and permissions to the users?

19.   I have 10 text boxes and a button. The button should be enabled only after I have filled the values in all the textboxes. How do you do that?
    
20.  I have a transaction in the database. Inside that, I have a nested transaction. I have written an insert statement and committed. Now in the outer transaction, if I write rollback, will the committed thing inside the nested transaction will be roll-backed?


 Please share your interview experiences to my Mail id : nsubhash007@gmail.com


Wednesday, December 28, 2016

Capgemini Dotnet Interview Questions

Capgemini Asp.net MVC Interview Questions

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?

10.   What are Action filters in MVC?
11.   How Routing works In MVC?
12.   Different ways to handle exceptions ? How do you  Implemented  Exception handling  in  your project ?
13.   Can you tell any three differences between EntityFrame work and Dapper  classes?

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

RequestSubject
RequestDetails
Status
CreatedDate
PaymentFailed
PaymentFailed
New
14-10-2016
Transaction Error
Transaction is failed due to techinical error
WIP
14-10-2016
InSufficent Funds
Transaction is failed due to InSufficient funds
Completed
17-10-2016
OrderNotRecevied
Still awaiting for the Order
WIP
20-10-2016
PaymentFailed
Transaction Declined due to Insufficient funds
Completed
21-10-2016
Transaction Error
Unable to place an order
New
02-11-2016
Fund transfer
Failed to transfer funds
WIP
03-11-2016
PaymentFailed
Transaction failed due to technical issues
New
11-11-2016
Order Cancelled
Order cancelled in valid communication address
Completed
15-11-2016


Expected Output:
Status
Count
Month
NEW
1
Oct-16
WIP
2
Oct-16
Completed
2
Oct-16
NEW
2
Nov-16
WIP
1
Nov-16
Completed
1
Nov-16