Interview questions

C#.NET interview notes part 2

A journey to C#.NET interview notes with Nishant Kumar, founder of www.careerride.com

Follow me on FACEBOOK for Job updates and other interview related articles

<<Previous   Next>>
  • Use of 'using' keyword will allow to reference to the member of a namespace. Classes and structures contain data and methods. Methods perform data manipulation and provide behavior to classes and structures. Method can return values. The method which returns value is called as function and which doesn’t return value is called as Subs.
  • Method can have parameters that are passed by value by default. We can pass parameters by reference with the ref keyword in C#.NET and byref in VB.NET.
  • The constructor is like any method of the class, but gets created before the object is available for use. This is the first method to get called on the instantiation of the class.
  • The destructor is called just before an object is destroyed. It is used for code clean-up when object is no longer in use. Developer has no control when a destructor is called, since it gets called by CLR.
  • .Net Framework provides utility like garbage collection.
  • The garbage collection is responsible for automatic memory reclamation when object is no more in use.
  • The garbage collection is a low-priority thread that runs in the background of the application.
  • The GC gets high priority when memory resource is scarce.
  • We should remember that GC is called by CLR, so developer has no control when GC is called. So, we shouldn’t rely on the code placed inside destructors or finalizers. If we need to reclaim recourses urgently, we can use dispose () method which can be called explicitly.
  • The GC also gets ride of circular references, commonly known as memory leak.
  • Form is the basic unit of user interface. We can add form in the application at design time or run time. We can create one general parent form and can inherit forms from parent form using visual inheritance. While using visual inheritance, we ensures uniform look to all the forms of the application.
  • Forms have various properties that control their appearance, namely text, font, cursor, background Image, Opacity, backcolor and forecolor.
  • Forms have various intrinsic methods like Form.show, form.showdialog, form.activate, form.hide and form.close.
  • Form’s intrinsic methods cause changes in the visual interface and various events get raised like load, activated/deactivate, visiblechanged, closing, closed.
  • We can also create our own event handler which will get called when associated event is raised.
  • Each control on the form can have order of navigation which can be set using tabindex property of the control.
  • A control can contain other controls. For example panel, groupbox and tabpage.
  • We can resize and change position of the form and controls on it, manually. We can make use of docking and anchor properties for automatic resizing and positioning of the controls as we change size or position of the form.

<<Previous   Next>>
Explain how the .NET Framework performs automatic memory management.

Automatic memory management involves two major steps: Allocation of memory - When a new process is initialized, runtime reserves address space in memory for the process. This address space inside the memory is known as heap. At the very initial stage, the pointer is at the base address of managed heap.............

Explain steps to deploy an XML web service.

To deploy the XML Web service, once can add a Web Setup project using project templates or use xcopy to copy the files from the source to the destination server..............

Explain how to create windows Forms using visual inheritance in C#.NET.

a. Create a windows form called the basewindow
b. Add a menu bar on this form
c. Right click on the solution explorer and select add new item................

Explain how to use the finally statement by providing sample code using C#.NET.

Finally statement is executed always irrespective of any condition or error occurring in a method. It is often used to cleanup code................ 



Write your comment - Share Knowledge and Experience


 

 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring