You are on page 1of 21

What are collection objects in VB.net ?

VB.Net implements a special object called Collection object that acts as a


container for objects of all types. Collection can hold other objects as well as
non object data. A Collection has four methods: - Add: This method adds a
member to collection. Along with data one can also specify a key value by which
the data can be referenced. - Count: This returns the total number of items
in the collection object. - Item: Retrieves an item from the collection. An
item can be retrieved either using the index or a key if specified. -
Remove: Removes an item from the collection. e.g. Dim students As New
Collection students.Add (?john?, ?1?); //The second argument is a key to object
students.Add (?paul?, ?2?);
What is the significance of the ?finalize? method ?
In order to understand the ?finalize? method one needs to understand the
concept of garbage collection. The job of freeing up the memory allocated to
objects is that of a garbage collector. When the garbage collector determines
that an object is no longer referenced it automatically runs a special destructor
function called ?Finalize?. However we have no way to determine when the
garbage collector will call the Finalize method. We can only be sure that it will
be called at some time after the last reference to the object is released. Finalize
is a protected method i.e. it can be called from the class or derived classes
however it cannot be called from outside of the class. If a class has a Finalize
method it should explicitly call the Finalize of its base class as well. Overrides
Protected Sub Finalize () ?Cleanup code goes here
BaseClass.Finalize End Sub
What are assemblies ? How does one use assemblies in a VB.net project ?
Assemblies are used to specify a logical unit or building block for .net
applications. A .net application contains one or more assemblies. Every
assembly has version properties that include a major and a minor version,
revision as well as a build number. Thus all elements of an assembly are
versioned as a unit. The specifications in an assembly are referred as the
assembly?s manifest. To use an assembly in VB.Net project one has to follow
two steps: - Add a reference of the assembly to the project. A default assembly
containing the System namespace is by default added to the project. Access the
members or members of the namespace in the assembly using the fully
qualified class name.
How does the ?Err? object look like ?
Error handling that evolve around the various On Error.. statements are referred
to as unstructured error handling. The build in object Err is used in this type of
error handling. This object has several properties and methods as listed
below: Properties: Description: a short description of the error HelpContext:
context ID for the help topic associated with the error HelpFile: fully qualified
file name if any Number: Number associated with the error Source: a string that
specifies the object that generated the error. Method: Clear: Clears the set
values of all properties of the error object. Raise: Generates a runtime error and
sets the properties of the Err object to the values supplied in the method call
Have you worked with ADO.net? Can you explain to me in brief ?
Yes I have certainly worked on ADO.Net. ADO.net encompasses two groups of
classes: content components and managed provider components. The content
components include DataSet class and other supporting classes as DataTable,
DataRow, DataColumn and DataRelation. The DataSet class is a lightweight
cache of a particular database from the data store. It allows reading and
writing of data and schema in XML. ADO.Net involves disconnected datasets
because it is geared towards a distributed architecture. All tables and relations
in a DataSet are exposed through the DataSet tables and Relations properties.
E.g. Using System; Using System.Data; DataSet ds = new DataSet(?MyDS?);
Ds.Tables.Add (?Order?); Ds.Tables[?Order?].Columns.Add(?OrderNo?
Type.GetType(?System.Int32?)); The DataSet tightly integrates with XML using
the methods WriteXml, ReadXml, WriteXmlSchema and ReadXmlSchema
What is the use of namespaces? Can you give me an example ?
The concept of namespaces plays a very crucial role in .net framework. It is a
concept parallel to the concept of packages in java. In general, a namespace is
a logical grouping of types for the purpose of identification. e.g. let?s say in an
organization there are three people with name Paul Smith each individual in a
different role and responsibilities. To resolve this ambiguity we can define three
namespaces based on their roles as Secretary, Manager and Operator and then
reference each Paul as Secretary.Paul and Manager.Paul and Operator.Paul. This
is the concept of namespace.

VB .Net Interview Questions


1) Explain about visual basic?
Visual basic is associated with the IDE of Microsoft. It is basically useful to implement
RAD of GUI. Creation of Active X scripts are very easy and efficient through VB.
Windows API can also be used to create application on windows desktop and its
applications. This was primarily designed to create applications for windows platform.

2) Explain about .NET?


.NET is a Microsoft Framework and a software component. .NET has a large library of
pre-coded solutions which provided developer significant help in developing
applications with solutions already present. It offers reliable security and cross
platform compatibility.

