.NET WebDev interview questions - Part 3

  1. State True or False: If you set AutoGenerateColumns=True and still provide custom column definitions, the DataGrid will render both
    • True
    • False
  2. The data from an XSL Transform with XmlReader can be returned in one of the following ways
    • objReader = objXslT.Transform(objNav, nothing)
    • objXslT.Transform(objNav, nothing)
    • objReader = objXslT.Transform(objNav, nothing, objWriter)
    • objXslT.Transform(objNav, nothing, objWriter)
  3. Pick the command line that would result in the C# compiler generating an XML documentation file
    • csc /doc:NewHome.xml NewHome.cs
    • c /doc /docfile: NewHome.xml NewHome.cs
    • csc /doc /out: NewHome.xml NewHome.cs
    • csc /xml NewHome.cs
  4. What is the comment syntax for C#’s XML-based documentation?
    • /** and **/
    • //#
    • ///
    • //*
  5. When creating a C# Class Library project, what is the name of the supplementary file that Visual Studio.NET creates that contains General Information about the assembly?
    • AssemblyInfo.xml
    • AssemblyInfo.cs
    • AssemblyInformation.cs
    • AssemblyAttributes.cs
  6. Which of the following is the C# escape character for Null?
    • \n
    • \0
    • \f
    • \v
  7. What is the exception that is thrown when there is an attempt to dynamically access a method that does not exist?
    • MissingMethodException
    • TypeLoadException
    • MethodLoadException
    • MethodAccessException
  8. What method(s) must be used with the Application object to ensure that only one process accesses a variable at a time?
    • Synchronize()
    • Lock() and UnLock()
    • Lock()
    • Asynchroize()
  9. After capturing the SelectedIndexChanged event for a ListBox control, you find that the event handler doesn’t execute. What could the problem be?
    • The AutoEventWireup attribute is set to False
    • The AutomaticPostBack attribute is set to False
    • The codebehind module is not properly compiled
    • The ListBox must be defined WithEvents
  10. What method must be overridden in a custom control?
    • The Paint() method
    • The Control_Build() method
    • The Render() method
    • The default constructor
  11. What is used to validate complex string patterns like an e-mail address?
    • Extended expressions
    • Regular expressions
    • Irregular expressions
    • Basic expressions
  12. The following is a valid statement in ASP.NET<%@ Page Language="C" %>
    • True
    • False
  13. A valid comment block in ASP.NET is
    • <!- - - Comment - - - >
    • <!- - Comment - - >
    • <% - - Comment - - %>
    • <% ! - - Comment - - >
  14. The event handlers that can be included in the Global.asax file are
    • Application Start and
      Session Start event handlers only
    • Application End and
      Session End event handlers only
    • Per-request and Non-deterministic event handlers only
    • Application Start and End ,
      Session Start and End, Per-request and Non-deterministic event handlers
  15. A Few of the Namespaces that get imported by default in an ASPX file are
  16. The Assemblies that can be referenced in an ASPX file without using @Assembly Directive is
  17. An .ASHX file contains the following
    • Code-behind that are used in the code
    • Server Controls that can be called from a code-behind file
    • HTTP handlers-software modules that handle raw HTTP requests received by ASP.NET
    • Contains normal ASP.NET code and can be used as an include file
  18. What is the output for the following code snippet:
    public class testClass
    {
    	public static void Main(string[] args)
    	{
    		System.Console.WriteLine(args[1]);
    	}//end Main
    }//end class testClass
    • Compiler Error
    • Runtime Error
    • Hello C# world
    • None of the above
  19. One of the possible way of writing an ASP.NET handler that works like an ISAPI filter- that is, that sees requests and responses and modifies them also, is by,
    • writing a module that extends FormsAuthenticatonModule and using it
    • writing a component class that extends HttpModuleCollection and using it
    • writing an HTTP module-a Class that implements IhttpModule and registering it in Web.Config
    • All of the above
  20. The ASP.NET directive that lets you cache different versions of a page based on varying input parameters, HTTP headers and browser type is
    • @OutputCache
    • @CacheOutput
    • @PageCache
    • @CacheAll
  21. If we develop an application that must accommodate multiple security levels through secure login and ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users?
    • <SessionState mode="InProc"stateConnectionString=" tcpip=127.0.0.1:42424" sqlConnectionString=" data source=127.0.0.1;user id=sa;password="cookieless="false" timeout="30" />
    • <SessionState mode="OutProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="30" />
    • <SessionState mode="stateserver" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="30" />
  22. What is the output for the below mentioned compilation command>csc /addmodule:A.Exe B.Cs
    • A.exe
    • B.exe
    • A.dll
    • B.dll
  23. How can be the web application get configured with the following authorization rules
    • Anonymous users must not be allowed to access the application.
    • All persons except David and John must be allowed to access the application.
      • <authorization><deny users = "applicationname\David, applicationname\John" ><allow roles ="*"><deny roles = "?"></authorization>
      • <authorization><allow users ="*"><deny users = "applicationname\David; applicationname\John" ><deny users = "*"></authorization>
      • <authorization><deny users = "applicationname\David, applicationname\John" ><deny users = "?"><allow users ="*"></authorization>
      • <authorization><allow users ="*"><deny users = "applicationname\David, applicationname\John" ></authorization>

  24. What will be the output of the following code snippet?
    using System;
    class MainClass
    {
    	static void Main( )
    	{
    		new MainClass().Display( 3.56 );
    	}
    
    	private void Display( float anArg )
    	{
    		Console.Write( "{0} {1}", anArg.GetType(), anArg );
    	}
    
    	double Display( double anArg )
    	{
    		Console.Write( "{0} {1}", anArg.GetType(), anArg );
    		return anArg;
    	}
    
    	public decimal Display( decimal anArg )
    	{
    		Console.Write( "{0} {1}", anArg.GetType(), anArg ); return anArg;
    	}
    }
    
  25. What will be output for the given code?
    Dim I as integer = 5
    Do
    	I = I + 2
    	Response.Write (I & " ")
    Loop Until I > 10
    
    • 5 8
    • 5 7 9
    • 7 9 11
    • Errors out
