Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger


Showing posts with label DotNet. Show all posts
Showing posts with label DotNet. Show all posts

Thursday, 19 June 2008

IMPORTANT ASP.NET interview questions

  1. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe
    in the page loading process
    . inetinfo.exe is theMicrosoft IIS server running,
    handling ASP.NET requests among other things.When an ASP.NET request is received
    (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes
    care of it by passing the request tothe actual worker process aspnet_wp.exe.
  2. What’s the difference between Response.Write() andResponse.Output.Write()?
    The latter one allows you to write formattedoutput.
  3. What methods are fired during the page load? Init() - when the pageis
    instantiated, Load() - when the page is loaded into server memory,PreRender()
    - the brief moment before the page is displayed to the user asHTML, Unload()
    - when page finishes loading.
  4. Where does the Web page belong in the .NET Framework class hierarchy?System.Web.UI.Page
  5. Where do you store the information about the user’s locale? System.Web.UI.Page.Culture
  6. What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
    CodeBehind is relevant to Visual Studio.NET only.
  7. What’s a bubbled event? When you have a complex control, likeDataGrid,
    writing an event processing routine for each object (cell, button,row, etc.)
    is quite tedious. The controls can bubble up their eventhandlers, allowing
    the main DataGrid event handler to take care of itsconstituents.
  8. Suppose you want a certain ASP.NET function executed on MouseOver overa
    certain button. Where do you add an event handler?
    It’s the Attributesproperty,
    the Add function inside that property. So
    btnSubmit.Attributes.Add("onMouseOver","someClientCode();")

    A simple”Javascript:ClientCode();” in the button control of the .aspx
    page will attach the handler (javascript function)to the onmouseover event.

  9. What data type does the RangeValidator control support? Integer,String
    and Date.
  10. Where would you use an iHTTPModule, and what are the limitations of any
    approach you might take in implementing one?
    One of ASP.NET’s most useful
    features is the extensibility
    of the HTTP pipeline
    , the path that data takes between client and server.
    You can use them to extend your ASP.NET applications by adding pre- and post-processing
    to each HTTP request coming into your application. For example, if you wanted
    custom authentication facilities for your application, the best technique
    would be to intercept the request when it comes in and process the request
    in a custom HTTP module.
  11. Explain what a diffgram is, and a good use for one? A DiffGram is
    an XML format that is used to identify current and original versions of data
    elements. The DataSet uses the DiffGram format to load and persist its contents,
    and to serialize its contents for transport across a network connection. When
    a DataSet is written as a DiffGram, it populates the DiffGram with all the
    necessary information to accurately recreate the contents, though not the
    schema, of the DataSet, including column values from both the Original and
    Current row versions, row error information, and row order.

.NET framework programming interview questions

.NET framework overview

  1. Has own class libraries. System is the main namespace and all other namespaces are subsets of this.
  2. It has CLR(Common language runtime, Common type system, common language specification)
  3. All the types are part of CTS and Object is the base class for all the types.
  4. If a language said to be .net complaint, it should be compatible with CTS and CLS.
  5. All the code compiled into an intermediate language by the .Net language compiler, which is nothing but an assembly.
  6. During runtime, JIT of CLR picks the IL code and converts into PE machine code and from there it processes the request.
  7. CTS, CLS, CLR
  8. Garbage Collection
  9. Dispose, finalize, suppress finalize, Idispose interface
  10. Assemblies, Namespace: Assembly is a collection of class/namespaces. An assembly contains Manifest, Metadata, Resource files, IL code
  11. Com interoperability, adding references, web references
  12. Database connectivity and providers

Application Domain

  1. Class modifiers: public, private, friend, protected, protected friend, mustinherit, NotInheritable
  2. Method modifiers: public, private
  3. Overridable
  4. Shadows
  5. Overloadable
  6. Overrides
  7. Overloads
  8. Set/Get Property
  9. IIF
  10. Inheritance
  11. Polymorphism
  12. Delegates
  13. Events
  14. Reflection
  15. Boxing
  16. UnBoxing

ASP.Net

  1. Web Controls: Data grid (templates, sorting, paging, bound columns, unbound columns, data binding), Data list, repeater controls
  2. HTML Controls
  3. Code behind pages, system.web.ui.page base class
  4. Web.config: App settings, identity (impersonate), authentication (windows, forms, anonymous, passport), authorization
  5. Databind.eval
  6. Trace, Debug
  7. Output cache
  8. Session management
  9. Application, Session
  10. Global.asax httpapplication
  11. User controls, custom controls, custom rendered controls (postback event, postdatachanged event) usercontrol is the base class
  12. Directives

ADO.Net

  1. Command object (ExecuteNonquery, ExecuteReader, ExecuteXMLReader, ExecuteScalar)
  2. DataAdapter object (Fill)
  3. Dataset (collection of tables)
  4. CommandBuiler object
  5. Transaction Object
  6. Isolation

C# and .NET interview questions 124

  1. How big is the datatype int in .NET? 32 bits.
  2. How big is the char? 16 bits (Unicode).
  3. How do you initiate a string without escaping each backslash? Put an @ sign in front of the double-quoted string.
  4. What are valid signatures for the Main function?
    • public static void Main()
    • public static int Main()
    • public static void Main( string[] args )
    • public static int Main(string[] args )
  5. Does Main() always have to be public? No.
  6. How do you initialize a two-dimensional array that you don’t know the dimensions of?
    • int [, ] myArray; //declaration
    • myArray= new int [5, 8]; //actual initialization
  7. What’s the access level of the visibility type internal? Current assembly.
  8. What’s the difference between struct and class in C#?
    • Structs cannot be inherited.
    • Structs are passed by value, not by reference.
    • Struct is stored on the stack, not the heap.
  9. Explain encapsulation. The implementation is hidden, the interface is exposed.
  10. What data type should you use if you want an 8-bit value that’s signed? sbyte.
  11. Speaking of Boolean data types, what’s different between C# and C/C++? There’s no conversion between 0 and false, as well as any other number and true, like in C/C++.
  12. Where are the value-type variables allocated in the computer RAM? Stack.
  13. Where do the reference-type variables go in the RAM? The references go on the stack, while the objects themselves go on the heap. However, in reality things are more elaborate.
  14. What is the difference between the value-type variables and reference-type variables in terms of garbage collection? The value-type variables are not garbage-collected, they just fall off the stack when they fall out of scope, the reference-type objects are picked up by GC when their references go null.
  15. How do you convert a string into an integer in .NET? Int32.Parse(string), Convert.ToInt32()
  16. How do you box a primitive data type variable? Initialize an object with its value, pass an object, cast it to an object
  17. Why do you need to box a primitive variable? To pass it by reference or apply a method that an object supports, but primitive doesn’t.
  18. What’s the difference between Java and .NET garbage collectors? Sun left the implementation of a specific garbage collector up to the JRE developer, so their performance varies widely, depending on whose JRE you’re using. Microsoft standardized on their garbage collection.
  19. How do you enforce garbage collection in .NET? System.GC.Collect();
  20. Can you declare a C++ type destructor in C# like ~MyClass()? Yes, but what’s the point, since it will call Finalize(), and Finalize() has no guarantees when the memory will be cleaned up, plus, it introduces additional load on the garbage collector. The only time the finalizer should be implemented, is when you’re dealing with unmanaged code.
  21. What’s different about namespace declaration when comparing that to package declaration in Java? No semicolon. Package declarations also have to be the first thing within the file, can’t be nested, and affect all classes within the file.
  22. What’s the difference between const and readonly? You can initialize readonly variables to some runtime values. Let’s say your program uses current date and time as one of the values that won’t change. This way you declare
    public readonly string DateT = new DateTime().ToString().
  23. Can you create enumerated data types in C#? Yes.
  24. What’s different about switch statements in C# as compared to C++? No fall-throughs allowed.
  25. What happens when you encounter a continue statement inside the for loop? The code for the rest of the loop is ignored, the control is transferred back to the beginning of the loop.
  26. Is goto statement supported in C#? How about Java? Gotos are supported in C#to the fullest. In Java goto is a reserved keyword that provides absolutely no functionality.
  27. Describe the compilation process for .NET code? Source code is compiled and run in the .NET Framework using a two-stage process. First, source code is compiled to Microsoft intermediate language (MSIL) code using a .NET Framework-compatible compiler, such as that for Visual Basic .NET or Visual C#. Second, MSIL code is compiled to native code.
  28. Name any 2 of the 4 .NET authentification methods. ASP.NET, in conjunction with Microsoft Internet Information Services (IIS), can authenticate user credentials such as names and passwords using any of the following authentication methods:
    • Windows: Basic, digest, or Integrated Windows Authentication (NTLM or Kerberos).
    • Microsoft Passport authentication
    • Forms authentication
    • Client Certificate authentication
  29. How do you turn off SessionState in the web.config file? In the system.web section of web.config, you should locate the httpmodule tag and you simply disable session by doing a remove tag with attribute name set to session.



  30. What is main difference between Global.asax and Web.Config? ASP.NET uses the global.asax to establish any global objects that your Web application uses. The .asax extension denotes an application file rather than .aspx for a page file. Each ASP.NET application can contain at most one global.asax file. The file is compiled on the first page hit to your Web application. ASP.NET is also configured so that any attempts to browse to the global.asax page directly are rejected. However, you can specify application-wide settings in the web.config file. The web.config is an XML-formatted text file that resides in the Web site’s root directory.

.NET Windows Forms basics 123

  1. Write a simple Windows Forms MessageBox statement.
    System.Windows.Forms.MessageBox.Show
    ("Hello, Windows Forms");

  2. Can you write a class without specifying namespace? Which namespace does it belong to by default??
    Yes, you can, then the class belongs to global namespace which has no name. For commercial products, naturally, you wouldn’t want global namespace.
  3. You are designing a GUI application with a windows and several widgets on it. The user then resizes the app window and sees a lot of grey space, while the widgets stay in place. What’s the problem? One should use anchoring for correct resizing. Otherwise the default property of a widget on a form is top-left, so it stays at the same location when resized.
  4. How can you save the desired properties of Windows Forms application? .config files in .NET are supported through the API to allow storing and retrieving information. They are nothing more than simple XML files, sort of like what .ini files were before for Win32 apps.
  5. So how do you retrieve the customized properties of a .NET application from XML .config file? Initialize an instance of AppSettingsReader class. Call the GetValue method of AppSettingsReader class, passing in the name of the property and the type expected. Assign the result to the appropriate variable.
  6. Can you automate this process? In Visual Studio yes, use Dynamic Properties for automatic .config creation, storage and retrieval.
  7. My progress bar freezes up and dialog window shows blank, when an intensive background process takes over. Yes, you should’ve multi-threaded your GUI, with taskbar and main form being one thread, and the background process being the other.
  8. What’s the safest way to deploy a Windows Forms app? Web deployment: the user always downloads the latest version of the code, the program runs within security sandbox, properly written app will not require additional security privileges.
  9. Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio? The designer will likely through it away, most of the code inside InitializeComponent is auto-generated.
  10. What’s the difference between WindowsDefaultLocation and WindowsDefaultBounds? WindowsDefaultLocation tells the form to start up at a location selected by OS, but with internally specified size. WindowsDefaultBounds delegates both size and starting position choices to the OS.
  11. What’s the difference between Move and LocationChanged? Resize and SizeChanged? Both methods do the same, Move and Resize are the names adopted from VB to ease migration to C#.
  12. How would you create a non-rectangular window, let’s say an ellipse? Create a rectangular form, set the TransparencyKey property to the same value as BackColor, which will effectively make the background of the form transparent. Then set the FormBorderStyle to FormBorderStyle.None, which will remove the contour and contents of the form.
  13. How do you create a separator in the Menu Designer? A hyphen ‘-’ would do it. Also, an ampersand ‘&’ would underline the next letter.
  14. How’s anchoring different from docking? Anchoring treats the component as having the absolute size and adjusts its location relative to the parent form. Docking treats the component location as absolute and disregards the component size. So if a status bar must always be at the bottom no matter what, use docking. If a button should be on the top right, but change its position with the form being resized, use anchoring.

.NET Remoting questions and answers

  1. What’s a Windows process? It’s an application that’s running and had been allocated memory.
  2. What’s typical about a Windows process in regards to memory allocation? Each process is allocated its own block of available RAM space, no process can access another process’ code or data. If the process crashes, it dies alone without taking the entire OS or a bunch of other applications down.
  3. Why do you call it a process? What’s different between process and application in .NET, not common computer usage, terminology? A process is an instance of a running application. An application is an executable on the hard drive or network. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application.
  4. What distributed process frameworks outside .NET do you know? Distributed Computing Environment/Remote Procedure Calls (DEC/RPC), Microsoft Distributed Component Object Model (DCOM), Common Object Request Broker Architecture (CORBA), and Java Remote Method Invocation (RMI).
  5. What are possible implementations of distributed applications in .NET? .NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy classes are in System.Runtime.Remoting and System.Web.Services.
  6. When would you use .NET Remoting and when Web services? Use remoting for more efficient exchange of information when you control both ends of the application. Use Web services for open-protocol-based information exchange when you are just a client or a server with the other end belonging to someone else.
  7. What’s a proxy of the server object in .NET Remoting? It’s a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object. This process is also known as marshaling.
  8. What are remotable objects in .NET Remoting? Remotable objects are the objects that can be marshaled across the application domains. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.
  9. What are channels in .NET Remoting? Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.
  10. What security measures exist for .NET Remoting in System.Runtime.Remoting? None. Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.
  11. What is a formatter? A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.
  12. Choosing between HTTP and TCP for protocols and Binary and SOAP for formatters, what are the trade-offs? Binary over TCP is the most effiecient, SOAP over HTTP is the most interoperable.
  13. What’s SingleCall activation mode used for? If the server object is instantiated for responding to just one single request, the request should be made in SingleCall mode.
  14. What’s Singleton activation mode? A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease.
  15. How do you define the lease of the object? By implementing ILease interface when writing the class code.
  16. Can you configure a .NET Remoting object via XML file? Yes, via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config.
  17. How can you automatically generate interface for the remotable object in .NET with Microsoft tools? Use the Soapsuds tool.

Microsoft .NET Framework interview questions

  1. What is .NET Framework?
  2. Is .NET a runtime service or a development platform? Answer It’s bothand actually a lot more. Microsoft .NET is a company-wide initiative. It includes a new way of delivering software and services to businesses and consumers. A part of Microsoft.NET is the .NET Frameworks. The frameworks is the first part of the MS.NET initiate to ship and it was given out to attendees at the PDC in July. The .NET frameworks consists of two parts: the .NET common language runtime and the .NET class library. These two components are packaged together into the .NET Frameworks SDK which will be available for free download from Microsoft’s MSDN web site later this month. In addition, the SDK also includes command-line compilers for C#, C++, JScript, and VB. You use these compilers to build applications and components. These components require the runtime to execute so this is a development platform. When Visual Studio.NET ships, it will include the .NET SDK and a GUI editor, wizards, tools, and a slew of other things. However, Visual Studio.NET is NOT required to build .NET applications.
  3. New features of Framework 1.1 ?
  4. What is CLR? How it will work?
  5. What is MSIL, IL, CTS?
  6. What is JIT and how is works
  7. What is strong name? A name that consists of an assembly’s identity—its simple text name, version number, and culture information (if provided)—strengthened by a public key and a digital signature generated over the assembly.
  8. What is portable executable (PE) The file format defining the structure that all executable files (EXE) and Dynamic Link Libraries (DLL) must use to allow them to be loaded and executed by Windows. PE is derived from the Microsoft Common Object File Format (COFF). The EXE and DLL files created using the .NET Framework obey the PE/COFF formats and also add additional header and data sections to the files that are only used by the CLR. The specification for the PE/COFF file formats is available at http://www.microsoft.com/whdc/hwdev/hardware/pecoffdown.mspx
  9. Which is the base class for .net Class library? Ans: system.object
  10. What is Event? Delegate, clear syntax for writing a event delegate// keyword_delegate.cs // delegate declaration delegate void MyDelegate(int i);
    class Program

    {

    public static void Main()

    {

    TakesADelegate(new MyDelegate(DelegateFunction));

    }

    public static void TakesADelegate(MyDelegate SomeFunction)

    {

    SomeFunction(21);

    }

    public static void DelegateFunction(int i)

    {

    System.Console.WriteLine("Called by delegate withnumber: {0}.", i);

    }

    }

  11. ment DataGrid in .NET? How would you make a combo-box appear in one column of a DataGrid? What are the ways to show data grid inside a data grid for a master details type of tables?
  12. If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?
  13. What is Application Domain? Application domains provide a unit of isolation for the common language runtime. They are created and run inside a process. Application domains are usually created by a runtime host, which is an application responsible for loading the runtime into a process and executing user code within an application domain. The runtime host creates a process and a default application domain, and runs managed code inside it. Runtime hosts include ASP.NET, Microsoft Internet Explorer, and the Windows shell.
  14. What is serialization in .NET? What are the ways to control serialization? Serialization can be defined as the process of storing the state of an object to a storage medium. During this process, the public and private fields of the object and the name of the class, including the assembly containing the class, are converted to a stream of bytes, which is then written to a data stream. When the object is subsequently deserialized, an exact clone of the original object is created.
    • Binary serialization preserves type fidelity, which is useful for preserving the state of an object between different invocations of an application. For example, you can share an object between different applications by serializing it to the clipboard. You can serialize an object to a stream, disk, memory, over the network, and so forth. Remoting uses serialization to pass objects “by value” from one computer or application domain to another.
    • XML serialization serializes only public properties and fields and does not preserve type fidelity. This is useful when you want to provide or consume data without restricting the application that uses the data. Because XML is an open standard, it is an attractive choice for sharing data across the Web. SOAP is an open standard, which makes it an attractive choice.
  15. What are the different authentication modes in the .NET environment?
    	=”Windows|Forms|Passport|None”>

    =”name” loginUrl=”url”

    protection=”All|None|Encryption|Validation”

    timeout=”30″ path=”/” > requireSSL=“true|false”

    slidingExpiration=“true|false”><

    credentials passwordFormat=”Clear|SHA1|MD5″><

    user name=”username” password=”password”/>



    internal"/>

    /li>

  16. What is the use of trace utility
  17. What is different between User Control and Web Control and Custom Control?
  18. What is exception handling? When an exception occurs, the system searches for the nearest catch clause that can handle the exception, as determined by the run-time type of the exception. First, the current method is searched for a lexically enclosing try statement, and the associated catch clauses of the try statement are considered in order. If that fails, the method that called the current method is searched for a lexically enclosing try statement that encloses the point of the call to the current method. This search continues until a catch clause is found that can handle the current exception, by naming an exception class that is of the same class, or a base class, of the run-time type of the exception being thrown. A catch clause that doesn’t name an exception class can handle any exception. Once a matching catch clause is found, the system prepares to transfer control to the first statement of the catch clause. Before execution of the catch clause begins, the system first executes, in order, any finally clauses that were associated withtry statements more nested that than the one that caught the exception. Exceptions that occur during destructor execution are worthspecial mention. If an exception occurs during destructor execution, and that exception is not caught, then the execution of that destructor is terminated and the destructor of the base class (if any) is called. If there is no base class (as in the case of the object type) or if there is no base class destructor, then the exception is discarded.
  19. What is Assembly? Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime withthe information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly. Assemblies are a fundamental part of programming withthe .NET Framework. An assembly performs the following functions:
    • It contains code that the common language runtime executes. Microsoft intermediate language (MSIL) code in a portable executable (PE) file will not be executed if it does not have an associated assembly manifest. Note that each assembly can have only one entry point (that is,DllMain,WinMain, orMain).
    • It forms asecurity boundary. An assembly is the unit at which permissions are requested and granted.
    • It forms atype boundary. Every type’s identity includes the name of the assembly in which it resides. A type called MyType loaded in the scope of one assembly is not the same as a type called MyType loaded in the scope of another assembly.
    • It forms areference scope boundary. The assembly’s manifest contains assembly metadata that is used for resolving types and satisfying resource requests. It specifies the types and resources that are exposed outside the assembly. The manifest also enumerates other assemblies on which it depends.
    • It forms aversion boundary. The assembly is the smallest versionable unit in the common language runtime; all types and resources in the same assembly are versioned as a unit. The assembly’s manifest describes the version dependencies you specify for any dependent assemblies.
    • It forms a deployment unit. When an application starts, only the assemblies that the application initially calls must be present. Other assemblies, such as localization resources or assemblies containing utility classes, can be retrieved on demand. This allows applications to be kept simple and thin when first downloaded.
    • It is the unit at which side-by-side execution is supported.
    • Assemblies can be static or dynamic. Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in PE files. You can also use the .NET Framework to create dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.

      There are several ways to create assemblies. You can use development tools, such as Visual Studio .NET, that you have used in the past to create .dll or .exe files. You can use tools provided in the .NET Framework SDK to create assemblies withmodules created in other development environments. You can also use common language runtime APIs, such as Reflection.Emit, to create dynamic assemblies.

  20. s of assemblies? Private, Public/Shared, Satellite
  21. What are Satellite Assemblies? How you will create this? How will you get the different language strings? Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language. When uninstalling, the application removes only the satellite assemblies associated witha given language and .NET Framework version. No core .NET Framework files are removed unless the last language for that .NET Framework version is being removed. For example, English and Japanese editions of the .NET Framework version 1.1 share the same core files. The Japanese .NET Framework version 1.1 adds satellite assemblies withlocalized resources in a \ja subdirectory. An application that supports the .NET Framework version 1.1, regardless of its language, always uses the same core runtime files.
  22. How will you load dynamic assembly? How will create assemblies at run time?
  23. What is Assembly manifest? what all details the assembly manifest will contain. Every assembly, whether static or dynamic, contains a collection of data that describes how the elements in the assembly relate to each other. The assembly manifest contains this assembly metadata. An assembly manifest contains all the metadata needed to specify the assembly’s version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes. The assembly manifest can be stored in either a PE file (an .exe or .dll) withMicrosoft intermediate language (MSIL) code or in a standalone PE file that contains only assembly manifest information. It contains Assembly name, Version number, Culture, Strong name information, List of all files in the assembly, Type reference information, Information on referenced assemblies.
  24. What are the contents of assembly? In general, a static assembly can consist of four elements:
    • The assembly manifest, which contains assembly metadata.
    • Type metadata.
    • Microsoft intermediate language (MSIL) code that implements the types.
    • A set of resources.
  25. Difference between assembly manifest & metadata assembly manifest -An integral part of every assembly that renders the assembly self-describing. The assembly manifest contains the assembly’s metadata. The manifest establishes the assembly identity, specifies the files that make up the assembly implementation, specifies the types and resources that make up the assembly, itemizes the compile-time dependencies on other assemblies, and specifies the set of permissions required for the assembly to run properly. This information is used at run time to resolve references, enforce version binding policy, and validate the integrity of loaded assemblies. The self-describing nature of assemblies also helps makes zero-impact install and XCOPY deployment feasible. metadata -Information that describes every element managed by the common language runtime: an assembly, loadable file, type, method, and so on. This can include information required for debugging and garbage collection, as well as security attributes, marshaling data, extended class and member definitions, version binding, and other information required by the runtime.
  26. What is Global Assembly Cache (GAC) and what is the purpose of it? (How to make an assembly to public? Steps) Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer. You should share assemblies by installing them into the global assembly cache only when you need to.
  27. If I have more than one version of one assemblies, then how’ll I use old version (how/where to specify version number?)in my application?
  28. How to find methods of a assembly file (not using ILDASM) Reflection
  29. Value type & data types difference. Example from .NET.
  30. Integer & struct are value types or reference types in .NET?
  31. What is Garbage Collection in .Net? Garbage collection process? The process of transitively tracing through all pointers to actively used objects in order to locate all objects that can be referenced, and then arranging to reuse any heap memory that was not found during this trace. The common language runtime garbage collector also compacts the memory that is in use to reduce the working space needed for the heap.
  32. Readonly vs. const? Aconstfield can only be initialized at the declaration of the field. Areadonlyfield can be initialized either at the declaration or in a constructor. Therefore,readonlyfields can have different values depending on the constructor used. Also, while aconstfield is a compile-time constant, thereadonlyfield can be used for runtime constants, as in the following example: public static readonly uint l1 = (uint) DateTime.Now.Ticks;
  33. <>






  34. //Declaring properties

    public bool MyProperty

    {

    get {return this.myvalue;}

    set {this.myvalue = value;}

    }

ion to get access to custom attributes.

class MainClass

{

public static void Main()

{

System.Reflection.MemberInfo info = typeof(MyClass);

object[] attributes = info.GetCustomAttributes();

for (int i = 0; i < attributes.Length; i ++)

{

System.Console.WriteLine(attributes[i]);

}

}

}

  • C++ & C# differences
  • What is the managed and unmanaged code in .net? The .NET Framework provides a run-time environment called the Common Language Runtime, which manages the execution of code and provides services that make the development process easier. Compilers and tools expose the runtime’s functionality and enable you to write code that benefits from this managed execution environment. Code that you develop witha language compiler that targets the runtime is calledmanaged code; itbenefits from features such as cross-language integration, cross-language exception handling, enhanced security, versioning and deployment support, a simplified model for component interaction, and debugging and profiling services.
  • How do you create threading in .NET? What is the namespace for that?
  • using directive vs using statement You create an instance in ausingstatement to ensure thatDispose is called on the object when theusingstatement is exited. Ausing statement can be exited either when the end of theusingstatement is reached or if, for example, an exception is thrown and control leaves the statement block before the end of the statement. The using directive has two uses.
    • Create an alias for a namespace (a using alias).
    • Permit the use of types in a namespace, such that, you do not have to qualify the use of a type in that namespace (ausingdirective).
  • Describe the Managed Execution Process
  • What is Active Directory? What is the namespace used to access the Microsoft Active Directories?
  • Interop Services?
  • What is RCW (Run time Callable Wrappers)? The common language runtime exposes COM objects through a proxy called the runtime callable wrapper (RCW). Although the RCW appears to be an ordinary object to .NET clients, its primary function is to marshal calls between a .NET client and a COM object.
  • What is CCW (COM Callable Wrapper)
  • A proxy object generated by the common language runtime so that existing COM applications can use managed classes, including .NET Framework classes, transparently.
  • How does you handle this COM components developed in other programming languages in .NET?
  • How will you register com+ services?
  • What is use of ContextUtil class? ContextUtil is the preferred class to use for obtaining COM+ context information.
  • What is the new three features of COM+ services, which are not there in COM (MTS)
  • Is the COM architecture same as .Net architecture? What is the difference between them (if at all there is)?
  • .NET Windows services development questions

    1. Explain Windows service. You often need programs that run continuously in the background. For example, an email server is expected to listen continuously on a network port for incoming email messages, a print spooler is expected to listen continuously to print requests, and so on.
    2. What’s the Unix name for a Windows service equivalent? Daemon.
    3. So basically a Windows service application is just another executable? What’s different about a Windows service as compared to a regular application? Windows services must support the interface of the Service Control Manager (SCM). A Windows service must be installed in the Windows service database before it can be launched.
    4. How is development of a Windows service different from a Windows Forms application? A Windows service typically does not have a user interface, it supports a set of commands and can have a GUI that’s built later to allow for easier access to those commands.
    5. How do you give a Windows service specific permissions? Windows service always runs under someone’s identity. Can be System or Administrator account, but if you want to restrict the behavior of a Windows service, the best bet is to create a new user account, assign and deny necessary privileges to that account, and then associate the Windows service with that new account.
    6. Can you share processes between Windows services? Yes.
    7. Where’s Windows service database located? HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
    8. What does SCM do? SCM is Windows Service Control Manager. Its responsibilities are as follows:
      • Accepts requests to install and uninstall Windows services from the Windows service database.
      • To start Windows services either on system startup or requested by the user.
      • To enumerate installed Windows services.
      • To maintain status information for currently running Windows services.
      • To transmits control messages (such as Start, Stop, Pause, and Continue) to available Windows services.
      • To lock/unlock Windows service database.
    9. vice on a box? Use Windows Service Installer, do not go through Add/Remove Programs or MSI file, as you would normally go with applications.
    10. When developing a Windows service for .NET, which namespace do you typically look in for required classes? System.ServiceProcess. The classes are ServiceBase, ServiceProcessInstaller, ServiceInstaller and ServiceController.
    11. How do you handle Start, Pause, Continue and Stop calls from SCM within your application? By implementing OnStart, OnPause, OnContinue and OnStop methods.
    12. Describe the start-up process for a Windows service. Main() is executed to create an instance of a Web service, then Run() to launch it, then OnStart() from within the instance is executed.
    13. I want to write a Windows service that cannot be paused, only started and stopped. How do I accomplish that? Set CanPauseAndContinue attribute to false.
    14. What application do you use to install a Windows service? installutil.exe
    15. I am trying to install my Windows service under NetworkService account, but keep getting an error. The LocalService and NetworkService accounts are only available on Windows XP and Windows Server 2003. These accounts do not exist on Windows 2000 or older operating systems.
    16. How can you see which services are running on a Windows box? Admin Tools -> Computer Management -> Services and Application -> Services. You can also open the Computer Management tool by right-clicking on My Computer and selecting Manage from the popup menu.
    17. How do you start, pause, continue or stop a Windows service off the command line? net start ServiceName, net pause ServiceName and so on. Also sc.exe provides a command-line interface for Windows services. View the OS documentation or proper book chapters on using sc.exe.
    18. Can I write an MMC snap-in for my Windows service? Yes, use classes from the System.Management.Instrumentation namespace. Also see Managing Applications Using WMI from .NET Framework SDK.

    .NET and COM interop questions

    # Describe the advantages of writing a managed code application instead of unmanaged one. What’s involved in certain piece of code being managed? The advantages include automatic garbage collection, memory management, support for versioning and security. These advantages are provided through .NET FCL and CLR, while with the unmanaged code similar capabilities had to be implemented through third-party libraries or as a part of the application itself.
    # Are COM objects managed or unmanaged? Since COM objects were written before .NET, apparently they are unmanaged.
    # So can a COM object talk to a .NET object? Yes, through Runtime Callable Wrapper (RCW) or PInvoke.
    # How do you generate an RCW from a COM object? Use the Type Library Import utility shipped with SDK. tlbimp COMobject.dll /out:.NETobject.dll or reference the COM library from Visual Studio in your project.
    # I can’t import the COM object that I have on my machine. Did you write that object? You can only import your own objects. If you need to use a COM component from another developer, you should obtain a Primary Interop Assembly (PIA) from whoever authored the original object.
    # How do you call unmanaged methods from your .NET code through PInvoke? Supply a DllImport attribute. Declare the methods in your .NET code as static extern. Do not implement the methods as they are implemented in your unmanaged code, you’re just providing declarations for method signatures.
    # Can you retrieve complex data types like structs from the PInvoke calls? Yes, just make sure you re-declare that struct, so that managed code knows what to do with it.
    # I want to expose my .NET objects to COM objects. Is that possible? Yes, but few things should be considered first. Classes should implement interfaces explicitly. Managed types must be public. Methods, properties, fields, and events that are exposed to COM must be public. Types must have a public default constructor with no arguments to be activated from COM. Types cannot be abstract.
    # Can you inherit a COM class in a .NET application? The .NET Framework extends the COM model for reusability by adding implementation inheritance. Managed types can derive directly or indirectly from a COM coclass; more specifically, they can derive from the runtime callable wrapper generated by the runtime. The derived type can expose all the method and properties of the COM object as well as methods and properties implemented in managed code. The resulting object is partly implemented in managed code and partly implemented in unmanaged code.
    # Suppose I call a COM object from a .NET applicaiton, but COM object throws an error. What happens on the .NET end? COM methods report errors by r

    .NET deployment questions

    1. What do you know about .NET assemblies? Assemblies are the smallest units of versioning and deployment in the .NET application. Assemblies are also the building blocks for programs such as Web services, Windows services, serviced components, and .NET remoting applications.
    2. What’s the difference between private and shared assembly? Private assembly is used inside an application only and does not have to be identified by a strong name. Shared assembly can be used by multiple applications and has to have a strong name.
    3. What’s a strong name? A strong name includes the name of the assembly, version number, culture identity, and a public key token.
    4. How can you tell the application to look for assemblies at the locations other than its own install? Use the directive in the XML .config file for a given application.

      should do the trick. Or you can add additional search paths in the Properties box of the deployed application.

    5. How can you debug failed assembly binds? Use the Assembly Binding Log Viewer (fuslogvw.exe) to find out the paths searched.
    6. Where are shared assemblies stored? Global assembly cache.
    7. How can you create a strong name for a .NET assembly? With the help of Strong Name tool (sn.exe).
    8. Where’s global assembly cache located on the system? Usually C:\winnt\assembly or C:\windows\assembly.
    9. Can you have two files with the same file name in GAC? Yes, remember that GAC is a very special folder, and while normally you would not be able to place two files with the same name into a Windows folder, GAC differentiates by version number as well, so it’s possible for MyApp.dll and MyApp.dll to co-exist in GAC if the first one is version 1.0.0.0 and the second one is 1.1.0.0.
    10. So let’s say I have an application that uses MyApp.dll assembly, version 1.0.0.0. There is a security bug in that assembly, and I publish the patch, issuing it under name MyApp.dll 1.1.0.0. How do I tell the client applications that are already installed to start using this new MyApp.dll? Use publisher policy. To configure a publisher policy, use the publisher policy configuration file, which uses a format similar app .config file. But unlike the app .config file, a publisher policy file needs to be compiled into an assembly and placed in the GAC.
    11. What is delay signing? Delay signing allows you to place a shared assembly in the GAC by signing the assembly with just the public key. This allows the assembly to be signed with the private key at a later stage, when the development process is complete and the component or assembly is ready to be deployed. This process enables developers to work with shared assemblies as if they were strongly named, and it secures the private key of the signature from being accessed at different stages of development.
    P

    C# developer interview questions

    A representative of a high-tech company in United Kingdom sent this in today noting that the list was used for interviewing a C# .NET developer. Any corrections and suggestions would be forwarded to the author. I won’t disclose the name of the company, since as far as I know they might still be using this test for prospective employees. Correct answers are in green color.

    1) The C# keyword ‘int’ maps to which .NET type?

    1. System.Int16

    2. System.Int32

    3. System.Int64

    4. System.Int128

    2) Which of these string definitions will prevent escaping on backslashes in C#?

    1. string s = #”n Test string”;

    2. string s = “’n Test string”;

    3. string s = @”n Test string”;

    4. string s = “n Test string”;

    3) Which of these statements correctly declares a two-dimensional array in C#?

    1. int[,] myArray;

    2. int[][] myArray;

    3. int[2] myArray;

    4. System.Array[2] myArray;

    4) If a method is marked as protected internal who can access it?

    1. Classes that are both in the same assembly and derived from the declaring class.

    2. Only methods that are in the same class as the method in question.

    3. Internal methods can be only be called using reflection.

    4. Classes within the same assembly, and classes derived from the declaring class.

    5) What is boxing?

    a) Encapsulating an object in a value type.

    b) Encapsulating a copy of an object in a value type.

    c) Encapsulating a value type in an object.

    d) Encapsulating a copy of a value type in an object.

    6) What compiler switch creates an xml file from the xml comments in the files in an assembly?

    1. /text

    2. /doc

    3. /xml

    4. /help

    7) What is a satellite Assembly?

    1. A peripheral assembly designed to monitor permissions requests from an application.

    2. Any DLL file used by an EXE file.

    3. An assembly containing localized resources for another assembly.

    4. An assembly designed to alter the appearance or ‘skin’ of an application.

    8) What is a delegate?

    1. A strongly typed function pointer.

    2. A light weight thread or process that can call a single method.

    3. A reference to an object in a different process.

    4. An inter-process message channel.

    9) How does assembly versioning in .NET prevent DLL Hell?

    1. The runtime checks to see that only one version of an assembly is on the machine at any one time.

    2. .NET allows assemblies to specify the name AND the version of any assemblies they need to run.

    3. The compiler offers compile time checking for backward compatibility.

    4. It doesn’t.

    10) Which “Gang of Four” design pattern is shown below?

    public class A {

    private A instance;

    private A() {

    }

    public
    static
    A Instance
    {

    get

    {

    if ( A == null )

    A = new A();

    return instance;

    }

    }

    }

    1. Factory

    2. Abstract Factory

    3. Singleton

    4. Builder

    11) In the NUnit test framework, which attribute must adorn a test class in order for it to be picked up by the NUnit GUI?

    1. TestAttribute

    2. TestClassAttribute

    3. TestFixtureAttribute

    4. NUnitTestClassAttribute

    12) Which of the following operations can you NOT perform on an ADO.NET DataSet?

    1. A DataSet can be synchronised with the database.

    2. A DataSet can be synchronised with a RecordSet.

    3. A DataSet can be converted to XML.

    4. You can infer the schema from a DataSet.

    13) In Object Oriented Programming, how would you describe encapsulation?

    1. The conversion of one type of object to another.

    2. The runtime resolution of method calls.

    3. The exposition of data.

    4. The separation of interface and implementation.

    C# .NET interview questions

    1. Are private class-level variables inherited? - Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.
    2. Why does DllImport not work for me? - All methods marked with the DllImport attribute must be marked as public static extern.
    3. Why does my Windows application pop up a console window every time I run it? - Make sure that the target type set in the project properties setting is set to Windows Application, and not Console Application. If you’re using the command line, compile with /target:winexe, not /target:exe.
    4. Why do I get an error (CS1006) when trying to declare a method without specifying a return type? - If you leave off the return type on a method declaration, the compiler thinks you are trying to declare a constructor. So if you are trying to declare a method that returns nothing, use void. The following is an example: // This results in a CS1006 error public static staticMethod (mainStatic obj) // This will work as wanted public static void staticMethod (mainStatic obj)
    5. Why do I get a syntax error when trying to declare a variable called checked? - The word checked is a keyword in C#.
    6. Why do I get a security exception when I try to run my C# app? - Some security exceptions are thrown if you are working on a network share. There are some parts of the frameworks that will not run if being run off a share (roaming profile, mapped drives, etc.). To see if this is what’s happening, just move the executable over to your local drive and see if it runs without the exceptions. One of the common exceptions thrown under these conditions is System.Security.SecurityException. To get around this, you can change your security policy for the intranet zone, code group 1.2, (the zone that running off shared folders falls into) by using the caspol.exe tool.
    7. Why do I get a CS5001: does not have an entry point defined error when compiling? - The most common problem is that you used a lowercase ‘m’ when defining the Main method. The correct way to implement the entry point is as follows: class test { static void Main(string[] args) {} }
    8. What optimizations does the C# compiler perform when you use the /optimize+ compiler option? - The following is a response from a developer on the C# compiler team: We get rid of unused locals (i.e., locals that are never read, even if assigned). We get rid of unreachable code. We get rid of try-catch with an empty try. We get rid of try-finally with an empty try. We get rid of try-finally with an empty finally. We optimize branches over branches: gotoif A, lab1 goto lab2: lab1: turns into: gotoif !A, lab2 lab1: We optimize branches to ret, branches to next instruction, and branches to branches.
    9. What is the syntax for calling an overloaded constructor within a constructor (this() and constructorname() does not compile)? - The syntax for calling another constructor is as follows: class B { B(int i) { } } class C : B { C() : base(5) // call base constructor B(5) { } C(int i) : this() // call C() { } public static void Main() {} }
    10. What is the equivalent to regsvr32 and regsvr32 /u a file in .NET development? - Try using RegAsm.exe. Search MSDN on Assembly Registration Tool.
    11. What is the difference between a struct and a class in C#? - From language spec: The list of similarities between classes and structs is as follows. Longstructs can implement interfaces and can have the same kinds of members as classes. Structs differ from classes in several important ways; however, structs are value types rather than reference types, and inheritance is not supported for structs. Struct values are stored on the stack or in-line. Careful programmers can sometimes enhance performance through judicious use of structs. For example, the use of a struct rather than a class for a Point can make a large difference in the number of memory allocations performed at runtime. The program below creates and initializes an array of 100 points. With Point implemented as a class, 101 separate objects are instantiated-one for the array and one each for the 100 elements.
    12. My switch statement works differently than in C++! Why? - C# does not support an explicit fall through for case blocks. The following code is not legal and will not compile in C#:
      switch(x)
      {
      case 0: // do something
      case 1: // do something as continuation of case 0
      default: // do something in common with
      //0, 1 and everything else
      break;
      }

      To achieve the same effect in C#, the code must be modified as shown below (notice how the control flows are explicit):

      class Test
      {
      public static void Main() {
      int x = 3;
      switch(x)
      {
      case 0: // do something
      goto case 1;
      case 1: // do something in common with 0
      goto default;
      default: // do something in common with 0, 1, and anything else
      break;
      }
      }
      }
    13. Is there regular expression (regex) support available to C# developers? - Yes. The .NET class libraries provide support for regular expressions. Look at the System.Text.RegularExpressions namespace.
    14. Is there any sample C# code for simple threading? - Yes:
      using System;
      using System.Threading;
      class ThreadTest
      {
      public void runme()
      {
      Console.WriteLine("Runme Called");
      }
      public static void Main(String[] args)
      {
      ThreadTest b = new ThreadTest();
      Thread t = new Thread(new ThreadStart(b.runme));
      t.Start();
      }
      }
    15. Is there an equivalent of exit() for quitting a C# .NET application? - Yes, you can use System.Environment.Exit(int exitCode) to exit the application or Application.Exit() if it’s a Windows Forms app.
    16. Is there a way to force garbage collection? - Yes. Set all references to null and then call System.GC.Collect(). If you need to have some objects destructed, and System.GC.Collect() doesn’t seem to be doing it for you, you can force finalizers to be run by setting all the references to the object to null and then calling System.GC.RunFinalizers().
    17. Is there a way of specifying which block or loop to break out of when working with nested loops? - The easiest way is to use goto:
      using System;
      class BreakExample
      {
      public static void Main(String[] args) {
      for(int i=0; i<3; i++)
      {
      Console.WriteLine(”Pass {0}: “, i);
      for( int j=0 ; j<100 ; j++ )
      {
      if ( j == 10)
      goto done;
      Console.WriteLine(”{0} “, j);
      }
      Console.WriteLine(”This will not print”);
      }
      done:
      Console.WriteLine(”Loops complete.”);
      }
      }
    18. Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace? - There is no way to restrict to a namespace. Namespaces are never units of protection. But if you’re using assemblies, you can use the ‘internal’ access modifier to restrict access to only within the assembly.

    ASP interview questions

    1. How many objects are there in ASP?
    2. Which DLL file is needed to be registered for ASP?
    3. If you want to initialize a global variable for an application, which is the right place to declare it? (like form or some other file).
    4. What is diffrence between Server.transfer and Response.redirect.
    5. Is there any inbuilt paging(for example shoping cart. which will show next 10 records without refreshing) in ASP? How will you do pating.
    6. What does Server.MapPath do?
    7. Name at least three methods of response object other than Redirect.
    8. Name at least two methods of response object other than Transfer.
    9. Tell few programming diffrence between ADO and DAO programming. What is state?
    10. How many types of cookies are there?
    11. Tell few steps for optimizing (for speed and resources) ASP page/application

    Basic .NET and ASP.NET interview questions

    1. Explain the .NET architecture.
    2. How many languages .NET is supporting now? - When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. The site DotNetLanguages.Net says 44 languages are supported.
    3. How is .NET able to support multiple languages? - a language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.
    4. How ASP .NET different from ASP? - Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.
    5. Resource Files: How to use the resource files, how to know which language to use?
    6. What is smart navigation? - The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.
    7. What is view state? - The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control
    8. Explain the life cycle of an ASP .NET page.
    9. How do you validate the controls in an ASP .NET page? - Using special validation controls that are meant for this. We have Range Validator, Email Validator.
    10. Can the validation be done in the server side? Or this can be done only in the Client side? - Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.
    11. How to manage pagination in a page? - Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.
    12. What is ADO .NET and what is difference between ADO and ADO.NET? - ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.

    Open-ended .NET questions

    1. What is the difference between VB 6 and VB.NET?
    2. What are the authentication methods in .NET?
    3. What’s the use of formatters in .NET?
    4. What is Serialization in .NET?
    5. How is Threading done in .NET?
    6. Differences between Namespace, Class, Assembly?
    7. What’s the use of System.Diagnostics.Process class?

    .NET interview questions at Wipro

    1. Difference between directcast and ctype.
    2. An example of a ctype and directcast.
    3. ctype(123.34,integer) - should it throw an error? Why or why not?
    4. directcast(123.34,integer) - should it throw an error? Why or why not?
    5. Difference between a sub and a function.
    6. Explain manifest & metadata.
    7. Scope of public/private/friend/protected/protected friend.
    8. Different kinds of methods.
    9. Difference between imperative and interrogative code.
    10. Difference between value and reference type.
    11. What are the two kinds of properties.
    12. What is the raise event used for?
    13. Explain constructor.
    14. What is a resource? Provide an example from your recent project.
    15. What is a system lock?
    16. Describe ways of cleaning up objects.
    17. Where does the dispose method lie and how can it be used to clean up resources?
    18. How can you clean up objects holding resources from within the code?

    Simple interview questions on Microsoft .NET

    1. What is the base class of .NET?
    2. Explain assemblies.
    3. Name some of the languages .NET support?
    4. ADO.NET features? Benefits? Drawbacks?
    5. How many types of exception handlers are there in .NET?
    6. Difference between Panel and GroupBox classes?
    7. What is the base class of Button control?
    8. What is Response object? How is it related to ASP’s Response object?
    9. What is IIS? Have you used it?
    10. Main differences between ASP and ASP.NET.

    .NET WebDev and Web services questions

    1. How does ASP page work?
    2. How ASP.NET page works?
    3. What are the contents of cookie?
    4. How do you create a permanent cookie?
    5. What is ViewState? What does the “EnableViewState” property do? Whay would I want it on or off?
    6. Give an example of what might be best suited to place in the Application_Start and Session_Start subroutines?
    7. Describe the role of global.asax?
    8. How can you debug your.NET application?
    9. How do you deploy your ASP.NET application?
    10. Where do we store our connection string in ASP.NET application?
    11. Explain security types in ASP.NET?
    12. Where do we store our connection string in ASP.NET application?
    13. Explain different Authentication modes in ASP.NET?
    14. How.NET has implemented security for web applications?
    15. How to do forms authentication in ASP.NET?
    16. Explain authentication levels in.NET?
    17. Explain authorization levels in.NET?
    18. How can you debug an ASP page, without touching the code?
    19. How can you handle Exceptions in ASP.NET?
    20. How can you handle UnManaged Code Exceptions in ASP.NET?
    21. Which is the namespace used to write error message in event Lof File?
    22. What are the Page level transaction and class level transaction?
    23. What are different transaction options?
    24. What is the namespace for encryption?
    25. What is the difference between application and cache variables?
    26. What is the difference between control and component?
    27. You have defined one page_load event in ASPx page and same page_load event in code behind, how will program run?
    28. Where would you use an IHttpModule, and what are the limitations of any approach you might take in implementing one?
    29. Can you edit data in the Repeater control? Which template must you provide, in order to display data in Repeater control? How can you provide an alternating color scheme in a repeater control? What property must you set, and what method must you call in your code, in order to bind the data from some source to the repeater?
    30. In what order do the events of an ASPX page executes. As a developer is it important to understand these events?
    31. How would you get ASP.NET running in Apache web servers? Why would you even do this?
    32. What tags do you need to add within the ASP:datagrid tags to bind columns manualy?
    33. How can we create pie chart in ASP.NET?
    34. How do you understand asynchronous web services?
    35. What are the events fired when web service called?
    36. How do you perform a transaction in web services?
    37. How does SOAP transport happen and what is the role of HTTP in it? How you can access a webservice using soap?
    38. What are the different formatters can be used in both Binary and SOAP?
    39. How will you expose/publish a webservice?
    40. What is disco file?
    41. What’s the attribute for webservice method? What is the namespace for creating webservice?
    42. Can you pass SOAP messages through remoting?
    43. Explain web client class and its methods?
    44. What is flow of remoting?
    45. Explain the concept of data island?
    46. How to useXML DOM model on client using JavaScript?
    47. What are the ways to create a tree view control usingXML, XSL and JavaScript?
    48. What is XPathNavigator?
    49. What is the use of Template in XSL?
    50. What is “Well FormedXML” and “ValidXML“?
    51. How will you do SubString in XSL?
    52. How do you deal sorting columns dynamically inXML?
    53. What is “Async” property ofXML?
    54. What is XPath query?
    55. Explain differences between Element and Node.
    56. What is CDATA section?
    57. Explain definition and differences between DOM and SAX?
    58. What is GetElementbyname method will do?
    59. What will selectnode method will do?
    60. What is validXML document?
    61. What is well formedXML document?
    62. What is the difference betweenXMLDocument andXMLDataDocument?
    63. Can I replace my Sqlserver withXML files and how about handling the same?
    64. Write syntax to serialize class usingXML Serializer?
    65. How can we configure the sites in web server(IIS)?
    66. Explain advantages of IIS 6.0?

    .NET database development questions

    1. To test a Web Service you must create a windows application or web application to consume this service? It is True/False?
    2. How many classes can a single.NET DLL contain?
    3. What are good ADO.NET object(s) to replace the ADO Recordset object?
    4. On order to get assembly info which namespace we should import?
    5. How do you declare a static variable and what is its lifetime? Give an example.
    6. How do you get records number from 5 to 15 in a dataset of 100 records? Write code.
    7. How do you call and execute a Stored Procedure in.NET? Give an example.
    8. What is the maximum length of a varchar in SQL Server?
    9. How do you define an integer in SQL Server?
    10. How do you separate business logic while creating an ASP.NET application?
    11. If there is a calendar control to be included in each page of your application, and and we do not intend to use the Microsoft-provided calendar control, how do you develop it? Do you copy and paste the code into each and every page of your application?
    12. How do you debug an ASP.NET application?
    13. How do you deploy an ASP.NET application?
    14. Explain similarities and differences between Java and.NET?
    15. Specify the best ways to store variables so that we can access them in various pages of ASP.NET application?
    16. What are theXML files that are important in developing an ASP.NET application?
    17. What are theXML files that are important in developing an ASP.NET application?
    18. What is XSLT and what is its use?
    19. How many objects are there in ASP?
    20. Which DLL file is needed to be registered for ASP?
    21. Is there any inbuilt paging (for example shoping cart, which will show next 10 records without refreshing) in ASP? How will you do pating?
    22. What does Server.MapPath do?
    23. Name atleast three methods of response object other than Redirect.
    24. Name atleast two methods of response object other than Transfer.
    25. What is State?
    26. Explain differences between ADO and DAO.
    27. How many types of cookies are there?
    28. Tell few steps for optimizing (for speed and resource) ASP page/application.
    29. Which command using Query Analyzer will give you the version of SQL Server and Operating System?
    30. Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table.
    31. What is the purpose of using COLLATE in a query?
    32. What is one of the first things you would do to increase performance of a query? For example, a boss tells you that “a query that ran yesterday took 30 seconds, but today it takes 6 minutes”?
    33. What is an execution plan? When would you use it? How would you view the execution plan?
    34. What is the STUFF function and how does it differ from the REPLACE function?
    35. What does it mean to have quoted_identifier on? What are the implications of having it off?
    36. What are the different type of replication? How are they used?
    37. What is the difference between a Local temporary table and a Global temporary table? How is each one used?
    38. What are cursors? Name four type of cursors and when each one would be applied?
    39. What is the purpose of UPDATE STATISTICS?
    40. How do you use DBCC statements to monitor various ASPects of a SQL Server installation?
    41. How do SQL Server 2000 andXML linked? What is SQL Server agent?
    42. What is referential integrity and how can we achieve it?
    43. What is indexing?
    44. Explain differences between server.transfer and server.execute method?
    45. What is de-normalization? When do you do it and how?
    46. Explain features of SQL Server like Scalibility, Availability, Integration with Internet.
    47. What is DataWarehousing?
    48. What is OLAP?
    49. How do we upgrade SQL Server 7.0 to 2000?
    50. What is job?
    51. What is Task?
    52. How would you update the rows which are divisible by 10, given a set of numbers in column?
    53. How do you find the error, how can you know the number of rows affected by last SQL Statement?
    54. What are the advantages/disadvantages of viewstate?
    55. Describe session handling in webform. How does it work and what are the limits?
    56. Explain differences between framework 1.0 and framework 1.1
    57. If we write any code for dataGrid methods, what is the access specifier used for that methods in the code behind file and why and how? Give an example.
    58. What is the use of trace utility?
    59. What are the differences between User control and Web control and Custom control?
    60. If I have more than one version of one assemblies, then how will I use old version in my application? Give an example.
    61. How do you create threadinf in.NET?
    62. Describe the Managed Execution Process.
    63. What is Active Directory? What is the namespace used to access the Microsoft Active Directories?
    64. What are Interop Services?
    65. How does you handle this COM components developed in other programming languages in.NET?
    66. How will you register COM+ services?

    Interview questions for .NET

    1. What is a static class?
    2. What is static member?
    3. What is static function?
    4. What is static constructor?
    5. How can we inherit a static variable?
    6. How can we inherit a static member?
    7. Can we use a static function with a non-static variable?
    8. How can we access static variable?
    9. Why main function is static?
    10. How will you load dynamic assembly? How will create assesblies at run time?
    11. What is Reflection?
    12. If I have more than one version of one assemblies, then how will I use old version (how/where to specify version number?) in my application?
    13. How do you create threading in.NET? What is the namespace for that?
    14. What do you mean by Serialize and MarshalByRef?
    15. What is the difference between Array and LinkedList?
    16. What is Asynchronous call and how it can be implemented using delegates?
    17. How to create events for a control? What is custom events? How to create it?
    18. If you want to write your own dot net language, what steps you will you take care?
    19. Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?
    20. How dot net compiled code will become platform independent?
    21. Without modifying source code if we compile again, will it be generated MSIL again?
    22. How does you handle this COM components developed in other programming languages in.NET?
    23. How CCW (Com Callable Wrapper) and RCW (Runtime Callable Wrappers) works?
    24. What are the new thee features of COM+ services, which are not there in COM (MTS)?
    25. What are the differences between COM architecture and.NET architecture?
    26. Can we copy a COM dll to GAC folder?
    27. What is Shared and Repeatable Inheritance?
    28. Can you explain what inheritance is and an example of when you might use it?
    29. How can you write a class to restrict that only one object of this class can be created (Singleton class)?
    30. What are virtual destructures?
    31. What is close method? How its different from Finalize and Dispose?
    32. What is Boxing and UnBoxing?
    33. What is check/uncheck?
    34. What is the use of base keyword? Tell me a practical example for base keyword’s usage?
    35. What are the different.NET tools which you used in projects?
    36. What will do to avoid prior case?
    37. What happens when you try to update data in a dataset in.NET while the record is already deleted in SQL Server as backend?
    38. What is concurrency? How will you avoid concurrency when dealing with dataset?
    39. One user deleted one row after that another user through his dataset was trying to update same row. What will happen? How will you avoid this problem?
    40. How do you merge two datasets into the third dataset in a simple manner?
    41. If you are executing these statements in commandObject. “Select * from Table1; Select * from Table2″ How you will deal result set?
    42. How do you sort a dataset.
    43. If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?
    44. What is the use of Parameter object?
    45. How to generateXML from a dataset and vice versa?
    46. How do you implement locking concept for dataset?
    47. How will you do Redo and Undo in TextBox control?
    48. How to implement DataGrid in.NET? How would you make a combo-box appear in one column of a DataGrid? What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for DataGrid methods. what is the access specifier used for that methods in the code behind file and why?
    49. How can we create Tree control in asp.NET?
    50. Write a program in C# to find the angle between the hours and minutes in a clock?
    51. Write a program to create a user control with name and surname as data members and login as method and also the code to call it.
    52. How can you read 3rd line from a text file?
    53. Explain the code behind wors and contrast that using the inline style.
    54. Explain different types of HTML, Web and server controls.
    55. What are the differences between user control and server control?
    56. How server form post-back works?
    57. Can the action attribute of a server-side
      tag be set to a value and if not how can you possibly pass data from a form page to a subsequent page?
    58. How would ASP and ASP.NET apps run at the same time on the same server?
    59. What are good ADO.NET object to replace to ADO Recordset object.
    60. Explain the differences between Server-side code and Client-side code.
    61. What type of code(server or client) is found in a Code-Behind class?
    62. Should validation (did the user enter a real date) occur server-side or client-side? Why?
    63. What does the “EnableViewState” property do? Why would I want it on or off?
    64. What is the difference between Server.Transfer and response.Redirect? Why?
    65. Can you give an example of when it would be appropriate to use a web service as opposed to a non-serviced.NET component?
    66. Let’s say I have an existing application written using VB6 and this application utilizes Windows 2000 COM+ transaction services. How would you approach migrating this application to.NET?
    67. If I am developing an application that must accomodate multiple security levels though secure login and my 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?
    68. What are ASP.NET web forms? How is this technology different than what is available though ASP(1.0-3.0)?
    69. How does VB.NET achieve polymorphism?
    70. How does C# achieve polymorphism?
    71. Can you explain what is Inheritance and an example in VB.NET and C# of when you might use it?
    72. Describe difference between inline and code-behind?
    73. What is loosely coupled solution in.NET?
    74. What is diffgram?
    75. Where would you use an iHTTPModule and what are the limitations of any approach you might take in implementing one?
    76. What are the Advantages and DisAdvantages of viewstate?
    77. Describe session handling in a webform, how does it work and what are the limitations?
    78. How would you get ASP.NET running in Apache web servers? Explain it’s limitations.
    79. What is MSIL and why should my developers need an appreciation of it if at all?
    80. Which methos do you invoke on the DataAdapter control to load your generated dataset with data?
    81. Can you edit data in Repeater control? How?
    82. Which template must you provide, in order to display data in a Repeater control?
    83. How can you provide an alternating color scheme in a Repeater control?
    84. What property must you set, and what method must you call in your code, in order to bind the data from some data source to the repeater control?
    85. What base class do all web forms inherit from?
    86. What method do you use to explicitly kill a user’s session? How?
    87. How do you turn off cookies for one page in your site? Give an example.
    88. Which two properties are on every validation control?
    89. What tags do you need to add within the asp:datagrid tags to bind columns manually? Give an example.
    90. How do you create a permanent cookie?
    91. What tag do you use to add a hyperlink column to the dataGrid?
    92. What is the standard you use to wrap up a call to a Web Service?
    93. Which method do you use to redirect the user to another page without performing a round trip to the client? How?
    94. What is the transport protocol you use to call a Seb Service SOAP?
    95. What does WSDL stand for?
    96. What property do you have to set to tell the grid which page to go to when using the Pager object?
    97. Where on the Internet would you look for Web Services?
    98. What tags do you need to add within the asp:datagrid tags to bind columns manually? How?
    99. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?
    100. How is a property designated as read-only?
    101. Which control would you use if you needed to make sure the values in two different controls matched?

    .NET WebDev interview questions - Part 2

    # A structure in C# can be derived from one or more

    * class
    * interface
    * both
    * none

    # State True or False: Static method cannot be overridden

    * True
    * False

    # The Equivalent HTML Control for the tag is

    * HtmlInput
    * HtmlButton
    * HtmlPushButton
    * HtmlInputButton

    # The Equivalent Html Control for the tag is

    * HtmlCheckBox
    * HtmlInputChkBox
    * HtmlInputCheckBox
    * HtmlInputTypeChkBox

    # Which operator is used for connecting a event with a procedure in C#?

    * +=
    * =
    * both
    * none

    # The Equivalent Html Control for the