3) Name some of the features present in VB 2005?


Some of the features present in VB 2005 are as follows: -
• Edit and continue: - It allows developers to modify and execute applications almost
simultaneously.
• Namespace: - This provides access to various parts of the .NET framework and it
also dynamically generates classes.
• Data source binding function is very useful for client server development.

4) Explain and brief about rapid application development tool?


Rapid action development tool describes about the software development process.
This tool gives flexibility in iterative development and prototype deployment. It
enhances the speed of application development. It is also used for application
maintenance.

5) Describe about Visual basic.NET?


This is used in conjunction with Microsoft .NET platform and is a successor to visual
basic sixth version. Visual basic is used in conjunction with.NET Framework. This tool
has a serious defect it is not compatible with Microsoft visual basic sixth version. It
has a huge library which assists programmers.

6) What are the various open source tool available for VB.NET?
When compared with the rapid development of open source tools for other languages
from Microsoft (C#, etc) we can say that development of tools for VB has been slow.
Mono development platform is one which is implementing VB libraries and is working
on a compiler.
7) Explain about the performance of Visual basic?
Visual basic 5 and 6 are efficient in coding the code to native or P-code depending
upon the programmer. Portability is a major addition to the performance of VB.NET
and the code is also small. Additional layer is provided which interprets the code and
this can be avoided by using special algorithms and native code programming.

8) Compare C# and Visual basic.NET?


.NET Frame work includes two languages which are language to IL compilers and in
this C# and VB.NET are provided. The importance and flexibility of these as better
programming languages is still questionable. Visual basic has been updated and
revised to make it object oriented whereas C# has concepts from many languages
such as Delphi, Java, etc and syntax from C and Java.

9) Explain about Visual basic.NET culture?


VB was always a RAD tool and it was always user friendly for any type of user
whether professional or not. It also provided many users with shortcuts and features
which made this language popular among many users. It had its share of debugging
and maintenance issues of course.

10) Name and explain some of the exclusive features which are present in VB?
Some of the features which are exclusive to VB are as follows: -
1) Name space can be hidden which can be disabled.
2) Certain project files can be hidden and a user can show them if he intends to do.
3) Lots and lots of shortcuts are present which ease the development of programs.
4) Using the AddressOf myObject function a delegate can be made.

11) Name a feature which is common to all .NET languages?


There is only one feature which is common to all languages and that is Garbage
collection or GC. This feature is automated which relieves developers of much work.
This garbage is disposed only when there is need of memory or stress for memory.
GC feature halts the application for few seconds before restarting it.

12) Name some of the features of C# which are not present in VB.NET?
Some of the features which are not present in VB are as follows they are: -
1) It supports unsafe code blocks for improved performance.
2) Partial interfaces and anonymous methods.
3) Multi line comments and static classes. Etc

13) Explain about the keyword Must Inherit?


This keyword prevents a class from directly instantiated. This keyword forces users
to create references to only derived classes. This keyword is present in C# as
abstract and it is very useful in creating applications.

14) What would you do to remove Microsoft visual basic name space?
.NET has many new features and application supportive tools. To remove Microsoft
visual basic name space all you have to do is to
1) Remove the import manually every time you start the project.
2) Creating a template which does not contain Microsoft Visual Basic namespace.
3) About new features and changes names you can refer to MSDN.

15) Which is the tool which can convert Visual basic old version to .NET compatibility
version?
There is a tool available which can convert old visual basic functions into new .NET
code. Artin soft Visual basic upgrade Companion is very useful in converting VB code
into .NET code. This tool was developed by Artin. This tool is integrated in Visual
studio.NET 2005. It handles programs such as structured handling, error handling,
etc.

16) Explain about the feature Anonymous type?


Anonymous type is a feature of VB.NET and it allows data types to be created from
the code which requires it. This feature is present in VB as well as C#. They should
be stored in variables declared with the keyword VAR. Dynamic typing is different
and shouldn’t be confused with Anonymous type.

17) Explain about the Ruby interface generator?


Ruby interface generator is primarily responsible for providing the visual part of the
Visual basic and this was clubbed with “EB” designed for Omega database system.
VBX interface was added to this feature which had the ability to load dynamic link
libraries.

1) Explain about visual basic?


Ans:Visual basic is associated with the IDE of Microsoft. It is basically useful to
implement RAD of GUI. Creation of Active X scripts are very easy and efficient
through VB. Windows API can also be used to create application on windows desktop
and its applications. This was primarily designed to create applications for windows
platform.
2) Explain about .NET?

