50 Important Interview Questions for Full Stack .N Developer

50 Important Interview or Test Questions for the Full Stack Dotnet Developer


Please Subscribe Youtube| Like Facebook | Follow Twitter

In this post we will discuss the 50 popular interview or test questions you can expect to be asked during the full stack dotnet developer interview/test.

Q1: How to get object by id in JQuery?

$( "#myId" );

Q2: How to get object by class in JQuery?

$( ".myClass" );

Q3: How to get object by input type in JQuey?

$('[type=checkBox]');

Q4: What is difference between inline CSS, internal CSS and external CSS?

Inline CSS is when we use style attribute of any HTML element to define style rules. These rules will be applied to that element only. Inline styling is probably the least efficient and least use methods of applying CSS to your HTML code. Inline CSS rules with the element overrides the rules of internal CSS as well as external CSS.
Internal CSS means adding CSS in the Head section. It can be used when a single HTML document must be styled uniquely. Internal CSS rules overrides the rules of external CSS.
External CSS is when we store CSS in a separate file and then include this file in any HTML document using element.

Q5: Which built-in method returns the character at the specified index in JavaScript?

charAt()

Q6: What is difference between == and === in JavaScript?

== operator will compare for equality after doing any necessary type conversions.
=== operator will not do the conversion. If two values are not the same type === will simply return false.

Q7: What is promise in JavaScript?

To handle asynchronous operations in JavaScript we use promise. Before promises events and callback functions were used which leads to unmanageable code. Promise is very good choice to handle asynchronous operation in a very simple way. It has four stages:

Fulfilled: Promise succeeded
Rejected: Promise failed
Pending: Promise is not fulfilled or rejected yet
Settled: Promise is fulfilled or rejected

Q8: What is different between localStorage and sessionStorage?

The localStorage and sessionStorage both allow us to save data in key/value pairs in a browser. The main difference is that while data in localStorage doesn’t expire until the user clears the browser cache or application clears the data while sessionStorage data is persisted until the window or tab is closed.

Q9: What does ajax() method do?

ajax() method sends an asynchronous HTTP request to submit or retrieve data from the server without reloading the whole page.

Q10: How to get type of object or variable in javaScript?

typeof operator is used to get the type of an object or variable in JavaScript.

Q11: List down few HTML 5 input types?

  1. Email
  2. Number
  3. Date
  4. Range

Q12: What is difference between encapsulation and abstraction?

AbstractionEncapsulation
Abstraction hides the irrelevant details found in the code.Encapsulation helps developers to organize the entire code easily.
Abstraction is outer layout in terms of design.
For Example: – Outer Look of a iPhone, like it has a display screen.
Encapsulation is inner layout in terms of implementation.
For Example: – Inner Implementation detail of a iPhone, how DisplayScreen are connect with each other using circuits.
You can use abstraction using Interface and Abstract Class.You can implement encapsulation using Access Modifiers (Public, Protected, Private & Internal).

Q13: What is difference between Abstract Class and Interface?

Both are used to achieve abstraction with the help of abstract methods. An abstract class is a special kind of class that cannot be instantiated . It can have abstract and non-abstract methods. Abstract class doesn’t support multiple inheritance. It can contain different types of access modifiers.

Abstract can be fully, partially or not implemented. Interface is not a class it is just a empty shell. It can have just abstract methods. Multiple inheritance can be achieved by using interface. Interface only supports public modifier as everything in interface is public. Interface needed to be fully implemented unlike abstract class. In terms of performance, abstract class is faster than interface.

Q14: What are access modifiers in C#?

Access modifiers specifies the accessibility of a member of a class or type of the class itself. C# have the following access modifiers:
Public: It can be access every where.
Private: It can be access only in the same class.
Protected: It can be accessed only in the same class, or in a class that is derived from that class.
Internal: It can be accessed only in the same assembly.
Protected internal: It can be accessed in the same assembly, or from within a derived class in another assembly.
Private protected: It can be accessed accessed only within assembly, in the same class or in a type that is derived from that class.

Q15: What is Polymorphism?

In a Greek poly means many morphism means shapes. In simple words, one object has many forms or has one name with multiple functionalities. There are two types of Polymorphism.


Compile time: Sometimes called as static polymorphism. In compile time the response to a method is determined at the compile time. Method overloading is an example of compile time polymorphism. In method overloading one class can have multiple methods with same name but different set of parameters. Compiler checks the number of parameters passed and the type of parameter and make the decision of which method to call.


Runtime : Sometimes called as Dynamic polymorphism. Method overriding is an example of runtime polymorphism. Method overriding can be achieved by using inheritance. With method overriding base class and derived class can have the same method name and same set of parameters. The compiler would not be aware of the method available for overriding the functionality. The compiler will decide which method to call at runtime.

