Sponsored Ad

Tuesday, April 13, 2010

What is Intermediate Language(IL)/MSIL/CIL in .NET

 

IL = Intermediate Language

MSIL = Microsoft intermediate Language

CIL = Common Intermediate Language

IL, MSIL and CIL are the same thing. When we compile .NET project it not directly converted to binary code i converted to Intermediate language. And when we run the project IL is converted into binary code at run time. every language of .NET programming is converted into IL. Only some part of IL which is required at run time is converted into binary code. DLL and EXE of .NET are also in IL form.

Sunday, April 11, 2010

Describe Manifest in .NET?

 

An assembly manifest is a text file containing metadata about .NET assemblies. The Assembly manifest contains the following things:

  1. Version of assembly
  2. Security identity
  3. Scope of the assembly
  4. resolve references to resources and classes.
  5. The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a stand-alone PE file that contains only assembly manifest information.

What is Difference between Assembly and Namespace in C#

 

Namespace:

Namespace is logical grouping of classes. It means Namespace can contains multiple classes. Namespace can span multiple assembly. Namespace use to organize the code in a well structured manner.

namespaces can hold other types as follows:

  • Classes
  • Structures
  • Interfaces
  • Enumerations
  • Delegates

Assembly:

Assembly is fundamental building blocks of any .NET application. Assemblies contain metadata that describe their own internal version number and details of all the data and object types they contain. Assembly is physical grouping of logical unit.

Thursday, April 8, 2010

Can We have Multiple Main Functions in C#?

 

Yes we can have different classes having main functions. Both class can have their own main functions. The program decides at compile time which main should be executed. So actually there is only one main function.

for example  we have two classes class1 and class2 in a program. Now how the compiler will decide which main should be executed at runtime?

using System;

class Class1
{
public static void Main()
{
Console.WriteLine("Class 1");
}
}
class Class2
{
public static void Main()
{
Console.WriteLine("Class 1");
}
}
at compile time we are specifying that Class1 is containing our Main function and that will be execute at runtime.
csc filename.cs/main:Class1
 

Candle Puzzle Interview Question

 

Ques: Suppose you have two candles, One candle takes 90 minute to burn completely? How will you measure 135 minutes using these two candles?

Ans: burn one candle completely and then burn another candle from both sides.

90 + 90/2 = 135 minutes

Wednesday, April 7, 2010

C# Interview Questions 2010

 

Ques: Write a Program to find a given number is prime or not? Now optimize this program?

Ans: Start with 2 and divide the given number till n-1 if it is not divisible then it is a prime number.

To optimize this program you can check divisibility from 2 to n/2.

Ques: What are design patterns and what is the use of Design patterns?
Ans: To ease the software development process.

Ques: What is difference between Count(*), Count(1) and count(column_name)?
Ans: no difference between count(*) and count(1). While count(column_name) does not calculate null value fields.

Ques: what is difference between string and string builder?
Ans: string builder provide low overhead manipulation operations with a given string.

Ques: What is Difference between truncate, Delete and drop?
Ans: Drop Delete the table structure while truncate remove all rows from table without rollback facility. Delete remove rows from table with rollback features.

Ques: What are Delegates and events?

Ques: Explain Webpage Life Cycle?
Pre Init, Init, Pre Load, Load, Pre render, render, unload etc.

Ques: With Master page what will be sequence of event execution?
Ans. Master Page events executes first.

Ques: What is use of try.parse(string)?
Ans. Try.parse use to convert given data type to another one without exception.

Ques: Design a architecture for Chess Program?

Ques: What is HTTP GET and POST?
Ans: use get to receive information and post to send info in a webpage.

Ques: What is Difference between hash table and Dictionary?
Ans: Dictionary internally uses hash table.

Ques: What is Callback in c#?
Ans: Events and Delegates.

Technical Interview Puzzle Questions

 

 

Ques: You have 5 Box, 4 Box have 9 gram ball and 1 Box have 10 gram balls. You have a digital weight

Machine (One pan machine, with digital reading). How will you find 10gram ball Box in one measurement?

Ans: Just take 1 ball from first Box, 2 ball from second, 3 ball from 3rd, 4 balls from 4th Box, 5

balls from 5th Box.

Now measure all the ball, now you can total 15 balls. if total weight comes to

5*10 + 9*10 then 10 gram ball in 5th Box
4*10 + 9*11 then 10 gram ball in 4th Box
3*10 + 9*12 then 10 gram ball in 3rd Box
2*10 + 9*13 then 10 gram ball in 2nd Box
1*10 + 9*14 then 10 gram ball in 1st Box

Sponsored Ad

Followers

Follow Us