Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Search Your Question

Showing posts with label Net. Show all posts
Showing posts with label Net. Show all posts

Thursday, April 17, 2008

Basic Asp.Net Questions

  1. Explain the .NET architecture.
  2. What are object-oriented concepts?
  3. How do you create multiple inheritance in c# and .NET?
  4. When is web.config called?
  5. How many weg.configs can an application have?
  6. How do you set language in weg.config?
  7. What does connection string consist of?
  8. Where do you store connection string?
  9. What is abstract class?
  10. What is difference between interface inhertance and class inheritance?
  11. What are the collection classes?
  12. What are the types of threading models?
  13. What inheritance does VB.NET support?
  14. What is a runtime host?
  15. Describe the techniques for optimizing your application?
  16. Differences between application and session
  17. What is web application virtual directory?
  18. Differences between Active.exe and Dll
  19. Connection pooling in MTS?
  20. If cookies is disabled in client browser, will session tracking work?
  21. How do you make your site SSL-enabled?
  22. Will the following code execute successfully: response.write(’value of i=’+i);
  23. What are the provides available with VB.NET?
  24. What is a Process, Sesion and Cookie?
  25. What are Abstract base classes?
  26. What are the Difference between bstract base classes and Abstrat classes
  27. What are interface in .NET?
  28. How is Polymorphism supports in .NET?
  29. What are the 2 types of polymorphism supports in .NET?
  30. Types of compatibilities and explain them.
  31. What is aggregative? How can it be implements in .NET?
  32. Difference between COM components and .NET components?how to register it
  33. Difference between early binding and late binding?
  34. ASP.NET OBJECTS?
  35. Asp.NET life cycle? When request mode
  36. Explain ADO and its objects.
  37. What is side by side execution?
  38. Explain serialization?
  39. Explain a class access specifiers and method acess specifiers.
  40. What is the difference between overloading and overriding ? how can this be .NET
  41. Explain virtual function and its usage.
  42. How do you implement inhetance in .NET?
  43. If I want to override a method 1 of class A and this class B then how do you declared
  44. Explain friend and protected friend.
  45. Explain multiple and multi_level inheritance in .NET?
  46. Name all kind of access specifiers for a class and for methods?
  47. On ODP.NET
  48. What is non-derterministic finalization?
  49. What is isPostback property?
  50. What is dictionary base class?
  51. How can a class be extended and how is this mechanism difff from that of implementation an interface?
  52. What are indexes .NET?
  53. How can indexes be implemented in .NET?

.Net Web Development Interview Questions

Which of the following languages is NOT included in the default .NET Framework installation? C#
VB.NET
JScript.NET
VBScript.NET

What are the different types of serialization supported in .NET Framework
XmlSerializer
SoapFormatter
XPathNavigator
HttpFormatter

The CLR uses which format for assembly version numbers
Major:Minor:Revision:Build
Major:Build:Minor:Revision
Major:Revision:Minor:Build
Major:Minor:Build:Revision

What tool is used to manage the GAC?
GacMgr.exe
GacSvr32.exe
GacUtil.exe
RegSvr.exe

State True or False: A single .NET dll can contain unlimited classes
True
False

State True or False: ASP.NET can currently run only on Windows Platform
True
False

Which one of the following best describes “Type-Safe”
It ensures that the data type are safely handled
It ensures that types are not mismatched when they are called so uses a typecasting before referencing any data object
It ensures that an object only references memory locations that it’s allowed to, preventing data corruption and the accidental misuse of object types
All of the above

The number of objects in ASP.NET is
6
7
9
10

The code used to turn off buffering is
Buffering = false
OutputBuffer = false
BufferOutput = false
Buffer = Off

Can you have two applications on the same machine one which is using .NET Framework 1.1 and the other using 2.0 ?
Yes
No

Depends on System configuration
Which of the following DOT.NET tools manages certificates, certificate trust lists (CTLs), and certificate revocation lists (CRLs)?
sn.exe
certnet.exe
certmgr.exe
gacutil.exe

You need to generate a public/private key pair for using in creating a shared assembly. Given the above scenario, which .NET SDK utility should be used?
certmgr.exe
gacutil.exe
sn.exe
resgen.exe