Q16: For example we have two classes named class A and class B. Class B is inheriting class A.
Which of the Following is true?
A) A obj = new B();
B) B obj = new A();
C) Both
D) None of them

A obj = new B();

Q17: What is difference between function and stored procedure? List down any three.

  1. Function is compiled and executed every time it is called while store procedure is a pre-compiled object. It is compiled for the first time when it is called.
  2. Store procedures can not be called within a function. By the other hand, function can be called with in stored procedure.
  3. Function will always returns a value but store procedure can return 0 or n values.

Q18: What is clustered index and non clustered index?

Clustered index: In clustered index the rows are stored physically on the disk in the same order as the index. One table can have only one clustered index.
Non clustered index: In non clustered index there is a index list that has pointers to the physical rows. One table can have one or more than one non clustered index.

Q19: Wrtie a SQL query which return the count of total number of orders of each customer from Order and Customer table.
Order table have orderId, orderDate, customerId and Customer table have customerId, customerName?

select c.customerName, count(o.orderId) from Order o, Customer c where o.customerId = c.customerId group by c.customerName

Q20: How can we implement many to many relationship in SQL. Explain with example?

We can implement many to many relationship by using birdge table. For example we hava two tables Student and Course. One student can have multiple courses and single course can be assigned to multiple students. So to achieve this we will create 3rd table named StudentCourse which will have primary key of both tables.

StudentCourseStudentCourse
studentIdcourseIdstudentId
studentNamecourseNamecourseId

Q21: What is Savepoints in SQL server?

With the help of savepoint we can create a save point in a transaction by using the SAVE TRANSACTION NAMEOFSAVEPOINT statement and later can roll back part of a transaction by using ROLLBACK TRANSACTION NAMEOFSAVEPOINT statement.

Q22: What is Windows Service?

Windows Service is a computer program that runs in the background and can be started automatically when your system is started. You can pause your service and resume or restart it if need be. Windows service can continue to execute in the even if no one has logged. Windows services are very useful when you want jobs that would be executed at predefined intervals of time.

Q23: What is using block in C#?

The using block automatically dispose obtain resource when the execution of the block completed.

Q24: List down any 5 key events of Windows form?

  1. Load
  2. Activated
  3. Deactivated
  4. Closing
  5. Disposed

Q25: Why C# is managed code?

Managed code is managed by Common Language Runtime (CLR). CLR gets the managed code and compiles it into machine code unlike unmanaged code where a code which is directly executed by the operating system. C# is managed code because it runs on the CLR.

Q26: What is the purpose of global.asax file in ASP.NET?

The Global.asax file is also known as the ASP.NET application file. It is an optional file that contains code that runs in response to system level events, such as the application starting, a session ending or for global error handling. Some Global.asax file events are following:

  1. Application_Init
  2. Application_Disposed
  3. Application_Error
  4. Application_Start
  5. Application_End
  6. Session_Start
  7. Session_End

Q27: What is state management in ASP.NET?

State management is preserving the state of a control/web page/object/user in the application manually because all ASP.NET web applications are stateless. There are two types of state management techniques in ASP.NET.
1- Client-Side: In this technique all the state related information will directly stored on the client side. It includes View State, Hidden field, Cookies, Control State and Query Strings.
2- Server-side: In this technique all the state related information will directly stored on the server side. It includes Session State, Application State and Cache.

Q28: What is main difference between Session State, Application State and Cache?

Session state is specific to a single user while application state and cache data are stored at the application level and shared by all the users. For example if we have data that is changing in every 5 minutes, can be placed in cache, while if we have a data that is not changing frequently, can be placed at the application state.

Q29: List down the few events of ASP.Net page life cycle?

  1. PreInit
  2. Init
  3. InitComplete
  4. PreLoad
  5. Load
  6. LoadComplete
  7. PreRender
  8. Render

Q30: List the major built-in objects in ASP.NET?

  1. Application
  2. Request
  3. Response
  4. Server
  5. Session
  6. Context

Q31: What is routing in MVC?

Routing decides which action method of a controller class to execute. It eliminate needs of mapping each URL with a physical file.

Q32: Explain difference between ViewData VS ViewBag Vs TempData in simple words?

ViewData, ViewBag and TeampData are used for passing data from controller to view. ViewData and ViewBag are available only for current request while TempData is available for current and subsequent requests. Type conversion is required for ViewData and TempData. On the other hand there is no need to type conversion for ViewBag.

Q33: List down the different types of filters in MVC?

Authorization filters: Used to implement authentication and authorization for controller actions.
Action filters: Used to implement logic that need to be is executed before and after a controller action executes.
Result filters: Used to implement logic that need to be is executed before and after a view result is executed.
Exception filters: Used to handle errors raised by either controller actions, controller action results or other filers.

Q34: What is partial view in ASP.NET MVC?

Partial view is special type of view which renders a portion of view. It can be reusable in more than one views and helps us to reduce code duplication. In simple words a partial view enables us to render a view within the view.

