This site is 100% ad supported. Please add an exception to adblock for this site.

ASP.NET Interview Questions

Terms

undefined, object
copy deck
What is flex?
Flex in a different way of creating SWF for developers.
How do you connect flash to a database through .NET?
I'm familiar with doing it through a URLRequest and URLLoader objects.
What is a DTD? What DTD do you generally use? Why? Pros and cons.
A DTD is a Document Type Definition, also know as DOCTYPE. In a document served as text/html, the DOCTYPE informs the browswer how to interpret the content of the page. If the the doctype is not declared, the browser assumes you dont know how to code, and goes into "quirks mode". If you know what you are doing and include a correct XHTML DOCTYPE, your page will be rendered in "standards mode".
What is polymorphism and how is it used in C#?
One interface, many implementations. In C#, every type is polymorphic because they can be an instance of the Object class. Another example: You have a automobile class and a derived car or truck class. You can create an instance of the automobile class that was created from casting of the car class.
What is virtual, abtract, and override in C# used for? In other words, when do you use it?
The virtual keyword is used to modify a method, property, index, or event declaration and allow it to be overridden in a derived class. A class, method or property declared as abstract forces there to be a implemented derived class, method, or property. The override method provides a new implementation of a member inherited from a base class. You use these concepts to create reusable and modifiable software.
What is an Interface and when do you use it?
An interface looks like a class, but has no implementation. They are great for putting together plug-n-play like architectures where components can be interchanged at will. Since all interchangeable components implement the same interface, they can be used without any extra programming. Example is the remote interface that defines an increase method. The tv and radio class have a getremote method that, when called, return a anonymous class that implements remote or a class that inherits from remote like "tvremote". We can now call increase on the remote objects to increase the volume of these to appliances.
What is type safe?
It means that you can't overwrite an object type with another. Javascript is not type safe...C#.NET is.
What is a delegate?
It is a type safe function pointer. It is used to facilitate a callback to another function after it completed.
Explain the different forms of Polymorphism.
Compile-Time Method overloading - creating a different implementation of a method in the same class. Run-Time Method overriding through inheritance - using the "override" statement on an inherited virtual method.
What is the main benefit of polymorphism?
It simplifies the programming interface. So if you have a monkey class that inherits from animal and the monkey has a speak behavior, and you have an animalkingdom class that contains many animal (interface), then you can cycle through the animals and call their behaviors, thus calling monkeys specific behavior.
Why do we use properties rather than public members?
Because we can restrict the access from exterior to member variables of a class, by providing for example only a getter for that field, in this way providing encapsulation, one of the core principle of OOP.
What is encapsulation? Why use it?
It is information hiding. Used to hide variables that people using your object do not have to see.
What is the use of serializable keyword in C#?
Marking a class with the key word [Serializable] at the top ensures that the object can be serialized in an XML format primarily for data exchange between disparate systems. Also, this is required if this object is going to be inherited by other objects which needs to be serialized downstream.
What are the new things in ASP.NET 3.5?
1. Ajax Enabled web sites. 2. Language-Intergrated Queries (LINQ) 3. ListView and DataPager
What is a master page?
Master pages allow you to create a consistent layout for you pages that inherit from it. Master pages consist of sections called ContentPlaceHolders and the child pages reference these place holders using content controls/sections.
what server/client programming model does .NET use?
Code-Behind
How do you create a data connection and extract data from a db in .NET?
1. I use the EnterpriseLibrary DataBase class, specifying the connection string information in the config file. 2. Create a Command Object and specify the sql code or stored proc. 3. add parameters to the database object if needed. 4. create a datareader object. 5. use the database.executereader to set the datareader. 6. call datareader.Read() in a loop and extract data into some object.
When to use a property over a method.
When a calculation is needed then a method. Otherwise use a property. Example Date of Birth would be a property. The age would be a method.
What is the provider and adapter design pattern? How is it used in asp.net?
It allows incompatible classes to work together. Example of its use are the membership provider. You can create a custom provider in sharepoint to handle forms authentication.
What are some important classes in the SharePoint SDK Library?
1. SPSite 2. SPDocumentLibrary 3. SPFeature
What is BizTalk?
It's a server that allows organizations to connect disparate systems, such as sharepoint to a vendor during a purchase order invoice workflow process.
What software development approach have you used and what are its benefits?
We use Adaptive Software Development by James Highsmith. The benefits are: 1. App evolves in response to periodic feedback, resulting in a close match to customer requirements. 2. The development adapts to the quality profile of the product. 3. Customer is more happy because they get the product more quickly. 4. Risk of major failures in reduced. 5. Customers gain early confidence.
When do you use an interface?
1. When you want a specific type to support numerous behaviors. (e.g. remote supports increasing appliance) 2. Use an interface to design a polymorphic hierarchy for value types. 3.A well-designed interface defines a very specific range of functionality.
How does .NET execute?
Programs written for the .NET Framework execute in a software environment that manages the program's runtime requirements. Also part of the .NET Framework, this runtime environment is known as the Common Language Runtime (CLR). The CLR provides the appearance of an application virtual machine so that programmers need not consider the capabilities of the specific CPU that will execute the program. The CLR also provides other important services such as security, memory management, and exception handling. The class library and the CLR together constitute the .NET Framework.
How does CLR work?
Source code is compiled into CIL code. When the application is run, the CLR jit compiler converts CIL to code native to the OS.
Benefits of CLR?
1. Memory management. 2. Thread Management. 3. Exception handling. 4. Garbage collection. 5. Security
What is WSDL?
WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information.
What is a web service?
Web services are components on a Web server that a client application can call by making HTTP requests across the Web.
what is soap?
SOAP is a simple XML-based protocol to let applications exchange information over HTTP.
What is ajax?
"Asynchronous Javascript and XML" It represents a bunch of techniques used to produce Rich Internet Applications.
What is asp.net ajax?
asp.nets implementation of ajax.
What role does the ScriptManager play?
The ScriptManager manages all ASP.NET AJAX resources on a page and renders the links for the ASP.NET AJAX client libraries, which lets you use AJAX functionality like PageMethods, UpdatePanels etc. It creates the PageRequestManager and Application objects, which are prominent in raising events during the client life cycle of an ASP.NET AJAX Web page. It also helps you create proxies to call web services asynchronously. I used pagemethods for telecom.
What is the role of a ScriptManagerProxy?
A page can contain only one ScriptManager control. If you have a Master-Content page scenario in your application and the MasterPage contains a ScriptManager control, then you can use the ScriptManagerProxy control to add scripts to content pages. Also, if you come across a scenario where only a few pages in your application need to register to a script or a web service, then its best to remove them from the ScriptManager control and add them to individual pages, by using the ScriptManagerProxy control. That is because if you added the scripts using the ScriptManager on the Master Page, then these items will be downloaded on each page that derives from the MasterPage, even if they are not needed, which would lead to a waste of resources.
Explain the UpdatePanel?
UpdatePanel controls work by specifying regions of a page that can be updated without refreshing the whole page.
Is it possible to abort an asynchronous postpack?
Yes...hard to explain though.
Why is a polymorphic solution better than a procedural?
1. New behavior can be added without the original source code. (Example: breaking a switch statement into classes. You can just reference the library and add new classes, you don't have to modify the switch statement in the library. 2. Better organization.
What is reflection?
Reflection is the feature in .Net, which enables us to get some information about object in runtime. Example: the "Type" class returns class info at runtime about a particular object.
Why make virtual methods?
If you have a specific derived class in your hand, say the Monkey class derived from the base of Animal, and you know damn well you have a Monkey in your hand because you made a new() Monkey, the answer is the ever popular “nothing”. The Monkey’s Speak() method for instance will get run when you ask it to with the expected results. If however, you are using an AnimalFactory to create Animals willy nilly, or are passing around other unknown Animal objects in general, the difference becomes apparent
If the interviewer asks you the basic polymorphism question, answer with this:
It allows you to invoke derived class methods through a base class reference during run-time. This is handy when you need to assign a group of objects to an array and then invoke each of their methods.
Simple answer to why use a delegate?
For C# events.. An event is a class member that is activated whenever the event it was designed for occurs. I like to use the term "fires" when the event is activated. Anyone interested in the event can register and be notified as soon as the event fires. At the time an event fires, registered methods will be invoked.
What is sharepoint?
Sharepoint is a portal server, document managing tool, collaboration tool, and content management tool.
What is wss 3.0?
It's the foundation that sharepoint sits on. It's a free version that doesn't have: 1. MySite 2. Site Manager 3. Profile Store 4. Portal Site Templates 5. Certain Web parts. 6. Certain Search functions. 7. Many built-in workflows.
What is InfoPath and how can it be combined with Sharepoint?
Infopath is an application for creating forms that create xml documents. These forms can be imported into a sharepoint "form library" and used in a workflow.
How can you manipulate SharePoint functionality?
Through web services and through the object model.
What is some difficult coding problem you came across and how did you solve it?
I recently came across an issue with an ajax enabled form being very slow when updating a drop-down with many items. There was no way around the requirement that the drop-down needed all the list items...so I modified the drop-down control to be pageable.
Why do you like sharepoint programming?
I like all the features of sharepoint and the ability to mold those features to my bidding. I think it simplifies many programming hurdles of integerating with Office products.

Deck Info

46

jfeyers

permalink