Microsoft Dot Net Master

Microsoft Dot Net Master
Microsoft Dot Net Master
Showing posts with label Interview Question. Show all posts
Showing posts with label Interview Question. Show all posts

Sunday, February 17, 2013

What is static keyword in .Net?

Static is same as constant variable but we can change the value of static variable and we can access the variables without creating any instances

What is the Difference between read only and constant variables?


Read only can assign the values at runtime only.
Constant will assign the values at compile time only.
We cannot modify the both variable values.

What is the difference between view state and hidden field?


viewstate is secured hidden field is insecure
Viewstate will store large amount of data but hidden filed will store small amount of data.

What is Collation?

Collation refers to a set of rules that determine how the data is sorted and compared.

What is the difference between .tostring(), Convert.tostring()?


 The basic difference between them is “Convert” function handles NULLS while
“.ToString()” does not it will throw a NULL reference exception error. So as a good coding
practice using “convert” is always safe.

What are the thread priority levels?


Thread priority levels are five types
         0 - Zero level
         1 - Below Normal
         2 - Normal
         3 - Above Normal
         4 - Highest
By Default priority level is 2

What is synchronization?


The mechanism needed to block one thread access to the data. If the data is being accessed by another thread.
Synchronization can be accessed by using system.monitor class
A monitor class methods are enter, exit, pulse for this lock statement is also used
Suppose if we need to synchronize some data at that time we need to place that data in this block
Lock
{
}
Whatever the data has been placed into the lock block that data has been blocked

What is the serialization?

Serialization is a process of converting object into a stream of bites.

What is the location of Global Assembly Cache on the system?

c:\Windows\assembly

What is the difference between application exception and system exception?

 The difference between application exception and system exception is that system exceptions are thrown by CLR and application exceptions are thrown by applications.

What are difference between truncate and delete?


 1) Delete keep the lock over each row where Truncate keeps the lock on table not on all the row.
2) Counter of the Identity column is reset in Truncate where it is not reset in Delete.
3) Trigger is not fired in Truncate where as trigger is fired in Delete.
4) In TRUNCATE we cannot rollback.
5) In DELETE we can rollback

What are difference between GET and POST Methods?


GET Method (): 

1) Data is appended to the URL.
2) Data is not secret.
3) It is a single call system
4) Maximum data that can be sent is 256.
5) Data transmission is faster
6) this is the default method for many browsers

POST Method (): 

1) Data is not appended to the URL.
2) Data is Secret
3) it is a two call system.
4) There is no Limit on the amount of data. That is characters any amount of data can be sent.
5) Data transmission is comparatively slow.
6) No default and should be explicitly specified.

What is the difference between scope_identity() and current_identity()?


Scope_identity and current _identity both are similar and it will return the last identity value generated in the table.
Scope_Identity will return the identity value in table that is currently in scope

Why we go for page rendering in Asp.Net Page life cycle?

Ans: Browser understands an only html control that’s why in page rendering we will convert the aspx controls into html controls.

What are the differences between value type and reference type


Value type contain variable and reference type are not containing value directly in its memory.
Memory is allocated in managed heap in reference type and in value type memory allocated in stack. Reference type ex-class value type-struct, enumeration

How many types of memories are there in .net?

Two types of memories are there in .net stack memory and heap memory

What is static keyword in .Net?

Static is same as constant variable but we can change the value of static variable and we can access the variables without creating any instances

What is Collation?

Collation refers to a set of rules that determine how the data is sorted and compared.

What are the thread priority levels?


Thread priority levels are five types
         0 - Zero level
         1 - Below Normal
         2 - Normal
         3 - Above Normal
         4 - Highest
By Default priority level is 2

What is difference between constants, read-only and, static?


Constants: The value can’t be changed
Read-only: The value will be initialized only once from the constructor of the class.
Static: Value can be initialized once.