Ans: .NET is a Microsoft Framework and a software component. .NET has a large
library of pre-coded solutions which provided developer significant help in
developingapplications with solutions already present. It offers reliable security and
cross platform compatibility.

3) Name some of the features present in VB 2005?


Ans:Some of the features present in VB 2005 are as follows: -
• Edit and continue: – It allows developers to modify and execute applications almost
simultaneously.
• Namespace: – This provides access to various parts of the .NET framework and it
also dynamically generates classes.
• Data source binding function is very useful for client server development.

4) Explain and brief about rapid application development tool?


Ans:Rapid action development tool describes about the software development
process. This tool gives flexibility in iterative development and prototype
deployment. It enhances the speed of application development. It is also used for
application maintenance.

5) Describe about Visual basic.NET?


Ans:This is used in conjunction with Microsoft .NET platform and is a successor to
visual basic sixth version. Visual basic is used in conjunction with.NET Framework.
This tool has a serious defect it is not compatible with Microsoft visual basic sixth
version. It has a huge library which assists programmers.

6) What are the various open source tool available for VB.NET?
Ans:When compared with the rapid development of open source tools for other
languages from Microsoft (C#, etc) we can say that development of tools for VB has
been slow. Mono development platform is one which is implementing VB libraries and
is working on a compiler.

7) Explain about the performance of Visual basic?


Ans:Visual basic 5 and 6 are efficient in coding the code to native or P-code
depending upon the programmer. Portability is a major addition to the performance
of VB.NET and the code is also small. Additional layer is provided which interprets the
code and this can be avoided by using special algorithms and native code
programming.

Compare C# and Visual basic.NET?


Ans: .NET Frame work includes two languages which are language to IL compilers
and in this C# and VB.NET are provided. The importance and flexibility of these as
better programming languages is still questionable.Visual basic has been updated
and revised to make it object oriented whereas C# has concepts from many
languages such as Delphi, Java, etc and syntax from C and Java.

9) Explain about Visual basic.NET culture?


Ans:VB was always a RAD tool and it was always user friendly for any type of user
whether professional or not. It also provided many users with shortcuts and features
which made this language popular among many users. It had its share of debugging
and maintenance issues of course.

10) Name and explain some of the exclusive features which are present
inVB?
Ans:Some of the features which are exclusive to VB are as follows: -
1) Name space can be hidden which can be disabled.
2) Certain project files can be hidden and a user can show them if he intends to do.
3) Lots and lots of shortcuts are present which ease the development of programs.
4) Using the AddressOf myObject function a delegate can be made.

11) Name a feature which is common to all .NET languages?


Ans:There is only one feature which is common to all languages and that is Garbage
collection or GC. This feature is automated which relieves developers of much work.
This garbage is disposed only when there is need of memory or stress for memory.
GC feature halts the application for few seconds before restarting it.
12) Name some of the features of C# which are not present in VB.NET?
Ans:Some of the features which are not present in VB are as follows they are: -
1) It supports unsafe code blocks for improved performance.
2) Partial interfaces and anonymous methods.
3) Multi line comments and static classes. Etc

13) Explain about the keyword Must Inherit?


Ans:This keyword prevents a class from directly instantiated. This keyword forces
users to create references to only derived classes. This keyword is present in C# as
abstract and it is very useful in creatingapplications.

14) What would you do to remove Microsoft visual basic name space?
Ans: .NET has many new features and application supportive tools. To remove
Microsoft visual basic name space all you have to do is to
1) Remove the import manually every time you start the project.
2) Creating a template which does not contain Microsoft Visual Basic namespace.
3) About new features and changes names you can refer to MSDN.

15) Which is the tool which can convert Visual basic old version to .NET
compatibility version?
Ans:There is a tool available which can convert old visual basic functions into new
.NET code. Artin soft Visual basic upgrade Companion is very useful in converting VB
code into .NET code. This tool was developed by Artin. This tool is integrated in Visual
studio.NET 2005. It handles programs such as structured handling, error handling,
etc.

16) Explain about the feature Anonymous type?


Ans:Anonymous type is a feature of VB.NET and it allows data types to be created
from the code which requires it. This feature is present in VB as well as C#. They
should be stored in variables declared with the keyword VAR. Dynamic typing is
different and shouldn’t be confused with Anonymous type.

17) Explain about the Ruby interface generator?