Q35: What is scaffolding in MVC?

Scaffolding is a technique used to generate views and controllers based on the model present in the application. Using scaffolding, you can save your time by creating CRUD operations automatically from your model.

Q36: List down the types of LINQ?

  1. LINQ to objects
  2. LINQ to SQL(DLINQ)
  3. LINQ to dataset
  4. LINQ to XML(XLINQ)
  5. LINQ to entities

Q37: What is major difference Between First() And FirstOrDefault()?

The major difference between First() and FirstOrDefault() is that in First() if there is no record found then it will throw an exception whereas FirstOrDefault() returns a null if there is no record found.

Q38: What are Extension Methods?

Extension methods are static functions which enable us to add methods to existing types without modifying the original type.

Q39: What is Data Annotations?

Data Annotations are put in our models to validate the input from the user.

Q40: What is difference between REST API and SOAP API?

SOAP basically is a protocol. It can only work with XML format. It also requires more bandwidth for its usage. Since SOAP Messages contain a lot of information inside of it. On the other hand REST is an architectural style and it does not need much bandwidth when requests are sent to the server. REST can work with different data format such as Plain text, HTML, XML, JSON, etc but the most preferred format JSON. REST can make use of SOAP but SOAP cannot make use of REST since SOAP is a protocol and REST is an architectural pattern.

Q41: What is web farm and web garden? Explain in simple words.

Web farm: When two or more servers used to host the same application is known as web farm. It increases the capacity of an application, and improves its availability by providing fail-over. Usually a load balancer is used to attach together the web servers and routes incoming requests.
Web garden: An application pool runs with a single worker process (W3Wp.exe). When an application pool runs with multiple worker process, it is known as web garden. It provides better availability by sharing requests between multiple worker process.

Q42: What is main difference between Get and Post method?

GET and POST methods are used to transfer data from client to server in HTTP protocol but Main difference between POST and GET method is that GET request is sent via the URL string (appended to the URI with a question-mark as separator), which is visible while POST request is encapsulated in the body of the HTTP request and can’t be seen which makes it more secure way of transferring data from client to server in http protocol.

Q43: List down 5 things you would do or avoid doing for improving performance of a web application?

  1. Use cache where possible (Specially in reporting)
  2. Use less joins and increase Indexing in DB
  3. Use lazy loading where possible
  4. Load CSS first and JavaScript last
  5. Use optimize code as possible

Q44: List down 5 things you would do or avoid doing for improving security of a web application?

  1. Use Parameterized query or use Store Procedures
  2. Use encryption for sensitive data (i.e passwords)
  3. Use two way or three way authentication
  4. Don’ t store sensitive information in user browser
  5. Validate each thing at server side

Q45: what is delegate in C#?

A delegate is a reference type variable that holds the reference to a method that can be changed at the runtime. It can be used to pass method as argument to other methods or it can be used to define callback methods.

Q46: How to restrict users to input only numbers in TextBox control in windows application?

Write the following code in KeyPress event of TextBox control.

private void TextBox1_KeyPress(object sender, KeyPressEventArgs e)
{
     if (!Char.IsDigit(e.KeyChar))
          e.Handled = true;
}

Q47: What will be output of the following code?

static void Main()
{
        List<Printer> obj = new List<Printer>();
        int i=0;
        for(; i < 20; i++)
        {
            obj.Add(delegate { Console.WriteLine(i); });
        }

        foreach (var item in obj)
        {
            item();
        }
}

Will print 20 twenty times.

Q48: What will be output of the following code?

class Program {
  static String address;
  static DateTime date;
 
  static void Main() {
    Console.WriteLine(address == null ? "Address is null" : address);
    Console.WriteLine(date == null ? "Date is null" : date.ToString());
  }
}

Address is null
1/1/0001 12:00:00 AM

Q49: write a program for Singleton class?

public sealed class Singleton
{
 
        private static Singleton obj;       
        public static Singleton Instance() {

            if (obj == null) {

                obj = new Singleton();
            }

            return obj;
        }

      
}

Q50: Wrtie a c# method that will print all saturday of current month in “yyyy-MM-dd” format?

public static void GetAllSaturday() 
{
	var firstDayOfMonth = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
        var lastDayOfMonth = firstDayOfMonth.AddMonths(1).AddDays(-1);

        while (firstDayOfMonth <= lastDayOfMonth)
        {

 		if (firstDayOfMonth.DayOfWeek.ToString() == "Saturday")
                {

                    Console.WriteLine(firstDayOfMonth.ToString("yyyy-MM-dd"));

                }
           
               firstDayOfMonth = firstDayOfMonth.AddDays(1);

        }

}

Note:

Need Support?

Please Subscribe Youtube| Like Facebook | Follow Twitter


Leave a Reply

Your email address will not be published. Required fields are marked *