Interview Questions - 6

Friday, September 19, 2008

What is CLS (Common Language Specificaiton)?
It provides the set of specificaiton which has to be adhered by any new language writer / Compiler writer for .NET Framework. This ensures Interoperability. For example: Within a ASP.NET application written in C#.NET language, we can refer to any DLL written in any other language supported by .NET Framework. As of now .NET Supports around 32 languages.

What is CTS (Common Type System)?
It defines about how Objects should be declard, defined and used within .NET. CLS is the subset of CTS.

What is Boxing and UnBoxing?
Boxing is implicit conversion of ValueTypes to Reference Types (Object) .
UnBoxing is explicit conversion of Reference Types (Object) to its equivalent ValueTypes. It requires type-casting.

What is the difference between Value Types and Reference Types?
Value Types uses Stack to store the data where as the later uses the Heap to store the data.

What are the different types of assemblies available and their purpose?
Private, Public/shared and Satellite Assemblies.

Private Assemblies : Assembly used within an application is known as private assemblies

Public/shared Assemblies : Assembly which can be shared across application is known as shared assemblies. Strong Name has to be created to create a shared assembly. This can be done using SN.EXE. The same has to be registered using GACUtil.exe (Global Assembly Cache).

Satellite Assemblies : These assemblies contain resource files pertaining to a locale (Culture+Language). These assemblies are used in deploying an Gloabl applicaiton for different languages.

Is String is Value Type or Reference Type in C#?
String is an object (Reference Type).

Which controls do not have events?
Ans:Timer control.

What is the maximum size of the textbox?

Which property of the textbox cannot be changed at runtime?
Ans:Locked Porperty.

Which control cannot be placed in MDI?
Ans:The controls that do not have events.

Difference between a sub and a function.
Ands -A Sub Procedure is a method will not return a value
-A sub procedure will be defined with a “Sub” keyword
Sub ShowName(ByVal myName As String)
Console.WriteLine(”My name is: ” & myName)
End Sub

-A function is a method that will return value(s).
-A function will be defined with a “Function” keyword
Function FindSum(ByVal num1 As Integer, ByVal num2 As Integer) As Integer
Dim sum As Integer = num1 + num2
Return sum
End Function

Explain manifest & metadata.
Ands: Manifest is metadata about assemblies. Metadata is machine-readable information about a resource, or “”data about data.” In .NET, metadata includes type definitions, version information, external assembly references, and other standardized information.

Difference between imperative and interrogative code
Ans. There are imperative and interrogative functions. Imperative functions are the one which return a value while the interrogative functions do not return a value.

What are the two kinds of properties
Ans. Two types of properties in .Net: Get & Set
Two kind of properties are scalar properties and indexed properties

Explain constructor
Ans. Constructor is a method in the class which has the same name as the class (in VB.Net its New()). It initialises the member attributes whenever an instance of the class is created.

Describe ways of cleaning up objects
Ans. The run time will maintain a service called as garbage collector. This service will take care of deallocating memory corresponding to objects. It works as a thread with least priority.when application demands for memory the runtime will take care of setting the high priority for the garbage collector,so that it will be called for execution and memory will be released.the programmer can make a call to garbage collector by using GC class in system name space.

Read more... Interview Questions - 5

Question:-What is cross page posting in ASP.NET2.0 ?
Answer: When we have to post data from one page to another in application we used server.transfer method but in this the URL remains the same but in cross page posting there is little difference - normal post back is done but in target page we can access values of server control in the source page.This is quite simple we have to only set the PostBackUrl property of Button,LinkButton or imagebutton which specifies the target page.In target page we can access the PreviousPage property.And we have to use the @PreviousPageType directive.We can access control of PreviousPage by using the findcontrol method.When we set the PostBackURL property ASP.NET framework bind the HTML and Javascript function automatically.

Question: What you think about the WebPortal ?
Answer: Web portal is nothing but a page that allows a user to customize his/her homepage. We can use Widgets to create that portal. We have to only drag and drop widgets on the page. The user can set his Widgets on any where on the page. Widgets are nothing but a page area that helps particular function to response. Widgets example are address books, contact lists, RSS feeds, clocks, calendars, play lists, stock tickers, weather reports, traffic reports, dictionaries, games etc.

Question: How to start Outlook,NotePad file in ASP.NET with code ?
Answer: To open outlook or notepad file in

Question: What is the purpose of IIS ?
Answer: IIS(Internet Information Services) a powerful Web server that helps us creating highly reliable, scalable and manageable infrastructure for Web application which runs on Windows Server 2003. IIS helps development center and increase Web site and application availability while lowering system administration costs. It also runs on Windows NT/2000 platforms and also for above versions. With IIS, Microsoft includes a set of programs for building and administering Web sites, a search engine, and support for writing Web-based applications that access database. IIS is also called http server since it process the http request and gets http response.

Question: What is main difference between GridLayout and FormLayout ?
Answer: GridLayout helps in providing absolute positioning of every control placed on the page.It is easier to devlop page with absolute positioning because control can be placed any where according to our requirement.But FormLayout is little different and only experience Web Devloper used this one reason is it is helpful for wider range browser.If there is absolute positioning we can notice that there are number of DIV tags.But in FormLayout whole work are done through the tables.

Question: How Visual SourceSafe helps Us ?
Answer: One of the powerful tool provided by Microsoft to keep up-to-date of files system its keeps records of file history once we add files to source safe it can be add to database and the changes added by different user to this files are maintained in database from that we can get the older version of files to.This also helps in sharing,merging of files.

Question: Com Marshler function in .NET ?
Answer: Com Marshler is useful component of CLR.Main work of marshal data between Managed and Unmanaged environment .It helps in representation of data accross different execution enviroment.Its also convert data format between manage and unmanaged code.By the helps of Com Marshlar CLR allows manage code to interoperate with unmanaged code.

What is ViewState?
ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used the retain the state of server-side objects between postabacks.

What is the lifespan for items stored in ViewState?

Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page).

What does the "EnableViewState" property do? Why would I want it on or off?

It allows the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser. When the page is posted back to the server the server control is recreated with the state stored in viewstate.

What are the different types of Session state management options available with ASP.NET?

ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server. Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable.



About This Blog


  © Blogger template The Professional Template II by 2009

Back to TOP