The object that contains all the properties and methods for every ASP.NET page, that is built is
Page Object
HTTPPage Object
WebPage Object
System.Web.UI.Page

In C#, which character is used to indicate a verbatim string literal?
@
!
"
#

Which of the following operators has the highest precedence?
Pre Increment (++x)
Shift bits left: <<
Bitwise Or: |
Post Increment (x++)

The uniqueId that gets generated at the start of the Session is stored in
Client computer as a cookie
Server machine
Passed to and fro on each and every request and response
Both a and b are correct

State True or False: C# supports multiple-inheritance
True
False

Bitwise AND operator in C# is
&
&&
AND
XAND

Bitwise OR operator in C# is
OR
||
|
XOR

What’s the .NET datatype that allows the retrieval of data by a unique key?
Primary
Integer
Unique Identifier
HashTable

The keyword ‘int’ maps to one of the following .NET types
System.Int16
System.Int32
System.Int64
System.Int128

What can be achieved in IL which is not possible in C# ?
Creation of an ArrayList
Creation of a Dictionary
Creation of a two dimensional array
Creation of a non-zero based array

Which of the following is the correct code for setting a Session timeout of 30 minutes
Session.Timeout = 108000
Session.Timeout = 1800
Session.Timeout = 300
Session.Timeout = 30

The process that ASP.NET uses to keep track of Sessions without cookies is
Cookie Munging
Cookie Monking
Cookie Mocking
Cookie Munching

The method that transfers ASP.NET execution to another page, but returns to the original page when it is done is
Server.Transfer()
Server.Redirect()
Server.Execute()
Server.Return()

