.NET Interview Questions and Answers Part 4

By // 1 comment:
1.)What is Pinvoke ?                                                                                                                       
Pinvoke(Platform invoke) is a service that enables managed code to call unmanaged functions implemented in DLLs  (dynamic-link libraries), such as those in the Win32 API.
2.)Is it true that COM objects no longer need to be registered on the server??     
Yes. It is true that COM objects no longer need to be registered on the server.
3.) Can .NET Framework components use the features of Component Services?
Yes, we can use the features and functions of Component Services from a .NET Framework component. 
4.) What are server controls in ASP.NET ?                                                                            
The Server controls are components that run on the server and encapsulate user-interface and other related functionality. They are used in ASP.NET pages and in ASP.NET code-behind classes.
4.) What is the difference between Web User Control and Web Custom Control ?  
3

.NET Interview Questions and Answers Part 3

By // No comments:
1.) What is CCW  ?                                                                                                                            
This is also called  COM Callable Wrapper.A proxy object generated by the common language runtime(CLR) so that existing COM applications can use managed classes, including .NET Framework classes, transparently.
2.) When do we absolutely have to declare a class as abstract  ?                                 
  • When at least one of the methods in the class is abstract. 
  • When the class itself is inherited from an abstract class and no base abstract methods have been over-ridden.
3.)Why can’t we specify the accessibility modifier for methods inside the  interface 
They all must be public. Therefore, to prevent from getting the false impression that we have any freedom of choice, we are not allowed to specify any accessibility, it is public by default.
3

General .NET Interview Questions and Answers Part 2

By // No comments:
1.) What is .NET Assembly ?                                                                                                        
A assembly is the smallest units of  versioning and deployment in the .NET Application. In other way :- A single deployment unit is known as an assembly file. We generally use following assembly file in .NET Application.
  • Web services
  • Windows Services
  • Service components
  • Remoting Application
  • WCF Services
2.) What are the types of Assembly files in .NET ?                                                             
  1. Private assembly
  2. Shared assembly
3.) What is a Strong Name in .NET ?                                                                                        
A Strong Name contains the name of the assembly ,Version number,culture and a public key tokens.

4.) What is difference between private and shared assembly ?                                     
Private assembly:-
  • Private assembly is used inside an application only.
  • We can't access it fromout side the application.
  • It is not identified by a strong Name.
Public or shared assembly:-
  • Shared assembly can be used in multiple applications.
  • It can be used inside or outside the applications.
  • It contains a strong name.
5.) Where is shared assembly file stored ?                                                                            

Global assembly cache

6.) How to create a strong name for a .NET Application ?                                             
To create a strong Name ,We use a strong Name tool (sn.exe).

7.) Can we place two files with same file name in GAC Folder ?                                  
Yes.

8.) How does GAC differentiate two files with same name  ?                                        
GAC does differentiate two files with same name by version number.
Ex
If first file has version number = 1.0.0.0 then second file has version number = 1.1.0.0

9.) What is delay signing  ?                                                                                                           
It allows you to place shared assembly in the GAC folder by signing the assembly with public key or private key.

10.) What is design patterns  ?                                                                                                   
A design patterns are the most important parts of any project life cycle.
  • A good design patterns is more responsible to success of any projects.
  •  A good design patterns have the potential to permanent change the software engineering field.
11.) What are the types of design patterns  ?                                                                      
  • Creational patterns
  • Behavioral patterns
  • Structure patterns 
12.) What is .NET framework ?                                                                                                 
The .NET  Frameworks is a part of Microsoft.NET . The .NET Frameworks consists of two parts:
  1. .NET Common Language Runtime
  2. .NET Class Library
These two components are packaged together into the .NET Frameworks SDK .You can download it free from microsoft site.
3

Multithreading Questions and Answers

By // No comments:
1. ) What is thread ?                                                                                                              
A thread is basically a separate sequence of instruction designed to performing a " specific task" in the program.

2. ) What is Multithreading in c# ?                                                                                   
Performing multiple task at same time during the execution of a program,is known as multithreading.

3. ) What is the Namespace used for multithreading in c# ?                                      
using System.Threading;

4. ) What are the advantage of multithreading in c# ?                                                 
There are two main  advantage to use of multithreading in c#.
  • Optimize the use of computer resources such as memory.
  • Save time
3

Interface and operator overloading Questions and Answers

By // 2 comments:
1.) What is an interface in c#?                                                                                           
An interface is a reference type in c#.It is basically a kind of class with some differences,which are given below:-
  • All the members of an interface are implicitly public and abstract.
  • We can not declare the interface members as  static.
  • An interface can not contain constructors, destructors and constant fields.
  • An interface can inherit multiple interfaces.
 2.) Can interface contain one or more methods?                                                          
Yes, But none of them are implemented in the interface itself.
3

File Handling questions and answers

By // No comments:
  1. ) What are file and stream in asp.net?                                                                             
A file is typically the principal means by which you can intact with a program .A file can be a data set that you can read,create ,delete,append and modify or a stream of bytes that are generated by the program. 
 2. ) What is Namespace used in file & stream classes?                                                    
Using System.IO;

 3. ) What is the Directory class ?                                                                                               
Directory class allows to include a buffering layer to read & write operations on the other stream.we can't inherit this class.

 4. ) What is the Directory Info class ?                                                                                      
Directory info class provides the instance methods for creating ,moving & enumerating through directories & sub directories.we can not inherit this class.
3

