Interview Questions - WorkShop (250 Questions and Answers) PDF
Interview Questions - WorkShop (250 Questions and Answers) PDF
Interview Questions - WorkShop (250 Questions and Answers) PDF
RN REDDY
.Net Interview (250)
Questions and Answers
.NetFrameWork
What
Face book
Id: is .Net Framework?
A).
https://www.facebook.com/groups/rnreddytechsupports/
Gmail
4) What is CLR?
A)
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.
Step1. Converting HIGH level language code into MSIL (Microsoft Intermediate
Language) with the help of language compilers because .Net execution engine
(CLR) can 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.
7) What is CLS?
A) 1. CLS (Common Language Specifications) is a set of common language
standard defined by the Microsoft for all .NET Languages.
2. Every .NET Language has to follow CLS Standards.
3. Whenever a Programming Language wants to recognize as .NET Language then
it has to follow CLS.
8) What is CTS?
A)
CTS (Common Type System) is 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.
2. De-Allocating the Memory:->When an object is not using by the application garbage collector will
recognize it as unused object..and garbage collector will destroy unused objects
according to generation algorithm.
C#.Net
1. Why C#.Net?
A) To develop any type of application by using .NET we require one .NET
LANGUAGE to write the business logic of that application.
REFERENCE TYPES
1. In this, Data will be storing in HEAP
MEMORY.
2. Reference type variable will contain
the address of the data.
3. In primitive data types only General
data types will come under
REFERENCE TYPE.
EX: String, Object
4. Class, interface, delegates come under
this.
5. When we will go for signed data types and when we will go for
unsigned data types?
For Example:When we will go for sbyte
When we will go for byte
A) Whenever we want to allow both positive and negative values then we will go
for signed data types.
Whenever we want to allow only positive values then we will go for unsigned data
types.
Here sbtye is a signed data type and byte is an unsigned data type.
Output: 97
7. Can I assign 1 or 0 into bool variable?
static void Main(string[] args)
{
bool b = 1;
Console.WriteLine(b);
Console.ReadLine();
}
A) No.
8. What is the output ?
static void Main(string[] args)
{
bool b = true;
Console.WriteLine(b);
Console.ReadLine();
}
OUTPUT: True
GetType()
1. It will return the given variable
data type base type
2. It is a method
OUTPUT: System.Int32
System .Double
15. What is implicit type casting? When we will go for explicit type
casing?
A) 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 by
using implicit type casting then we have to go for EXPLICIT TYPE CASTING.
Converting
2. Using converting we can convert
from any data type to any other
data type.
OUTPUT: 1234
18. Difference between int.Parse() and Convert.Toint32()?
A)
Int.Parse()
1.Using this we can convert from only
STRING to INT.
2.When we are parsing if the string
variable contains NULL value then this
parsing technique will throw argument
NULL EXCEPTION.
Convert.ToInt32()
1.Using this we can convert from any
data type value into INT.
2.When we are converting if the string
variable contains NULL value then it
will convert that NULL as ZERO.
STRING BUILDER
STATIC VARIABLE
(or)
CLASS VARIABLE
1. A variable which is declared inside
the class and outside the method by
using STATIC keyword is called as
STATIC VARIABLE.
2. Static variable will create only once
when the class is loading.
3.satic variable value will be same for
every object
STATIC VARIABLE
1. Value will be common for all objects
but value can be changed
STATIC READONLY
1. value be common for all objects but
value cant be changed
STATIC VARIABLE
1. static keyword
2. Its value can be
changed
3. For static variable,
programmer has to
declare as static
READONLY
1.Readonly keyword
2.Its value cannot be
modified
3.By default Non-static
4. Readonly can be
initialized at the time of
declaration or runtime
(only within the
constructor)
30) When the memory will be allocated for instance variable and
static variable?
A) STATIC VARIABLE: - At the time of class is loading, memory will be
allocated for static variable.
INSTANCE VARIABLE: - When the object is created the memory is allocated
for instance variable.
A) this()
43) What is constructor overloading?
A) Implementing multiple constructors within a single class with different
signature (Different no. of parameters or Type of parameters or Order of
parameters) is called CONSTRUCTOR OVERLOADING.
46) Main() and static constructor in same class which one will
execute first?
A) STATIC CONSTRUCTOR
CALL BY OUT
1.Out keyword is used
2. Out parameter is not required to have
value.
3. Whenever we dont want to pass any
values but we are expecting back the
modifications then we will pass
particular parameter as CALL BY OUT
Or
Binding VARIABLES and METHODS is called as ENCAPSULATION.
By implementing class we can achieve ENCAPSULATION.
SEALED CLASS
1. It can contain both STATIC and
INSTANCE members.
2. It can be instantiated(we can create
object for sealed class)
3. SEALED keyword is used.
4. Cant be inherited.
STRUCTURE
1. It is value type
2. When we create an object for
structure it will be allocated into
STACK MEMEORY
3. To define a STRUCTURE, struct
keyword is used
4. It will not support inheritance
5. Instance field intializers are not
allowed.
PROPERTY
1. It is used to assign value to class level
variables as well as can retrieve the
value from class level variables.
bc b = new dc();
b.display();
b = new tc();
b.display();
Console.ReadLine();
}
}
OUTPUT: dc display
bc display
68) Difference between function overloading and function
overriding?
FUNCTION OVERLOADING
1. Multiple methods with the same name
and different signature.
2. It can implement in a single class and
combination of base and derived class.
3. No keywords are used
4. Both functions return types can be
same or differ.
5. It is a compile time polymorphism
6. We can overload static methods
7. Constructors can be overload.
FUNCTION OVERRIDING
1. Multiple methods with the same name
and same signature.
2. To implement override we should go
for base and derived class, we cannot
implement in single class.
3. virtual in base class and override in
derived class
4. Both functions return types should be
same.
5. It is a Run time polymorphism
6. We cannot override static methods
7. Constructors cannot be overload.
70) Why we cant create object for abstract class and interface?
A) Not required
Because is abstract class is a partial implemented class and interface has no
implementation.
Even though these abstract class abstract members and interface members should
implement within the derived classes.
Due to that reason we dont required to create object for abstract class and
interface.
We will create an object for derived class and using that object we can access
abstract members and interface members.
INTERFACE
1. It is collection of abstract members,
that means by default interface members
are abstract.
2. While defining an interface, interface
keyword is used.
3. No implementation
4. We cant implement a property and
method.
5.it cant contain fields
6.it cant contain constructor
7. While implementing interface
members with in the derived class we
dont required to user override key
word.
75) What code we will write within try, catch and finally blocks?
A) TRY BLOCK: We have to write the statements which may throw an error.
CATCH BLOCK: We will write the statements to display user friendly messages
to the user to give more clarity to the user regarding error.
FINALLY BLOCK: We will write ERROR FREE code or CLEAN UP code that
means the statements which we want to execute irrespective of error occurrence.
76) Can we have multiple catch blocks and if yes when we will go for
multiple catch blocks?
A) Yes. Whenever we want to handle multiple errors we have to go for
MULTIPLE CATCH BLOCKS.
dll
1. dll stands for DYNAMIC LINK
LIBRARY.
2.File extension will be .dll
Hello.dll
3.dll file will not have an ENTRY point
called main()
4. exe is SELF EXECUTABLE. Exe
itself is an application.
called main()
4. dll is not a self executable, it is
reusable component. It will depend on
some other application for execution for
execution.
5. Collection of classes which is not
having Main() will produce dll files.
Ex: .Net class library project.
SHARED ASSEMBLY
1. An assembly which is providing
services to MULTIPLE client
application at a time is called as
SHARED ASSEMBLY
2. It will not create a local copy, it will
provide services to multiple client
application from a centralized shared
folder called GAC.
HOW :
Class myclass
{
Internal static void print <T, K> (Ta, Kb)
{
}
}
Class program
{
Void Main ()
{
Myclass.print<int, string> (10,sathya);
Console.ReadLine ();
}
}
ASP.Net
1. What is ASP.Net? Why asp.net?
A) 1. ASP.NET is a .NET web technology or Server side technology.
WHY: To develop a web application by using .Net we have to use a .Net web
technology called Asp.Net and a .Net language called C#.Net.
10. How to invoke server side validation function and how to invoke
client side validation function?
A) Server side validation functions can be invoked by using ASP.NET and Client
side validation function are invoked with the help of JavaScript and HTML.
15. In asp.net page life cycle events which will fire first?
A) Page_PreInit
17) What are the default events of controls Button and Textbox?
A) Default events of:
Button: CLICK Event
TextBox: TEXTCHANGED Event
ASP.NET
1. Asp.Net is a .Net advanced server
side technology.
2. Asp.Net will support 2 programming
techniques i.e INPAGE and
CODEBEHIND technique
called NOTEPAD)
3.In Asp, its file extension is .asp
4. Asp uses mostly VBScript, HTML
and JavaScript
5. Asp has limited OOPs support.
26) What is the parent class for all asp.net web server controls?
A) System.Web.UI.Control.
View Control: It can contain normal controls, but view control should be placed
within the multiview.
By implementing view and multiview control we can reduce the no. of pages.
61) What is the framework tool will user to create aspstate database
with in sqlserver?
A) aspnet_regsql
69) Why inproc session is not suitable for webgarden and webfarm
model?
A) Inproc sessions will create within the current App Domain due to that reason
app domain data is not sharable due to that reason Inproc sessions are not suitable
for WEB GARDEN and WEBFARM MODELS.
SESSION
1. Session is a server side state
management technique.
2. Session is also a variable which will
create within the Web server.
3. Default life time of session variable is
20 minutes.
Drawbacks: 1. All the attributes and values are visible to the end user. Therefore,
they are not secure.
2. There is a limit to URL length of 255 characters.
103) When we will go for formview and when we will go for details
view?
A) FORMVIEW: Whenever we want to display record by record in VERTICAL
manner then we can go for Formview.
Details View: Whenever we want to display record by record in HORIZONTAL
manner then we can go for Details view.
AJAX
1) Why Ajax?
A) To avoid full page postback,to implement partial page postback
1. Using AJAX we can develops RICH USER INTERFACES web applications
2. If we want to follow ASYNCHRONOUS REQUEST MODEL, while
developing the web applications we have to use AJAX.
3. To improve the PERFORMANCE of the web application and to reduce the
NETWORK TRAFFIC we can use AJAX.
4. We can avoid SCREEN FLICKER using AJAX.
NOTE: While developing an AJAX web page we can implement only server
centric programming model or client centric programming model or both within
single web page.
ADO.Net
1).What is ADO.Net? Why Ado.net?
A) ADO.NET : 1. It is an integral component in .NET framework, which was
introduced by the Microsoft with .NET Framework 1.0
2. It is a Data Access Object, which allows communication between .NET
application and Databases.
WHY: 1. whenever .NET application wants to communicate Databases it has to
take the help of Ado.Net.
2. Ado.net acts like a mediator between .Net application and Database.
DOA
1. Whenever we doesnt require a
continuous connection with the
Database for accessing the data we can
use DOA.
2. In DOA, SqlDataAdapter will fetch
the data from database and store into
the DATASET in the Client
application.
DATA TABLE
1. Data table represents a single table
i.e it is a collection of rows and
columns.
DATASET
1. It is used in Disconnected Oriented
Architecture.
2. Dataset is a local database which is
central database.
dropdowList1.DataTextField=dr[1];
dropdownList1.DatavalueField=dr[0];
dropdownList1.DataBind();
BUTTON
For DELETE Button
For EDIT Button
For SELECT Button
19) Which data bound control will support to create insert button
by using property?
A). Listview control
20) What is the data provider to communicate sql server data base?
A) Every DataProvider is providing by the Microsoft as a Base class library
(BCL).
To communicate Sql server database we have to import a BCL called Using
System.Data.SqlClient;
HR Questions
1. Why u r looking for change your job?
2. Where are you working now?
3. What is your IT experience?
4. What is your relevant experience?
5. What is your Current CTC Cost to company
6. What is your Expectation?
7. What is your company notice period?
8. What are your roles in your current project?
9. What is your PAN Card Number?
10.What is your Employee Id in your Current Company?
11.What is your official mail id?
12.Is Your notice period is Negotiable?
13.Why youre changing from your current company?
14.Why youre looking for change?
15.Are you a permanent Employee or contract?
16.How do you get your salary?(consolidated checks)
17.Are you willing to relocate?
18.Tell me about your company?
19.Who are the clients to your company?
20.Who is your project leader?
21.What is your expected salary
22.What is reason to leave the current company
23.What is your Notice period
24.What is your strength
25.What is your weakness
26.Where can you see you after 5 years
27.What are your habits
28.What is your appraisal process - Hike
29.Why did you enter this field
30.What have you done 2004 2007
31.Do you have valid passport
32.Do you visit any client place so far?