Asp.NET Interview Questions

  1. What do I need to create and run an ASP.NET application?
  • Windows 2000, Windows Server 2003 or Windows XP.
  • ASP.NET, which can be either the redistributable (included in the .NET SDK) or Visual Studio .NET.
  1. Are there any free IDEs for the .NET SDK?
    • Microsoft provides Visual Studio 2005 Express Edition Beta for free. Of particular interest to the ASP.NET developers would be the Visual Web Developer 2005 Express Edition Beta 2 available as a free download.
    • The ASP.NET Web Matrix Project (supported by Microsoft) is a free IDE for developing ASP.NET applications and is available here.
    • There is also a free open-source UNIX version of the Microsoft .NET development platform called Mono available for download here.
    • Another increasingly popular Open Source Development Environment for .NET is the #develop (short for SharpDevelop) available for download here.

  2. When was ASP.NET released?

    ASP.NET is a part of the .NET framework which was released as a software platform in 2002.

  3. Is a new version coming up?

    ASP.NET 2.0, Visual Studio 2005 (Whidbey), Visual Web Developer 2005 Express Edition are the next releases of Microsoft's Web platform and tools. They have already been released as Beta versions. They are scheduled to be released in the week of November 7, 2005.

  4. Explain Namespace.

    Namespaces are logical groupings of names used within a program. There may be multiple namespaces in a single application code, grouped based on the identifiers’ use. The name of any given identifier must appear only once in its namespace.

  5. List the types of Authentication supported by ASP.NET.
    • Windows (default)
    • Forms
    • Passport
    • None (Security disabled)
  6. What is CLR?

    Common Language Runtime (CLR) is a run-time environment that manages the execution of .NET code and provides services like memory management, debugging, security, etc. The CLR is also known as Virtual Execution System (VES).

  7. What is CLI?

    The CLI is a set of specifications for a runtime environment, including a common type system, base class library, and a machine-independent intermediate code known as the Common Intermediate Language (CIL). (Source: Wikipedia.)

  8. List the various stages of Page-Load lifecycle.
    • Init()
    • Load()
    • PreRender()
    • Unload()
  9. Explain Assembly and Manifest.

    An assembly is a collection of one or more files and one of them (DLL or EXE) contains a special metadata called Assembly Manifest. The manifest is stored as binary data and contains details like versioning requirements for the assembly, the author, security permissions, and list of files forming the assembly. An assembly is created whenever a DLL is built. The manifest can be viewed programmatically by making use of classes from the System.Reflection namespace. The tool Intermediate Language Disassembler (ILDASM) can be used for this purpose. It can be launched from the command prompt or via Start> Run.

  10. What is Shadow Copy?

    In order to replace a COM component on a live web server, it was necessary to stop the entire website, copy the new files and then restart the website. This is not feasible for the web servers that need to be always running. .NET components are different. They can be overwritten at any time using a mechanism called Shadow Copy. It prevents the Portable Executable (PE) files like DLLs and EXEs from being locked. Whenever new versions of the PEs are released, they are automatically detected by the CLR and the changed components will be automatically loaded. They will be used to process all new requests not currently executing, while the older version still runs the currently executing requests. By bleeding out the older version, the update is completed.

  11. What is DLL Hell?

    DLL hell is the problem that occurs when an installation of a newer application might break or hinder other applications as newer DLLs are copied into the system and the older applications do not support or are not compatible with them. .NET overcomes this problem by supporting multiple versions of an assembly at any given time. This is also called side-by-side component versioning.

  12. Explain Web Services.

    Web services are programmable business logic components that provide access to functionality through the Internet. Standard protocols like HTTP can be used to access them. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML. Web services are given the .asmx extension.

  13. Explain Windows Forms.

    Windows Forms is employed for developing Windows GUI applications. It is a class library that gives developers access to Windows Common Controls with rich functionality. It is a common GUI library for all the languages supported by the .NET Framework.

  14. What is Postback?

    When an action occurs (like button click), the page containing all the controls within the tag performs an HTTP POST, while having itself as the target URL. This is called Postback.

  15. Explain the differences between server-side and client-side code?

    Server side scripting means that all the script will be executed by the server and interpreted as needed. Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript. Since the code is included in the HTML page, anyone can see the code by viewing the page source. It also poses as a possible security hazard for the client computer.

  16. Enumerate the types of Directives.
    • @ Page directive
    • @ Import directive
    • @ Implements directive
    • @ Register directive
    • @ Assembly directive
    • @ OutputCache directive
    • @ Reference directive
  17. What is Code-Behind?

    Code-Behind is a concept where the contents of a page are in one file and the server-side code is in another. This allows different people to work on the same page at the same time and also allows either part of the page to be easily redesigned, with no changes required in the other. An Inherits attribute is added to the @ Page directive to specify the location of the Code-Behind file to the ASP.NET page.

  18. Describe the difference between inline and code behind.

    Inline code is written along side the HTML in a page. There is no separate distinction between design code and logic code. Code-behind is code written in a separate file and referenced by the .aspx page.

  19. List the ASP.NET validation controls?
    • RequiredFieldValidator
    • RangeValidator
    • CompareValidator
    • RegularExpressionValidator
    • CustomValidator
    • ValidationSummary
  20. What is Data Binding?

    Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the controls on a web form. The values from the dataset are automatically displayed in the controls without having to write separate code to display them.

  21. Describe Paging in ASP.NET.

    The DataGrid control in ASP.NET enables easy paging of the data. The AllowPaging property of the DataGrid can be set to True to perform paging. ASP.NET automatically performs paging and provides the hyperlinks to the other pages in different styles, based on the property that has been set for PagerStyle.Mode.

  22. Should user input data validation occur server-side or client-side? Why?

    All user input data validation should occur on the server and minimally on the client-side, though it is a good way to reduce server load and network traffic because we can ensure that only data of the appropriate type is submitted from the form. It is totally insecure. The user can view the code used for validation and create a workaround for it. Secondly, the URL of the page that handles the data is freely visible in the original form page. This will allow unscrupulous users to send data from their own forms to your application. Client-side validation can sometimes be performed where deemed appropriate and feasible to provide a richer, more responsive experience for the user.

  23. What is the difference between Server.Transfer and Response.Redirect?
    • Response.Redirect: This tells the browser that the requested page can be found at a new location. The browser then initiates another request to the new page loading its contents in the browser. This results in two requests by the browser.
    • Server.Transfer: It transfers execution from the first page to the second page on the server. As far as the browser client is concerned, it made one request and the initial page is the one responding with content. The benefit of this approach is one less round trip to the server from the client browser. Also, any posted form variables and query string parameters are available to the second page as well.

ASP .NET Interview Questions- Part 1

What are steps in an asp .net page lifecycle?
Init() - when the page is instantiated
Load() - when the page is loaded into server memory
PreRender() - the brief moment before the page is displayed to the user as HTML
Unload() - when page finishes loading.