Ans:Ruby interface generator is primarily responsible for providing the visual part of
the Visual basic and this was clubbed with “EB” designed for Omega database
system. VBX interface was added to this feature which had the ability to load
dynamic link libraries.

How would you implement inheritance using VB.NET ?…


How many levels of compilation happens in .NET Framework

Ans:two

Every type supported by CTS is derived from:


System .Object
Which of the following Types will have data of fixed size:
Value Type
What is the significance of Option Explicit statement when it is set to On:
Specifies that any variable name is declared (with type) before use
The methods which return the values back to the calling code are called as:
Interrogative methods
How do you terminate code execute with in a VB.NET method:
Exit Sub
How do you create a Read only Property in VB.NET
Using Only Get..EndGet with in property definition
Which interface allows to implement the Dispose method to do cleanup work:
Icleanup
How do you call non shared methods of a class:
Invoking the method through the instance of that class
How do we implement private interfaces:
Private interfaces can not be implemented
Where do you find COMException class
System.Runtime.Interopservices
Which method of the XMLdocument class takes xml as string while loading
How do you refer the current class in VB.Net
Me
How you refer the parent class in VB.Net
Mybase
what is the difference between master forms and transaction forms

What is the size of .NET object?


Default size when a class gets loaded in memory is 8 bytes.
What is the difference between DataTable and DataSet?
Data set can store many tables but a data table can have one table only.
What are the difference between dispose(), close(), exit(), end()? When do
we use them?
dispose(): should release all the resources that it owns.
close():closing the application
exit():Exiting from the loop
end():stops the execution of the page/function/procedure
What is the exact defination of "Object"?
A real world entity which has some specific attributes related to its characteristics
and operations or methods associated with its attributes.
What is Late Binding and Early Binding?
Late Binding: runtime binding
Early Binding: compile time binding as compilation is done before executing an
application so it is called early binding.
What is the advantage of option strict on?
Visual Basic allows conversions of many data types to other data types. Data loss can
occur when the value of one data type is converted to a data type with less precision
or smaller capacity. A run-time error occurs if such a narrowing
conversion fails. Option Strict ensures compile-time notification of these narrowing
conversions so they can be avoided.
In addition to disallowing implicit narrowing conversions, Option Strict generates an
error for late binding. An object is late bound when it is assigned to a variable that
is declared to be of type Object.
Because Option Strict On provides strong typing, prevents unintended type
conversions with data loss, disallows late binding, and improves performance, its use
is strongly recommended.
What you can't do with Option Strict On, is accessing members of objects that are
not declared as a specific object type. You must have a typed reference.
What is the base class of .Net?
System.Object is the base class of .NET
It Supports all classes in the .NET Framework class hierarchy and provides low-level
services to derived classes. This is the ultimate superclass of all classes in the .NET
Framework; it is the root of the type hierarchy.
What is the difference between .dll extension and .exe extension files?
The main difference between .dll and .exe is
.dll is the In process component where it take up the client's memory space to run.
So the communication between the application and component(dll) is very fast.
.EXE is the Out of process component. It uses its own memory(not application
memory) to run the component. The communication between the application and
component is slow when compared to .dl
In vb.net how to connect crystal report?
Click on solution explorer window right click and add to add new item. The window
will be displaced select
the crystal reports we have save in any name but extension is used .rpt eg:sss.rpt

how to restore database using vb.net?


What is versioning in .NET? Explain its importance
Where is the version information stored on an assembly?
How do we get version information from the AssemblyInfo file?
Can you write the namespace to load assemblies at runtime?
Is it possible to allow a class to be inherited but prevent the method from being
overridden? If yes, explain it
What happens in memory when you box and unbox a value type?
Differentiate between a panel and GroupBox.
Where would you use abstract class and interface?
Show in code to insert a TextBox value into Sql database using VB.NET coding.
Differentiate between windows and console application?
How does garbage collector work?
Explain how to connect crystal report using vb.net
What is JIT (Just in time) and how it works?
What are the types of threading models in VB.NET? Explain them
What is an indexed property? Explain it with a code sample
What is the difference between Dataset and Recordset?
Difference between a readonly variable and a constant variable
How do we read and write data to an XML file?
Explain how to get the environment information in VB.NET.
Difference between Array and array list
How to store and retrieve images in SQL server database through VB.NET?
What is the difference between string and stringbuilder?
Difference between .dll extension and .exe extension files
What are jagged arrays?
Difference between Web.Config and Machine.Config
Explain how to send xml file on server using HTTP protocol.
Explain Anonymous type and its features.
How do we write data to a text file in VB.NET?.