Exception Handling Questions and Answers

By // No comments:
1. ) What is Exception Handling in c# ?                                                                           
In Exception handling,we provide an alternate path,if some error occurs at run time instead of  halting the programs.

2. ) What is Debugging ?                                                                                                      
Debugging is the process of identifying and fixing errors in a software program.

3. ) What are the types of error in c# ?                                                                            
There are three types of error ,which are given below:-
  • Compile time error
  • Runtime error
  • Logical error
3

Delegates and Events Questions and Answers

By // No comments:
1. ) What do you mean by call-back method?                                                                 
In object -oriented programming, one object send to message to other objects,The methods are used to callback message are known as callback methods.
     C# implements the callback technique in much safer and more object oriented manner,using the help of delegate objects.

2. ) What is the 'type safe' information?                                                                          
  • Number of parameters
  • Types of parameters
  • Return type
  • Calling convention
3

oops Questions and Answers

By // No comments:
1.) What is object oriented programming (oops) Language?                                       
oops is is a methodology to write the program where we specify the code in form of classes and objects .oops supports   three important features which are given below:
  • Encapsulation 
  • Inheritance
  • Polymorphism
Note:- Abstraction is also basic oops concepts feature.But mainly three important feature of oops.

2.) What is object based Language?                                                                                 
Object based language supports all features of oops except two features which are given below:
  • Inheritance
  • Late binding
3

Classes and Objects Questions in C#

By // No comments:
1. ) what is class in C#?                                                                                                        
A class is a user-defined data type with a template that serves to define its properties.
More Details...

2. ) How to declare a class in C#?                                                                                      
Syntax:-
Class class-name
{
variables declaration;
Method declaration;
}

                                                               OR

Class class-name
{
                                                                    //empty class
}

3

Structures and Enumerations Questions in C#

By // No comments:
1. ) What is structure in C#?                                                                                               
A structure is an user defined data type which can contain different members as variable , Method ,properties etc. Structures are value type and stored on the stack memory.

2. ) What is the advantage of structure in C#?                                                               
Structures are stored on the stack,so there are some advantage of structures.
  • Structure are created more quickly than heap -allocated.
  • Structures are automatically deallocated ,when it go the out of the scope.
  • Structures are value type so that we can easily copy value type variables on the stack memory.
3

Strings Questions and Answers

By // No comments:
1.) What is String?                                                                                                                 
A string is a  combination of sequence of characters.It is one of the built-in types ,provided by .net Framework.

2.) What is Mutable and Immutable string in C#?                                                        
  • Mutable -->means -->change in value
  • Immutable -->means -->No change in value
    More Details..             
3

Arrays Questions in C#

By // No comments:
1. ) What is an array?                                                                                                        
An array is a kind of variable which can hold multiple variable for same data type.

2. ) What are the steps involve for creation of an array?                                         
  • Declaration of Arrays
  • Creation of Arrays
  • Initialization of Arrays
3. ) What is the syntax for declaration of an array?                                                  
 type [ ] arrayname;
3

Methods Questions in C#

By // 1 comment:
1. )  What are the elements used in a Method Declaration?                                         
  • Name of the Method
  • Type of value the Method returns ( type)
  • Lists of parameters
  • Body of the Method
  • Method Modifier(access-specifier)
3

Decision Making and Looping Questions

By // No comments:
1.) What are the Decision making statements in C#?
  • If statement
  • Switch statement
  • Conditional operator statement
2. ) What is the Syntax of Switch statement?
switch(expression)
{
case 1:
...........statements.........
break;

case 2:
...........statements.........
break;
default:
...........statements.........
break;

}
3

Operators and Expressions Questions

By // No comments:
1. ) What is an operator in C#?
An operator is a symbol that is used to perform certain Mathematical and Logical  manipulations.  operators are used in program to manipulate data and variables.
More Details...

2. ) What are  Special operators in C#?
is                                         Relational operator
as                                        Relational operator
typeof                               type operator
sizeof                                size operators
new                                    object creator
.(dot)                                 member-access operator
checked                            overflow checking
unchecked                       overflow checking
3

Variables and Data Types Questions

By // No comments:
1.) What is a collection of Tokens in C#?                                                                        
There are five types of token in c#.
  • Keywords
  • Identifier
  • Operators
  • Literals
  • Punctuators

2.) What is Literal?                                                                                                              
 Literals are the way in which the values that are stored in variables are represented.
3

General C# Questions

By // No comments:
1.) What is a Class?
A class is a user-defined data type.It is like a template.

2.) What is the importance of the Main Method in C# Program?
Every C# program start executing from the main method .We can not run any C# program without Main Method(),so Main Method is more important for executing any C# program.

3.) What are the types of comment styles in c#                                                             
  • Single Line comment (/*......*/)
  • Multiline comments (// .......)
  • More Details...
3

General .NET Questions and Answers

By // No comments:
1.) What is .NET ?                                                                                                                 
.NET is a platform which is used to develop the  different types of Applications..NET Consist on:-
  • .NET Framework
  • Visual Studio .NET IDE
2.) What is .NET  Framework?                                                                                          
.NET Framework is a Kind of Environment(set of Components) which allow us to develop the different kinds of applications.
  • Windows -based Applications
  • Web based Applications
  •  Console Applications
  • Building Windows Device Driver
3
Powered by Blogger.