First Interview as Experienced .net Developer
Hello and welcome to the blog. Today I am sharing with you some of the question that interviewer asked me in my first interview. I am Software Developer and I had applied for job of .net developer. I have experience of 3 years (2 years and 11 months to be precised), so if you have same experienced as mine and applying for a job of a .net developer then this blog can help you.
In this blog I have listed down all the questions along with their answers. I am not sharing company details but I am sharing the key skills mentioned in Job Description.
Following were the required skills:
- ASP .NET
- ASP .NET MVC
- C#
- Web API
- Microsoft SQL Server
- ASP .NET Core
- JavaScript
- JQuery
- Bootstrap
- CSS
1) Difference Between ViewBag, ViewData and TempData
ViewBag: The scope of ViewBag is permitted to the current request only and value of ViewBag will become null while redirecting.
ViewData: ViewData is a dictionary object. ViewData is also restricted to the current request and the value of ViewData will become null while redirecting.
TempData: TempData is also dictionary object to pass the data from one action to other action in same or different controller. TempData objects are stored in session object. The scope of TempData is not limited to current request. If we want we can keep TempData.
2) Difference between finalise and dispose method
Finalise() is called internally by GarbageCollector and cannot be called by user code.
Dispose() is explicitly called by user code to free unmanaged resources.
3) Which version of ASP.NET and MVC you use?
Answer to this question will differ based on your project.
Version History
| MVC Version | .Net Framework Version |
|---|---|
| version 1.0 | .NET 3.5 |
| version 2.0 | .NET 3.5/4.0 |
| version 3.0 | .NET 4.0 |
| version 4.0 | .NET 4.0/4.5 |
| version 5.0 | .NET 4.5 |
| version 5.2 | .NET 4.5 |
4) How Anti Forgery token works?
- Client request HTML page that contains a form
- The server side includes 2 tokens in response. One token is sent as a cookie and other one is placed in a hidden field. These tokens are generated randomly so that an adversary cannot guess the value.
- When client submits the form, it must send both token back to the server.
- The client sends the cookie token back as a cookie, and it sends the form token inside the form data.
- If request does not include both the tokens, the server disallows the request.
5) Life cycle of a request in MVC
User --> Browser --> Request --> Routing --> MVC handler --> Controller-->Action Execution --> View Result --> View Engine --> View Response -->Response --> Browser --> User
6) When we specify only controller name and action name in URL parameter of AJAX call. How it manages rest of the URL
It happens because of routing. Routing: When application starts, it register one or more patterns in route table to tell the routing system, what to do with any request that matches these patterns.
7) How to return JSON from Web API?
- Change Register method:- config.Formatter.JsonFormatter.SupportedMediatyepe.Add(new MediaTypeHeaderValue("text/html"));
- Return HttpResponeMessage in method: Request.CreateResponse(HttpStatusCode.Ok, result)
8) Difference between Task and Thread
- Task can return result.
- There is no direct mechanism to return the result from thread.
9) Difference between TempTable and Table Variable
Scope of table variable ends with "GO" statement. Constraints of table variable needs to be defined while creation of table variable. We cannot add any constraints after table variable is created.
Scope of temptable does not end with "GO" statement. Temptable are available till session is closed. All temptable are created in tempdb database.
10) Syntax of creating stored procedure
create procedure procedure_name
@param1 datatype,
@param2 datatype,
As
Begin
----
Some SQL statements
-----
End
Here is the end of my first interview question and answers. I will post more about my ongoing interviews. If you think, the answer for any question can be better, please comment and let me know. I would really appreciate your help in finding better answers.
Lastly, If you know any about any openings or you are any recruiter, please contact me at my email: pinjarimustafa27@gmail.com.
Comments
Post a Comment