Steps to add a control to a form at run time.

a. create and initialize a control.


b. provide an id to the control.
c. add the control to the page's control collection.

eg:

Dim abc as new Textbox


abcd.id="txtBox1"
me.controls.add abc

Explain how to retrieve information from the configuration file at run time.

Add name space using system.configuration.


Dim val=ConfigurationManager["key"].ToString()

How do you install assembly to the Global Assembly Cache?

There are many ways:


a. Using Gacutil.exe:eg: gacutil -i MyLibrary.dll
b. Using Microsoft Windows installer 2.0.
c. Using Assembly Cache Viewer (Shfusion.dll)
d. Using the .NET Framework Configuration Tool (Mscorcfg.msc)

Explain Form level validation and Field level Validation

Form level validation occurs once the user is ready to submit the form. The
application checks the complete form at once and validates all the fields in it and
informs the user about it. Field level validation occurs only for a specific field. E.g.: As
soon as the user looses focus from a name input box, the application validates the
data in that particular field and informs the user about it. They are normally used for
mandatory fields using javascript.

How do we add a Table in a Dataset?


Using ds.Tables.Add() method.

12) How to create relationship between two tables within a Dataset?


Using ds.Relations.Add("Master_Details",dt1.Columns["dt1col1"],
dt2.Columns["dt2col1"]);

13) What is the difference between Server.Transfer and Response.Redirect?


a) Server.Transfer can be used only to transfer within the pages of the same web
applications, but we can use Response.Redirect to move to any page available over
the Internet.
b) Response.Redirect sends message to the browser saying it to move to some
different page, while Server.Transfer does not send any message to the browser but
rather redirects the user directly from the server itself.
c) With Server.Transfer you can preserve your information using preserveForm
property. Response.Redirect lose access to all of the properties in the Request
object.
d) Response.Redirect requires a round trip. Where as, Server.Transfer does not
requires a round trip.

14) Why JavaScript is preferred over VBScript?


Because JavaScript is supported by all Browsers. Where as, some browsers does not
support VBScript.
15) How can we refer to an element in JavaScript?
Using document.getElementById('id') method of JavaScript.
16) What is Cookies?
Cookies are small amount of data stored either in a text file on the client's file
system or in memory in the client browser session. Cookies contain data that allows
a web server to identify users based on their visiting history. Cookies are designed so
that only the site that created them can read them.
17) What is ArrayList?
ArrayList is a simple resizeable, index-based collection of objects.
18) What is HashTable?
A HashTable is a collection of name/value pairs of objects that allows retrieval by name.

19) How do you handle exception in .Net?

Using Try Catch block.

20) Can there be multiple try blocks in a code?

Yes.

What technologies you worked for?


Answer. C#, VB, Oracle , SQL Server , ASP.NET, JavaScript

Question 2. Lets start with C#, What is modularization?


Answer. Modularization is dividing functionality into different small modules, so that we can reuse the
functionality and make it simple to use.

Question 2. Any other use of modularization and Layered application?


Answer. We can add layer to keep different group of functionalities different. and changing one layer
does not effect others.

Question 3. Where does the object and its internal variable int i and string s store, in heap or in
stack.
Answer. i think int goes to stack
Question 4. What is garbage collector?
Answer. it used to release the memory. and run in non deterministic manner.

Question 5. Can we run Garbage collector manually and its recommended?


Answer. Yes we can by gc.collect(), it is not recommended.

Question 6. What is overloading and overriding?


Answer. overriding is having same method in base and drive class and deciding at runtime which one
to call.

Question 7. What is difference between the runtime polymorphism and overriding.


Answer. both are same.

Question 2. Difference between string builder and string?


Answer. string builder is mutable and string immutable.

Question 2. can we pass object with ref parameter like fun(ref Obj)?
Answer.yes

Question 2. what is difference between fun(obj) and fun(ref obj)?


Answer. by passing obj we are directly passing object while using ref it passes the address of object.

Question 2. if we have two function abc(int a, int b) and abc(int a, int b, int c) in base class and we
derive it in drive class and implement it. in drive class it is overloading or overriding?
Answer. both overloading and overriding.

Question 2. can we have multiple try blocks, can we have multiple catch blocks, can we have multiple
finally blocks?
Answer. multiple try yes separate blocks, multiple catch -yes, multiple finally - no