This entry was posted in .NET, Web dev. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

72 Comments on .NET WebDev interview questions - Part 3

  1. Stephany
    Posted 3/20/2006 at 10:59 pm | Permalink

    25 What will be output for the given code?
    Dim I as integer = 5
    Do
    I = I + 2
    Response.Write (I & \” \”)
    Loop Until I > 10
    o 5 8
    o 5 7 9
    o 7 9 11
    o Errors out
    Answer:
    7 9 11 (if corrected)

  2. Shivraj
    Posted 5/7/2006 at 5:41 am | Permalink

    13.A valid comment block in ASP.NET is

    Ans. C

  3. mridhu
    Posted 5/11/2006 at 11:32 pm | Permalink

    1. what is the differece between c++ &java?
    2.difference between .net & java

  4. Posted 7/15/2006 at 5:52 am | Permalink

    Ans 8.

    To Make sure that ony single process use a variable at a time. We need to Synchronize the request to that variable.

    The correct answer would be Synchronize()

  5. Pavitra
    Posted 10/7/2006 at 10:19 pm | Permalink

    HI,

    Can somebody explain me the 50th answer .I quite did not get it.Please respond to this.

    Thanks,
    p

  6. Aamir
    Posted 10/9/2006 at 8:26 am | Permalink

    13. A valid comment block in ASP.NET is (a)

  7. CSharp
    Posted 11/9/2006 at 12:02 pm | Permalink

    Hi,

    Following is the explanation for the answer (#50) of the question # 24.

    There are common suffixes for each literal type. Suffixes ensure that the literal is the intended type. This is good for documentation. However, the primary benefit is ensuring that your expressions are evaluated correctly; that is, the compiler will interpret float and decimal literals without suffixes as a double when evaluating an expression. To avoid the associated errors, use an appropriate literal suffix.

  8. venki
    Posted 12/13/2006 at 6:09 am | Permalink

    25 What will be output for the given code?
    Dim I as integer = 5
    Do
    I = I + 2
    Response.Write (I & \” \”)
    Loop Until I > 10
    o 5 8
    o 5 7 9
    o 7 9 11
    o Errors out

  9. Nilesh
    Posted 12/27/2006 at 12:20 am | Permalink

    6.Which of the following is the C# escape character for Null?
    • \n
    •
    • \f
    • \v

    Answer:

  10. Thiru
    Posted 3/10/2007 at 1:42 am | Permalink

    One of the possible way of writing an ASP.NET handler that works like an ISAPI filter-
    that is, that sees requests and responses and modifies them also, is by,
    writing a module that extends FormsAuthenticatonModule and using it
    writing a component class that extends HttpModuleCollection and using it
    writing an HTTP module-a Class that implements IhttpModule and registering it in Web.Config
    All of the above

    Ans : writing an HTTP module-a Class that implements IhttpModule and registering it in Web.Config

  11. Thiru
    Posted 3/10/2007 at 1:43 am | Permalink

    What is the output for the below mentioned compilation command>csc /addmodule:A.Exe B.Cs
    A.exe
    B.exe
    A.dll
    B.dll

    Ans:B.dll

  12. Amit nagar
    Posted 5/3/2007 at 5:49 pm | Permalink

    25. What will be output for the given code?

    Dim I as integer = 5
    Do
    I = I + 2
    Response.Write (I & \” \”)
    Loop Until I > 10

    Ans.7 9 11

  13. Parasmani
    Posted 7/21/2007 at 10:19 pm | Permalink

    6. Which of the following is the C# escape character for Null?

    * \n
    *
    * \f
    * \v

    Ans:

  14. Biswaprakash
    Posted 8/23/2007 at 4:24 am | Permalink

    1.True
    2.objXslT.Transform(objNav, nothing, objWriter)
    3.csc /doc:NewHome.xml NewHome.cs
    4.///
    5.AssemblyInfo.cs(withen the properties folder)
    6. go through(http://www.jaggersoft.com/csharp_standard/9.4.4.4.htm)

  15. Biswaprakash
    Posted 8/23/2007 at 5:01 am | Permalink

    7.MissingMethodException
    (there is no such exception like MethodLoadException)
    8.Lock() and Unlock().
    The HttpApplicationState class provides two methods, Lock and Unlock, that allow only one thread at a time to access application-state variables.

  16. Biswaprakash Nayak
    Posted 8/23/2007 at 6:51 am | Permalink

    9.The AutomaticPostBack attribute is set to False
    (The AutoEventWireup attribute by default true,also your event would not fired if you turn into false)
    10.The Render() method must be overriden in the derived class.
    11.Regular expressions
    12.False
    13.
    14.Application Start and End ,
    Session Start and End, Per-request and Non-deterministic event handlers

  17. Biswaprakash Nayak
    Posted 8/24/2007 at 1:57 am | Permalink

    21.SessionState mode=”stateserver” stateConnectionString=”tcpip=127.0.0.1:42424″ sqlConnectionString=”data source=127.0.0.1;user id=sa;password=” cookieless=”false” timeout=”30″
    (If ur appln spanned across two or more web-servers ,
    then use stateserver mode)

  18. vikesh sharma
    Posted 10/16/2007 at 10:45 am | Permalink

    6. Which of the following is the C# escape character for Null?

    * \n
    *
    * \f
    * \v

    Ans:

  19. Veera Venkata
    Posted 11/29/2007 at 5:53 am | Permalink

    State True or False:
    If you set AutoGenerateColumns=True and still provide custom column definitions, the DataGrid will render both

    True.
    Grid will display all the columns and the custom columns.

  20. Veera Venkata
    Posted 11/29/2007 at 5:55 am | Permalink

    Pick the command line that would result in the C# compiler generating an XML documentation file

    csc /doc /out: NewHome.xml NewHome.cs

  21. Veera Venkata
    Posted 11/29/2007 at 6:05 am | Permalink

    The following is a valid statement in ASP.NET

    False

  22. Rahul Tripathi
    Posted 5/14/2008 at 8:25 am | Permalink

    State True or False: If you set AutoGenerateColumns=True and still provide custom column definitions, the DataGrid will render both
    True
    False

    Ans : False

    The data from an XSL Transform with XmlReader can be returned in one of the following ways
    objReader = objXslT.Transform(objNav, nothing)
    objXslT.Transform(objNav, nothing)
    objReader = objXslT.Transform(objNav, nothing, objWriter)
    objXslT.Transform(objNav, nothing, objWriter)

    Ans : objReader = objXslT.Transform(objNav,nothing)
    Pick the command line that would result in the C# compiler generating an XML documentation file
    csc /doc:NewHome.xml NewHome.cs

    c /doc /docfile: NewHome.xml NewHome.cs
    csc /doc /out: NewHome.xml NewHome.cs

    csc /xml NewHome.cs

    Answer A . csc /doc:NewHome.xml NewHome.cs

    What is the comment syntax for C#’s XML-based documentation?
    /** and **/
    //#
    ///
    //*

    Answer : c ) ///
    When creating a C# Class Library project, what is the name of the supplementary file that Visual Studio.NET creates that contains General Information about the assembly?
    AssemblyInfo.xml

    AssemblyInfo.cs
    AssemblyInformation.cs

    AssemblyAttributes.cs

    Answer : B) AssemblyInfo.cs
    Which of the following is the C# escape character for Null?
    \n

    \f
    \v
    Answer :
    What is the exception that is thrown when there is an attempt to dynamically access a method that does not exist?
    MissingMethodException
    TypeLoadException
    MethodLoadException
    MethodAccessException

    Answer : A)MissingMethodException

    What method(s) must be used with the Application object to ensure that only one process accesses a variable at a time?
    Synchronize()
    Lock() and UnLock()
    Lock()
    Asynchroize()
    c) Lock()
    After capturing the SelectedIndexChanged event for a ListBox control, you find that the event handler doesn’t execute. What could the problem be?
    The AutoEventWireup attribute is set to False
    The AutomaticPostBack attribute is set to False
    The codebehind module is not properly compiled
    The ListBox must be defined WithEvents

    b) The AutomaticPostBack attribute is set to False

    What method must be overridden in a custom control?
    The Paint() method
    The Control_Build() method

    The Render() method
    The default constructor

    c) The Render() method

    What is used to validate complex string patterns like an e-mail address?
    Extended expressions
    Regular expressions
    Irregular expressions
    Basic expressions

    b) Regular expressions

    The following is a valid statement in ASP.NET
    True
    False
    b) false
    A valid comment block in ASP.NET is

    b)
    The event handlers that can be included in the Global.asax file are
    Application Start and
    Session Start event handlers only
    Application End and
    Session End event handlers only
    Per-request and Non-deterministic event handlers only
    Application Start and End ,
    Session Start and End, Per-request and Non-deterministic event handlers

    d) Application Start and End ,
    Session Start and End, Per-request and Non-deterministic event handlers

    A Few of the Namespaces that get imported by default in an ASPX file are
    System, System.Data, System.Drawing,
    System.Globalization

    System,
    System.IO, System.Management, System.Globalization
    System, System.Collections,
    System.Text, System.Web
    System,
    System.NET,
    System.Reflection, System.Web
    B) System, System.Collections,
    System.Text, System.Web

    The Assemblies that can be referenced in an ASPX file without using @Assembly Directive is
    System.dll, System.Data.dll,
    System.Web.dll, System.Xml.dll,

    System.dll,
    System.Collections.dll, System.IO.dll
    System.dll, System.Reflection.dll,
    System.Globalization.dll,

    System.Drawing.dll, System.Assembly.dll,
    System.Text.dll

    Answer : A) System.dll, System.Data.dll,
    System.Web.dll, System.Xml.dll,

    An .ASHX file contains the following
    Code-behind that are used in the code
    Server Controls that can be called from a code-behind file
    HTTP handlers-software modules that handle raw HTTP requests received by ASP.NET
    Contains normal ASP.NET code and can be used as an include file
    What is the output for the following code snippet:

    public class testClass
    {
    public static void Main(string[] args)
    {
    System.Console.WriteLine(args[1]);
    }//end Main
    }//end class testClassCompiler Error
    Runtime Error
    Hello C# world
    None of the above

    Answer : A) Runtime Error
    One of the possible way of writing an ASP.NET handler that works like an ISAPI filter- that is, that sees requests and responses and modifies them also, is by,
    writing a module that extends FormsAuthenticatonModule and using it
    writing a component class that extends HttpModuleCollection and using it
    writing an HTTP module-a Class that implements IhttpModule and registering it in Web.Config
    All of the above

    c) implements IhttpModule and registering it in Web.Config

    The ASP.NET directive that lets you cache different versions of a page based on varying input parameters, HTTP headers and browser type is
    @OutputCache
    @CacheOutput
    @PageCache
    @CacheAll

    If we develop an application that must accommodate multiple security levels through secure login and ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users?

    Answer:
    c)

    What is the output for the below mentioned compilation command>csc /addmodule:A.Exe B.Cs
    A.exe
    B.exe
    A.dll
    B.dll

    B) B.exe

    How can be the web application get configured with the following authorization rules
    Anonymous users must not be allowed to access the application.
    All persons except David and John must be allowed to access the application.

    Answer : c. 10
    5 8

    5 7 9

    7 9 11

    Errors out
    Answer : c . 7 9 11

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*