.Net interview questions

Get Technical Answers for Dot Net Interview Questions by .Net Developers, Advanced Technical Questions for Freshers and Experience Persons. Get Free Practical Tests.

1 What are the advantages of Informatica?

NET Framework is an important integral component in NET software

Net Framework is a runtime environment, which we can use to run net applications

2 What is Visual StudioNet?

AVisual Studio NET is a Microsoft-integrated development environment (IDE)that can be used for developing console applications, Windows Applications, Web Applications, Windows Service, Web service And so on

3 Difference between Net Framework and VisualStudioNet?

NET FRAMEWORK VISUAL STUDIO NET

1 It is a run- time environment; which we can use to run applications1 It is a development environment, which we can use to developapplications2 It is required for net developer’s andnet application end users2 It is required for only net developers3 It is a free ware which we can download from Microsoft Website3 It is not free way which we have to purchase from Microsoft

4 What is CLR?

CLR 

Stands for

Common Language Runtime

,it is net execution

CLR is a common execution engine for all NET Languages that means every NET language application has to execute with the help of CLR

5 Explain net application Execution process?

Diagram for net application execution process:

Net application Execution process can be divided into 2 steps:

 

 Step1

 Converting HIGH level language code into MSIL (Microsoft Intermediate Languagewith the help of language compilers because Net execution engine(CLRcan understand only MSIL code

Step2

 JIT (JUST-IN-TIME compiler will convert MSIL code to NATIVE code because operating system can understand only NATIVE code or MACHINE code

6 What is JIT Compiler?

AJIT (JUST-IN-TIME Compiler will convert MSIL (Microsoft Intermediate Language code to Native code because operating system can understand only Native code or machine code

7 What is CLS?

1 CLS (Common Language Specifications is a set of common language standard defined by the Microsoft for all NET Languages2 Every NET Language has to follow CLS Standards3 Whenever a Programming Language wants to recognize as NET Language then it has to follow CLS

8 What is CTS?

CTS (Common Type Systemic a subset of CLS It is a set of common based data types defined by Microsoft for all NET Languages

2 Every NET Language has to map their data types with CTS types

9What is MSIL Code?

A Microsoft Intermediate Language (MSIL), is one of the Core component of theNET Framework Any NET source codes written in any net supportive language(C#, VBnet etc), when compiled are converted to MSIL This MSIL, when installed or at the Runtime, gets converted to machine code The Runtime conversion of MSIL code to the machine code is handled by a component called as the Just In Time (JITCompiler

10 Explain the role of Garbage collector?

AIn NET, MEMORY MANAGEMENT is handling by GARBAGECOLLECTOR (GC) GC is an integral part of CLRTo perform memory Management GC will do 2 duties

1 Allocating the Memory

->When new object is created by application garbage collector will allocatememory for that object with in Managed heap

11 Why C#Net?

ATo develop any type of application by using NET we require one NETLANGUAGE to write the business logic of that application

12 Explain about primitive data types?

AIn C#NET, according to the type of the data and size of the data, data types areclassified into

5 types

They are

 1 Numerical Data types

 Assigned Numerical data types: byte, short, int, long unsigned Numerical data types;- byte, short, unit, long

 2 Floating

  Float, double, decimal

 3 Character related Data types

Char

4Logical Data Types

 abool

5 General data Types

astring bobjectThese data types are called as

PRIMITIVE DATA TYPES

13 What is the MaxValue and MinValue?

A Max Value and Min Value are predefined constants, which are members of every primitive data type structure except bool Using this Constant we can get the MINIMUM value and MAXIMUM value of a data type

14 Difference between value types and Reference types?

VALUE TYPES REFERENCE TYPES

 1In value types, data will storing inSTACK MEMORY1 In this, Data will be storing in HEAPMEMORY2 Value type variable can contain theactual data2 Reference type variable will containthe address of the data3 In primitive data types except Generaldata types are called VALUE TYPESThey are Numerical, Floating, Characterand LogicalEx: Int, Long, Char3 In primitive data types only Generaldata types will come underREFERENCE TYPEEX: String, Object4 Structures and Enums are value types 4 Class, interface, delegates come underthis

5 When we will go for signed data types and when we will go forunsigned data types?For Example:-When we will go for sbyteWhen we will go for byte

AWhenever we want to allow both positive and negative values then we will gofor signed data typesWhenever we want to allow only positive values then we will go for unsigned datatypesHere sbtye is a signed data type and byte is an unsigned data type

15 What is the output?

static void Main (string [] args){Char  c='a';int j=c;ConsoleWriteLine (j);ConsoleReadLine ();

}

Output: 97

16 Can I assign 1 or 0 into bool variable?

static void Main(string[] args){ bool b = 1;ConsoleWriteLine(b);ConsoleReadLine();}

ANo

17 What is the output ?

static void Main(string[] args){ bool b =true;ConsoleWriteLine(b);ConsoleReadLine();}

OUTPUT: True

18What is Managed Code and Unmanaged Code?Net application may contain 2 types of codesAManaged Code BUnmanaged Code

Managed code:

The code which is taking the help of CLR for execution is called as managedcodeExample for Managed Code:-All net languages code is managed codeVBNet code,

C#Net code…etc

BUnmanaged code: -

The code which is not taking the help of CLR for execution is called asUnmanaged codeExample for Unmanaged Code:-In net application non net code is unmanaged codeVB Code,

VC++ Code…

Note: - net application can contain non net code

19 Can we assign null value into value type variable?

No but we can assign null values into reference type variable

20 How to assign null value into value type variable?

AWe have to go for NULLABLE VALUE TYPESSyntax:

=NULL;

21 When we will declare particular variable as nullable type?

Whenever an input is an optional that means not compulsory then we candeclare particular variable as NULLABLE TYPES

22 What is implicit typed variable when we will go for implicittyped variable?

Using

var

 keyword we can declare IMPLICIT TYPED VARIABLE

IMPLICIT TYPED VARIABLE can have any data type value and thisvariable will be converting into particular data type based on the valuewhich is assigningWhenever we r unable to expect the type of value which is going to assign

23 What is the difference between GetType(and typeof()?

typeof(GetType()

1

It will return the given data type base type1

It will return the given variabledata type base type2

It is a operator 2

It is a method

24 What is the output?

static void Main(string[] args){var a = 10;var b = 105;ConsoleWriteLine(aGetType());ConsoleWriteLine(bGetType());ConsoleReadLine();}

25 What is implicit type casting? When we will go for explicit typecasing?

IMPLICIT TYPE CASTING: -

 Converting from Smaller size data type to bigger size data type is called as IMPLICIT TYPE CASTING

When EXPLICIT TYPE CASTING:

 - The type casting which is not possible byusing implicit type casting then we have to go for EXPLICIT TYPE CASTING

26 Difference between Parsing and Converting?

Parsing Converting

1

Using parsing we can convert fromonly string data type to any other datatype except object data type2

Using converting we can convertfrom any data type to any otherdata type

27 What is the output?

static void Main(string[] args){string s1 ="1234";string s2 ="12345";string s3 ="rama";string s4 =null;string s5 ="12321321321323232132132332";int res;res =intParse(s1);ConsoleWriteLine(s1);//res = intParse(s2); //res = intParse(s3); //res = intParse(s4); //res = intParse(s5); ConsoleReadLine();}

28 Difference between intParse(and ConvertToint32()?

IntParse(ConvertToInt32()

1Using this we can convert from onlySTRING to INT1Using this we can convert from anydata type value into INT2When we are parsing if the stringvariable contains NULL value then this parsing technique will throw argument NULL EXCEPTION2When we are converting if the stringvariable contains NULL value then itwill convert that NULL as ZERO

29 What is Boxing and Unboxing?

BOXING: -

 It is the process of converting from VALUE type toREFERENCE typeEx: converting from int to object

UNBOXING: -

It is the process of converting from REFERENCE type toVALUE typeEX: converting from object to int

30 What is the difference between ConvertToString(andTostring()?

AConvertToString(handles NULL values even if variable value become NULLTostring(will not handles NULL values it will throw a NULL referenceexception error

31 What is the difference between string and StringBuilder?

STRING STRING BUILDER

1 When we implement modifications tothe existing String object withinmemory it will create a new objectBecause string is IMMUTABLE1 When we implement modifications tothe existing StringBuilder object will notcreate new copy of object instead of thatit will modify the existing objectBecause StringBuilder is MUTABLE2 String will allocate a new memorywhenever we concatenate the stringvalue

EX: String s1=‖sathya‖;

S1=s1+‖Tech‖;

 ConsoleWriteLine(s1);2 StringBuilder class will have amethod Append(this method is used toinsert the new value on the existingvalueso the usage of string builder is moreefficient in case of large amount ofstring

 EX: StringBuilder s1=new

StringBuilder(―sathya‖);

S1Append(―Tech‖);

 ConsoleWriteLine(s1);3 It will occupy more memory, it willdecrease the performance ofapplications3 It will occupy less memory, it willimprove the performance ofapplications

For Example:-

static void Main(string[] args){string s1 ="Hydera";ConsoleWriteLine(s1GetHashCode());s1 = s1 +"bad";ConsoleWriteLine(s1GetHashCode());ConsoleWriteLine(s1);StringBuilder  s2 =new StringBuilder ("Hydera");ConsoleWriteLine(s2GetHashCode());s2Append("Bad");ConsoleWriteLine(s2GetHashCode());ConsoleReadLine();}

32 What is Error, Bug and Defect?

Error

--> Which comes at the time of development

Bug

 --> Which comes at the time of testing (Pre-Release)

Defect

 --> Which comes in Production (Post-Release)

.Net Training Certification

  • Master Your Craft
  • Lifetime LMS & Faculty Access
  • 24/7 online expert support
  • Real-world & Project Based Learning

 

33 Why class and object?

CLASS:

 To achieve ENCAPSULATION, as well as for modularity

OBJECT:

 To allocate memory for instance variables & to store the address ofinstance method

Subscribe to our youtube channel to get new updates..!

 

34 When we will go for instance variable?

AWhenever we required a filed for multiple objects with the different values,then particular variable we will declare as INSTANCE VARAIBLE

.Net Training Certification

Weekday / Weekend Batches

 

Submit an interview question

Categories

Request for more information

Webinar

Python tutorial for beginners

5th April | 08:00 AM

150 Registered

Vineeth
Vineeth
IBM Software & computer science
Am vineeth and is full computer science contributor for hkr trainings. Before that I was worked for IBM Software Group building database and middle ware products. And am well aware of all IT technologies. And Am very much happy to be a part of this session. Thanks for being given me the opportunity to introduce myself. Contact me with my email or twitter account.

To Top