2.What is the main difference between Response.Write() and Response.Output.Write()?
With Response.Outout.Write options are available to you to write the formatted out put.

3.When implementing classes what are the specifics of an abstract method?
An Abstract method does not provide any implementation. The class containing it can not be instantiated it must be inherited. The deriving class must override abstract methods declared in parent class, unless it is an abstract class it self.

4.List all Validation Controls available in asp .net?
RequiredFieldValidator : Checks if a control has a value.
RangeValidator : Checks if the control’s value is within a certain range.
RegularExpressionValidator : Checks whether the value of an input control matches a certain pattern
CompareValidator : Checks a control’s value against a constant or another control value.
CustomValidator : Checks a control’s value against a customized validation logic.
ValidationSummary : Displays a list of all validation errors

5.What data types do the RangeValidator control support?
Integer, String, and Date.

6.Is C# .net case sensitive?
Yes it is.

7.What is the difference between a class and struct ?
A struct is a value type while a class is a reference type. There’s no inheritance with
struct.

8.When passing a variable by reference to a method what is the difference between keywords ref and out?
When using the key word ref the variable must be initialize before calling the method,
while initialization is not mandatory when using out.

9.What are specifics for Static class?
Static class is implemented with the Keyword Static in the class definition.
It must contain only static members and methods. Public members of static class can be accessed without the class instantiation. Static class are sealed by default therefore can not be inherited. Static class cannot be instantiated.

10.What part of the code is usually called Code-Behind?
The Server side code is usually called Code-behind as reference to the fact that in a web application it is actually the part of the code handling the large part of the execution.

11.What part of the code is called Inline Code?
The asp .net client side code is usually call inline code. From most browsers it can be
view by choosing 'View source' from the page menu.

12.What is the difference between doing a Dataset.Clone() and Dataset.Copy()?
Dataset.Clone() will copy just the dataset structure including all the datatables,
schemas, relations and constraints; it will not copy the data. Dataset.Copy() will copy
both dataset structure and data.

13.What is the role of Global.asax file?
The Global.asax include its code behind file Global.asax.cs, it is use to implement
application and session level events.

14.What utility is used to manually deploy an assembly?
The GacUtil is a utility tool that comes with visual studio, it is use to deploy an
assembly by adding it into the GAC(Global Assembly Cache).

Ex: Type at the command line prompt
C:\gacutil /i ASPMyComponent.dll
will install ASPMyComponent into the GAC

15.Define MSIL. How is it use in the .Net framework?
MSIL stand for Microsoft Intermediate Language. During the compilation process, code written in any .NET compatible languages(J#, C#, VB,C++) is converted into MSIL. MSIL then create a compatibility bridge among these language before execution by the virtual machine.

16. What are differences between ASP.Net and Classic ASP?
-ASP programming is based on scripting languages like Jscript or VBScript which evolves around a mixture of scripting and HTML. ASP .net is base on an advance structured compiled language.
-ASP .net gives the option of separating the code behind (compiled code) from the design code or client code (HTML).
-ASP .net with visual studio .net provides an advanced application and session state
management, while ASP performs poorly at providing it.
-ASP has a poor error handling capability compare to ASP .net which has it much completed and much advanced.
-ASP does not have a built-in mechanism for XML while ASP .net comes with a full XML capability support.
-ASP .net has a fully distributed data source support which is missing from classic ASP

17.What property is use to set alternate color scheme in a Repeater control?
AlternatingItemTemplate.

18.What is the base class for Web Forms?
The System.Web.UI.Page class.

19.What are the meaning of terms boxing and un-boxing?
Boxing: Implicit conversion of a value type into a reference type.
Un-Boxing: Explicit conversion of a reference type into a value type. Can also be call
casting.

20.Give a brief description of how the heap and stack are managed in .Net.
Stack and heap are memory sections of the .net application. The CLR(Common Language Runtime) is in charge of managing those sections.
Value type variables are stored in the stack where storing order is Last in first out.
When a variable is out of scope it basically fall off the stack.
Refence type variable are stored on the heap where storing order is First in first out.
When a variable becomes out of scope it is mark for collection.

The GC(Garbage Collector) is the part of the CLR responsible for cleaning up the heap releasing resources occupied by Reference type variables.