Question 2. What is cluster index and noncluster index ?


Answer. cluster index is physical sorting on table while non cluster index is logical sorting on table.

Question 2. we have a query,


select a, b from table1
where a=a1 and b=b1 and c= c1

on what column will you define the index?


Answer. a, b

Question 2. we have a table empl


emp_id, salary, division

get the employee list whose salary is greater than the average salaryof their division?

Answer.

Question 2. there is two tables


emp_id, salary, division_id - emp table
division_id , div_name - div table
get the maximum salary if every division?
Answer.
Question 2. What patterns you used in C# code?
Answer. Singleton, facade
Question 2. Write a code to implement a singleton pattern?
Answer.
Question 2. write a code to check balance brackets in a string? ((()))
Lets start with .NET, What is .NET framework?
Answer. Its a platform to run .NET application, where .net applications can use .net resources.

Question. What is DLL?


Answer. Dynamic link libraries, kind of exe file.

Question. What is manifest?


Answer. Contains Details about assembly. like reference, versions, resources and type.

Question. What types of assemblies are there and what is difference?


Answer. Private and public
private is private to application and kept in local application folder
public assemblies are shared among the applications and kept in GAC.

Question. Suppose there is two versions of a assembly, how your application will decide which
version to use?
Answer. In web.config under binding give old version and new version

Q. Any other way to do versioning in GAC?


Answer. Find it out.

Q. What is strong type and loose type ?


Answer. its a language property. The language who provide variable data type declaration called
loose type like vb and JavaScript provide var type variable declaration while C# not. so C# is strong
type language.

What collection type you used?


Answer. ArrayList

Question. What is difference between arraylist and array?


Answer. Array can store single data type and inserting will cost more, while in array list you can
store multiple datatypes and inserting and removing element is easy.

Question. What are delegates?


Answer. it is function to pointer.

Question. What are events?


Answer. events are used with delegate to fire a method on any event occurrence?

Question. What is use of delegate?


Answer. Used of delegate to call a function.

Question. any other use of delegate?


Answer. Find out.

Question. What is difference between list and arraylist.


Answer. list is interface while arraylist is implementation.

Question. What is dataset?


Answer. can contains tables and their relations.

Question. What is datareader?


Answer. Read one row at a time , forward only.

Question. How will you fill dropdown values using datareader?


Answer.
While(datareader.read())
{
bind every value to dropdown
}

or construct a dataset from datareader inside loop and assign to dropdown

Question. What is abstraction?


Answer. Representing complex word in simplified manner.

Question. what is OOPs ?


Answer. programming language fully supported by objects

Question. What is Objects?


Answer. by using Objects we can represent real word easily.

Question. what are the features of objects oriented programming?


encapsulation
overloading
overriding
abstraction
association
generalization
inheritance
data hiding

Question. Have you worked on multithreaded application?


Answer. yes

Question. Describe the multithreaded application ?


Answer. Describe a demo multithread application and why using multithreading.

Question. What is Strongly typed dataset?


Answer. Strongly typed dataset is simple dataset containing the property to have datatype
associated with columns and can access column values by using the column names.

Question. What is Deep copy and shallow copy?


Answer. Deep copy, copy the whole object and make a different object, it means it do not refer to
the original object while in case of shallow copy the target object always refer to the original object
and changes in target object also make changes in original object.

Question. how to Create custom collection?


Answer. using System.Collections namespace we can create the our custom collection classes.

Question. how to Bind grid with business obj?


Answer. return the dataset or datatable from business object and assign to datasource of grid.

Question. What is Singleton and how to implement locking in singleton pattern?


Answer. Singleton pattern usage a class which can contain only one object through out the
application.

class my_Singleton
{
private static my_Singleton obj;
protected my_Singleton
{
}
public static my_Singleton Instance()
{
lock{
if (obj == null)
{
obj= new my_Singleton();
}
}
return obj;
}
}

Question. What is Typed dataset?


Answer. typed dataset is a normal dataset having property to data type check for Colum values and
can access the columns by column names.

Question. What is Using keyword?


Answer. using keyword can be used in two format
1. include the namespace in file
2. handle the idisposable objects inside using block.

iFace obj = new myclass()

Myclass obj1 = new myclass()

Obj.hey();
Obj1.hey();

is the above code is valid?


yes

Question. What is difference between lock vs static locks?


