Anda di halaman 1dari 5

C# /ASP.net/jQuery/MVC/.Net/Design pattern 1) What is the difference between string and string builder?

2) User control : How to do postback through web page? 3) What are and delegate events? 4) How to use delegate and event in user control? 5) MVC and asp.net difference. Why to choose MVC if ASP.net fulfils my project requirements? 6) Partial views and strongly typed view difference. 7) What is master page? 8) How to do javascript client side validation? Why we do validation at client side? 9) How to use jquery in textbox bind event? 10) How to use observer design pattern for user control? 11) How to implement singleton and faade pattern? 12) What are limitations of Open XML? 13) What is difference between a.equals(b) and a==b? 14) What is the performance issue in for loop? 15) What is Nuget? 16) If I want to do debugging in Jquery then which library I need to add in my project? 17) What is the yield and its purpose in C#? 18) Have you used any collections in C#? What is the purpose of using it? 19) How to find whether data is stored in stack or its in heap? 20) How registry is maintained? 21)What are advantages of Interop? 22) How to use satellite assemblies? Have you ever thought of using it in your project? 23) How to improve performance of code in C#? Do you follow any techniques? 24) What is publisher subscriber model? Any design pattern can be implemented for it? SQL section: 1) What is the difference between truncate and delete? 2) How to count of inserted rows without select statement? 3) What is SQL bulk copy? 4) What is performance tuning in SQL? 5) How you can retrieve data which is case sensative using SQL query? 6) Are there any index present other than clustered and non-clustered index? 7) How to find employee's data alongwith its manager's data if you have table which has following columns empid , manager's id , name,salary, designation etc.

1) What is the difference between string and string builder? String: a.It uses the the namespace "System" b.It is immutable, meaning value will not be overwritten in the memory while assigning new value variable to the string. It creates a new memory space for storing the new variable. c.It is sequential collection of Unicode characters for representing text d.Additional memory will be allocated during concatenation.

StringBuilder: a.It belongs to the namespace "System.Text" b.It is mutable, meaning value will be overwritten in the memory while assigning new value variable to the string. c.Cannot assign value directly to string.You need to create object
StringBuilder obj = new StringBuilder("Hello World");

d.During concatenation additional memory will allocated only if it exceeds buffer capacity. 3)What are difference between events and delegate? Both delegates and events are tied together Event: 1. It is the outcome of an action. 2. Event Source(Which raises the event) and receiver(object that responds to the event)are the two important terms 3. Delegate acts as a communication channel between Event Source and Event Source. Delegate: 1.It is function pointer. 2.Delegate can call more than one function. 3.There are two types of delegates (i) Single Cast (ii)Multi Cast
//declaring delegate public delegate void sample_delegate(); public void GoodMorning() { MessageBox.Show("Hello Friend" + "GoodMorning"); } public void GoodEvening() { MessageBox.Show("Hello Friend" + "GoodEvening"); } private void button2_Click(object sender, EventArgs e) { // instantiation // Here we are calling two methods so it is multicast delegate // If you call only one it is single cast sample_delegate sd = GoodMorning; sd += GoodEvening; //invoking sd(); }

5) MVC and asp.net difference. Why to choose MVC if ASP.net fulfills my project

requirements? MVC a. No View State b. No PostBack c. Code and HTML are completely separated d. Best Suited for large projects e. Unit testing can be done easily. f. Testing can be done with out invoking the view g. Can easily plugin more jquery script than asp.net easily h. Viewstate is not used for maintaining state information. i. Increase the performance ASP.NET a. It follows 'page Controller' pattern. So code behind class play a major role in rendering controls b. You cannot do unit testing only for code behind alone. You need to invoke view to do testing c. It manages the state by using view state and server based controls. d. HTML Output is not clean

6) Partial views and strongly typed view difference. Patial Views: These are sub-views or reusable views Whenever we want to reuse the views we can go in for partial views. Examples of reusable views are header and footer views where we will be using it across the application. To achieve reusable views partial views are created. It is light weight. Strongly Typed Views It is used for rendering specific types of model. It inherits from ViewPage (T --> Type of the model)

7) What is master page? Master Page is used in web application We can say master page as a template for the other pages in our project.

For creating a constant look and feel for all our pages in web application. It acts as a placeholder for the other pages or content. If a user makes a request to a webpage it merges with masterpage and will provide the output . 8) How to do javascript client side validation? Why we do validation at client side? The below code is to do client side validation
function samplejavascript() { alert('Hello World'); }

In order to increase the performance of web application and to avoid post backs. So validation are done at client side. 12) What are limitations of Open XML? OpenXML in SQL haS the limitation of storing values upto 8000 characters only 13) What is difference between a.equals(b) and a==b? == --> It compares reference "Equals" --> It compares object by VALUE.

15) What is Nuget? It is Visual Studio extension and a opens ource project By using Nuget we can easily add,update and remove libraries in Visual Studio Projects. When you add or remove a library it copies/removes necessary files to your application. It is a quick way to add reference to our application. 16) If I want to do debugging in Jquery then which library I need to add in my project? To debug jQuery code in IE using Visual Studio debugger.Add the keyword "debugger" where you want to debug
function samplejavascript() { debugger; alert('Hello World'); }

18) Have you used any collections in C#? What is the purpose of using it? Yes i have used collection in c#.

It is uses the namespace "System.Collection". It is a specialized classes for data storage and retrieval. It is type safety and increases performance. Commonly used collections are a.ArrayList b.Hashtable c.SortedList d.Stack e.Queue f.BitArray

19) How to find whether data is stored in stack or its in heap? Both are stored in the computers RAM (Random Access Memory) Value types are stored in stack and stored in sequential (LIFO). Objects are stored in Heap and data are stored randomly Some additional points:Stack is much faster than heap. Its because of the memory allocation. When it wants to allocate memory it moves up in Stack 22) How to use satellite assemblies? Have you ever thought of using it in your project? If we want to write multilingual/multicultural app and want to have it spearated from your main application. Those are called satellite assemblies. Assemblies which is containing culture information is called satellite assembley.

24) What is publisher subscriber model? Any design pattern can be implemented for it? It is also called as Observer design pattern. Windows Communication Foundation (WCF) is the best exampled for this model. The user can publish a Service and it can be consumed by many clients at the end point. The Publisher gives the data to the clients who have subscribed to their methods.

Anda mungkin juga menyukai