Interview Tips Interview Tips, Interview Questions and Answers

25Mar/110

Remoting

Remoting provides a framework that allows objects to interact one another accross application domains

It is the concept of working in different application domains. In a net connected application http Protocols are stateless by default. To bring in the objects of different types and get their information as which method property is being used and getting them invoked from a remote machine is Remoting. Remoting actually works across different domains and processes and getting information about the objects used by them through the runtime environment.

17Nov/100

What Can Generics Do For Me?

In .NET v1.0 there were collections, such as the ArrayList for working with groups of objects. An ArrayList is much like an array, except it could automatically grow and offered many convenience methods that arrays don't have. The problem with ArrayList and all the other .NET v1.0 collections is that they operate on type object. Since all objects derive from the object type, you can assign anything to an ArrayList. The problem with this is that you incur performance overhead converting value type objects to and from the object type and a single ArrayList could accidentally hold different types, which would cause a hard to find errors at runtime because you wrote code to work with one type. Generic collections fix these problems.

A generic collection is strongly typed (type safe), meaning that you can only put one type of object into it. This eliminates type mismatches at runtime. Another benefit of type safety is that performance is better with value type objects because they don't incur overhead of being converted to and from type object. With generic collections, you have the best of all worlds because they are strongly typed, like arrays, and you have the additional functionality, like ArrayList and other non-generic collections, without the problems.

9Jul/100

Describe the basic schema of a .config file.

Configuration File Schema for the .NET Framework

Configuration Files are standard XML files.

The elements that implement configuration settings are:
<configuration> Element is the top-level element for all configuration files.
<assemblyBinding> Element specifies assembly binding policy at the configuration level.
<linkedConfiguration> Element specifies a configuration file to include.

The configuration schema is for the machine configuration file, application configuration files, and the security configuration file. The following schemas describe their element purposes:

  • Startup Settings Schema – specification of version of the CLR to be used.
  • Runtime Settings Schema – configuration of assembly binding and runtime behavior.
  • Network Settings Schema – specification of .NET connection to the Internet. \
  • Cryptography Settings Schema - mapping friendly algorithm names to classes that implement cryptography algorithms.
  • Configuration Sections Schema - creation and use of configuration sections for custom settings.
  • Trace and Debug Settings Schema – specification of trace switches and listeners.
  • Compiler and Language Provider Settings Schema – specification of compiler configuration for available language providers.
  • Application Settings Schema – enabling Windows Forms or ASP.NET applications to store and retrieve application-scoped and user-scoped settings.
16Apr/100

.NET interview: What is a CLR (Common Language Runtime)?

Often there is a need for different languages to communicate with each other at run time. For e.g. A class may be written in one language and its derived class may be written in a different language. Common Language Runtime is a run time environment for .NET. These different languages are integrated and can communicate easily because language compilers and tools that target the runtime use a common type system defined by the runtime.

Features or Functionalities offered by CLR:-

  • Garbage collection for managing life of objects.
  • Enables Cross language inheritance as explained in example above.
  • Syntax and keywords similar to C and C++
3Jan/100

.NET Interview Questions on CLR

Overview of CLR integration.
The CLR (Common Language Runtime) integration is hosted in the Microsoft SQL Server 2005.
With CLR integration, stored procedures, triggers, user- defined functions, user-defined types, and user-defined aggregates in managed code, etc can be written.
As managed code compiles to native code before executing, significant performance can be achieved.
The SQL Server acts as an operating system for the CLR when it is hosted inside SQL Server.

Following are the steps to build a CLR stored procedure in SQL Server 2005

    * Enable CLR integration in SQL Server 2005
    * Create a CLR stored procedure Assembly
    * Deploy the Assembly in SQL Server 2005
    * Create and execute the CLR stored procedure in SQL Server 2005

Explain CLR in brief.
CLR stands for Common Language Runtime. The CLR is a development platform. It provides a runtime, defines functionality in some libraries, and supports a set of programming languages. The CLR provides a runtime so that the softwares can utilize its services. The CLR Base Class Library allows interaction with the runtime. The CLR supports various programming languages, several standards and is itself been submitted as an open standard.  

Describe the parts of assembly.
An assembly is a partially compiled code library. In .NET, an assembly is a portable executable and can be an EXE (process assembly) or a DLL (library assembly). An assembly can consist of one or more files or modules in various languages. It is used in deployment, versioning and security.