Answer. static lock is applicable to static methods and variables.

Question. What is suppressfinalize?


Answer. We use this method to not to call the finalize method while disposing the objects.

Question. Can we inherit a class from multiple interfaces?


Answer. yes

Question. suppose two interfaces have same method, so how will you implement these methods in
derive class?
Answer. by using interface name

Question. Lets start with .NET, What is CLR and what is the task perform by CLR?
Answer. CLR stand for Common language runtime. it have the task like
1. running the garbage collector
2. Code verification
3. code access security
4. executing IL

Question. What is assembly? and what is difference between the .dll and .exe?
Answer. Assembly is a basic unit of .net program and it contains the all .net code, resources,
references and versions etc.
.exe and .dll are same while .exe contains executable code and is machine dependent.

Question. if dll and exe files are same it means you can deploy both the files in GAC?
Answer. No, deploying a exe file does not mean anything because classes and method are exposed
in dll only and exe file is pure executable, any application can not call the function of exe file.
Question. How will you deploy the dll file in GAC?
Answer. first create the strong name for dll and add this sn name key into the application then use
gacutil command to register the dll in GAC.

Question. How will you search for a dll in GAC before registering it?
Answer. use process explorer to check the dlls, if you have any other suggestion, Please comment.

Question. What is difference between IL and DLL ?


Answer. DLL contains the IL and other details (metadata) inside.

Question. is exe is machine dependent?


Answer. yes

Question. How to pass the arguments in thread?


by passing the arguments in start() method.

Answer. thread t1 = new thread(new threadstart(obj.abc));


t1.start(21);

Question. What changes will you do if you have to pass string instead of int in thread arguments?

Answer. no chnages in thread while we change the method to receive the string or abject variable.

Question. What are the properties of abstract class?


Answer. 1. abstract class can contain the prototype of method and/or implementation of methods.
2. Direct object of abstract class is not possible.
3. we need to inherit a class and make the object of derive class and can access the abstract class
methods.
4. abstract classes can contains the abstract functions.

Question. can we have this definition in abstract class?

abstract class abc


{
abc obj;

Answer. yes, we can have same type of obj we can define in and instantiate to derive class.

Question. What pattern you used?


Singleton and facade

Question. describe the facade pattern and use in you project?


Answer. it is used to access the whole subsystem through a system. i used it in a customer class to
access the subsystem like sales, billing, invoice etc.

Question. What is singleton pattern?


Answer. creating only one object of a class.

Question. How will you handle deadlock in singleton pattern?


Answer. use lock or monitor to access by single thread.

Question. What is difference between monitor.enter and monitor.tryenter functions?


Answer. monitor.enter waits for the lock until it does not get it.
while monitor.tryenter will request for lock and it return true if get the lock and return false if does
not get it and process further statements.

Question. instead of creating a singleton class, suppose i create a static object of singleton class
outside the class and use it though out the application, then what is use of singleton class?

Answer. singleton class is use that accidently programmer do not create the another object of the
class. it is used in large systems where we expose class and functions though dlls and want to restrict
programmer while using this dll do not creating multiple objects.

Question. Why forcing garbage collector to run is not recommended?


Answer. because it sometimes create performance issue and block other threads.

Question. what is OOPs?

Answer. Object oriented programming, represent every thing in a object.

Question. What is polymorphism? what are different types of polymorphism is there?

Answer. polymorphism means different forms, there are two kind of polymorphism

1. static polymorphism (overloading)

2. dynamic polymorphism (overriding)

Question. What is difference between overloading and overriding?

Answer. having same name methods with different parameters is called overloading, while having
same name and parameter functions in base and drive class called overriding.

Question. what is static class and what is use of this?

Answer. Static class we define when we do not want to create a object of class, all methods of static
class should be static. static class methods and data are specific to class only and not associated to
objects.

Question. Can we have a variables inside the interface?

Answer. no, we can have only methods, properties, indexers and enums inside the interface.

Question. Have you used AJAX?

Answer. I have used AJAX using microsoft ajax toolkit.

Question. What is your role in PL/SQL?

Answer. I used to design and write functions, triggers, procedures and packages.

Question. Have you used Queue in Oracle?

Answer. No

Question. What design patterns you used?

Answer. Facade, Prototype, Singleton. proxy , bridge


Question 1. What is class and objects?

Answer. Class is collection of functions and variables. and object is used to use this template.

Question 2. Can we declare a constructor to private?

Answer. Yes

Question 3. What is the use of constructor ?

Answer. constructor is used to create and instantiate a object.

Question 4. can we specify the accessibility modifier inside the interface?

Answer. It should be public there is no use of private methods in interface.

Question 5. how to prevent a public class method to be overridden in drive class?

Answer. just make method to sealed.

Question 6. how to stop a class being inherited by another class?

Answer. just make the class sealed. by using sealed keyword.

Question 7.how to prevent a class being instantiated?

Answer. make class abstract or static

Question 8. How to override a private virtual method?

Answer.you can not override a private method.

Question 9. can you derive a static method of base class in child class?

Answer. no

Question 10. can you override a normal public method of base class and make it static?

Answer.no , the method signature should be same to be overridden.

Question 11. what is early and late binding?

Answer. when we call a non virtual method it decide at compile time and this is called early binding.
while if method calling decide at runtime is called late binding.

Question 12. Can namespace contain the private class?

Answer. no, having a single private class does not mean anything , it is applicable only in case of
nested class.

Lets start with ASP.NET, I have a datagrid/Gridview can i have a dropdown inside a column and
binding to different dataset? How

Answer. Yes, keep dropdown in template column

Question 3. How will you fill a dropdown from another dataset and grid from another dataset.
Answer. First fill the grid with dataset and then datagrid.columns.findcontrol[“dropdown”] find
dropdown and add another dataset to it.

Question 4. How will you add increasing number (index numbers of rows) in datagrid without
bringing it from database.

Answer. one method is to add on rowdatabound. find another

Question 5. Suppose there is two button in a datagrid column. how will you identify which button is
clicked?

Answer. by using commadname and commandargument.

Question 6. what is difference between unique key and primary key?

Answer. primary key can create cluster index on it. while on unique key we can create non cluster
index.

unique key can have null value

primary key is only one in table while unique key can be many.

Question 7. how many nulls unique key can have?

Answer. only one

Question 8. can we define unique key on combination of keys?

Answer. yes

hat would you do to remove Microsoft visual basic name space?

.NET has many new features and application supportive tools. To remove Microsoft visual basic name spa
1) Remove the import manually every time you start the project.
2) Creating a template which does not contain Microsoft Visual Basic namespace.
3) About new features and changes names you can refer to MSDN.

Name some of the features of C# which are not present in VB.NET?

Some of the features which are not present in VB are as follows they are: -
1) It supports unsafe code blocks for improved performance.
2) Partial interfaces and anonymous methods.
3) Multi line comments and static classes. Etc

Name a feature which is common to all .NET languages?

There is only one feature which is common to all languages and that is Garbage collection or GC. This fea
developers of much work. This garbage is disposed only when there is need of memory or stress for mem
application for few seconds before restarting it.

Name and explain some of the exclusive features which are present in VB?

Some of the features which are exclusive to VB are as follows: -


1) Name space can be hidden which can be disabled.
2) Certain project files can be hidden and a user can show them if he intends to do.
3) Lots and lots of shortcuts are present which ease the development of programs.
4) Using the AddressOf myObject function a delegate can be made.

Explain about Visual basic.NET culture?

VB was always a RAD tool and it was always user friendly for any type of user whether professional or not
with shortcuts and features which made this language popular among many users. It had its share of debu
of course.

1. What is oops?
2. what is object?
3. what is class?
4. what is data grid?
5. difference between overloading and overriding?
6. Difference between load(int a) and load(uint a)
7. is above are overloaded? and will it give run time error.
8. int load() and string load() is overloaded?
A. no
9. how to call a client side JavaScript method from a asp button and then server
side method on user response?
10. how Ajax works?
11. suppose we want to render only a part of page every time?
12. how to implement paging?
13. what is sql cache dependency?
14. polymorphism?
15. base class and child class execution?
16. response.redirect and server.transfer?
17. server.transfer and server.execute
18. abstract class and interface?
19. difference between datagrid and grid view?
20. what is event bubbling?
21. index, types of indexes?
22. how to optimize query?
23. udf and procedure?
24. types of triggers?
25. what is benefits of packages?
26. what is page in SQL?
27. how to handle exception in oracle?
28. full form of AJAX ? what is XML in this?
29. what are endpoints?
30. what is address and binding and contracts?
31. serialization?
32. session management techniques?
33. in state server do we use serialization?
34. what is late binding?
35. what is parent class of all WebPages?

You might also like