VB.Net Interview Questions and Answers

By | November 7, 2015

Here are 45+ frequently asked VB.Net interview questions and answers which will definitely help you out to crack one of the toughest interviews.

1. What is .NET Framework?

It is a platform independent and language independent developed by Microsoft. It allows you to use multiple programming languages such as VB.NET , C#, VBScript, Jscript, and managed C++ Codes on multiple platforms such as LINUX, Mac OS, Windows, UNIX. It provides the user with various libraries that helps the development of applications faster, cheaper and easier.

2. What is CTS?

CTS represents Common Type System. It is a subset of Common Language Specification. In order to keep consistency, Microsoft has specified a Common Tpe System to which every language must follow so as to keep equality and relativity within multiple languages within the same .NET program.

Vb.Net Interview Questions and Answers

3. What is a Constructor in VB.NET?

A Constructor is a special member function or a method whose task is to initialize objects of its class. Its name is the same as its class name. It is called as constructor because it constructs the values of data members of the class. The constructor is invoked whenever an object of its associated class is created.

4. Explain Public Access Modifier in VB.NET.

The Public keyword in the declaration statement specifies that the element can be accessed from code anywhere in the same project from other projects that reference the project and from any assembly built from the project.


Public Class demoPublicClass

However, a Public Class can be used only at module, interface or namespace level.

5. Enlist Controls in Windows Forms to Select Data from a list of VB.NET.

The Windows Forms Controls to Select Data from a List are as follows:
1. CheckedListBox
2. ComboBox
3. DomainUpDown
4. List Box
5. List View

6. What is the Default Size of Integer DataType in VB.NET?

The Default Size of Integer DataType is 32 Bits in VB.NET.

7. Example of Hello World Program in VB.NET.

Module HelloWorld
Sub Main()
Console.WriteLine(“Hello World”)
End Sub
End Module

8. What is CLS?

CLS represents Common Language Specification. It is basically a subset of the entire set of features supported by the CLR.

9. What is Object Oriented Programming Approach?

Object Oriented Programming provides a way of modularizing programs by creating partitioned memory area for functions as well as data that can be used as templates for creating copies of such modules on demand. OOP allows decomposition of a problem into a numerous entities called Objects. It then builds data and functions around these objects.

10. What is Garbage Collection?

Garbage Collection is primarily used for Memory Management. The .NET Framework’s Garbage Collection manages the allocation and release of the memory to your applications. The garbage collector checks for objects in the managed heap that are no longer being used by the applications when it performs garbage collection.

11. Explain Protected Friend Access Modifier in VB.NET.

The Protected and Friend keywords together in the declaration statement specify that the elements within the same assembly or both.


Protected Friend demoString As String

It can be used only at class level but not at level of Source File or Namespace or inside an Interface, Module, Structure or Procedure.

12. What are Shared Assemblies?

When private assembly is installed in Global Assembly Cache, it is called as Shared Assembly. It does not create any physical copy and when the Assembly is installed in GAC, it can be referred to any .NET application.

13. Enlist some features of C# not present in VB.NET.

Some of the features which are not present in VB but present in C# are as follows they are:
1. C# supports unsafe code blocks for improved performance.
2. C# also supports Multi Line comments and static classes
3. Anonymous methods and Partial interfaces

14. What is a Framework?

A Framework is a layered structure that indicates the type of programs that can or should be built and how they would inter-relate.Some fameworks also includes actual programs, specify computer programming interfaces, and also offer programming tools for using the frameworks. It is basically a conceptual structure or a scheme with an intension to support the development of something that expands the structure into something useful.

15. What is an Object?

Objects are basic Run-Time entities in an Object oriented system. They may represent a place, a bank account or a person. Objects are essentially the variables that are of Class types.

16. What is MSIL?

MSIL represents Microsoft Intermediate Language. It is similar to the Java Byte Code. Its main motive is to form a platform independent code. Before executing a code, MSIL must be converted to a CPU-specific code by Just in Time Compiler.

17. What are Datasets?

Datasets are objects that contain data tables where you can temporarily store the data for use in application. If your application requires working with data, you can load data into a dataset. You can also execute or modify data in the dataset even when its offline.

18. What is Assembly Manifest?

Every Assembly contains an Assembly Manifest. It consists of the following:
1. The Assembly’s Identity (Name and Version)
2. File Table describing all other files that make up the assembly.
3. Assembly Reference List that contains information about External Dependencies.
4. Global Objects

19. Explain .NET compilation process.

1. Compilation of source code to managed code / Intermediate Language (IL).
2. Compilation of IL to platform-specific code by the CLR.
3. MSIL defines a set of portable instructions which are independent of any specific CPU.

20. Enlist the Garbage Collection Methods in .NET Framework.

The .NET Framework garbage collection methods are as follows:
1. Dispose
2. Finalize

21. What is a Message Box in VB.NET?

A message box is a dialog box that displays application-related information to the user. Message boxes are also used to request information from the user.

22. What is a Class?

An entire set of data and code of an object can be made user-defined data type using a class. Objects are variables of Class type. After defining a Class, we can create numerous Objects of its type. A Class is a collection of Objects of similar type.

23. Explain Assembly Types.

All Assemblies and type libraries must be registered in the Windows registry as COM Clients and they can use the managed types. Assembly are primarily of the following types:
1. Shared Assemblies
2. Private Assemblies

24. What is New Keyword used for?
A New keyword is used to declare or initialize a New Object. It is used to set a variable with reference to a datatype. The New keyword is used to initialize an object variable.

dim object1 as New SqlDataAdapter.

25. What is CLR?

CLR represents Common Language Runtime. It is one of the most important component of the .NET Framework. It manages and executes the code written in .NET architecture and similar to Java Virtual Machine. The software version of .NET is actually a CLR version.

26. What are Assemblies?

Assemblies are the building blocks of .NET Framework applications. It creates a fundamental unit of deployment, version control, reusage, activation scoping and security permissions. It is a combination of Types and Resources built to work together and form a logical unit of functionality.

27. How do you define a Class in VB.NET?


Class Demo
Public Name as String
End Class

28. Enlist Types of Data Validations.

1. Code Checking
2. Data Type Validation
3. Complex Validation
4. Range Checking

29. What are Private Assemblies?

Assemblies are Private by default. When you use it in any of the .NET applications, a physical copy of it gets created. The program will generate an error when you try to change the Output File Location. To overcome this issue, we use Shared Assembly in Global Assembly Cache.

30. What is the difference between Functions and Sub-Routines?

Functions in VB.NET can send information back to where it had been called from. Also known as Function Return method compared to C++ or Java. The only difference with Sub-Routines is that they cannot Return Values.

31. What is Global Assembly Cache?

Every computer where the common language runtime executes has a machine-wide code cache called as Global Cache. It stores assemblies specifically required to be shared by multiple applications on the computer.

32. Explain Private Access Modifier in VB.NET.

The Public keyword in the declaration statement indicates that the elements can be worked/manipulated only from within the same module, class or structure.


Private Number Integer

Private can be used only at module level. This means you can declare a private element inside a module, class or structure but not at a level of a source file or namespace, inside an interface or in a procedure.

33. Enlist the Dialog Boxes used in Windows Forms of VB.NET.

The Windows Forms Dialog Boxes are as follows:
1. ColorDialog
2. FontDialog
3. OpenFileDialog
4. PrintDialog
5. PrintPreviewDialog
6. SaveFileDialog

34. Enlist features which are common to all .NET languages?

Garbage Collection is a feature that is common to all .NET languages. Garbage Collection feature stops / pauses the application for a few seconds before restarting it. The .NET Framework’s Garbage Collection manages the allocation and release of the memory to your applications.

35. What is Redim variable in VB.NET used for?

In VB.NET, Redim is used to re-declare and manipulate or modify the Array. Once we declare an Array with a dimension of 10 and if later we need to redefine the size, ReDim functionality can be used.

36. What is Polymorphism?

It is the ablility to showcase or exhibit different behaviours under different instances. The process of making and Operator or a Function respond differently in different instances is known as Operator Overloading.

37. What are MDI Forms in VB.NET?

MDI represents Multiple Document Interface. It is an application in which we can view and work with several documents at once. Example of an MDI application is Microsoft Excel. Visual Studio .NET provides great support for working with MDI Forms and Applications.

38. Enlist the various Mouse Events in VB.NET.

The list of Mouse Events in VB.NET are as follows:
1. Click
2. MouseClick
3. MouseDown
4. MouseWheel
5. MouseHover

39. What are Destructors in VB.NET?

A Destructor is used to release or delete the objects that have been created by Constructor. In VB.NET, the Garbage Collector automatically manages the allocation , assignment and release of memory for the managed objects in your application. However, you may require Destructors to delete unmanaged resources that your application creates. There can be only one destructor for a class.

40. Explain Inheritance in VB.NET

Inheritance is an Object Oriented Programming concept. It enables you to create a New Class that is reusable and can extend or modify the behaviour that is defined in another class. All Classes in Visual Basic by default inherits from the Object class that supports .NET class hierarchy and provides low-level services to all classes.

41. Explain Protected Access Modifier in VB.NET.

The Protected keyword in declaration statement mentions the elements that can be accessed only from within the same class, or from a class described from this class.

Protected Class demoClass

You can use Protected modifier only at Class Level, but not at level of Source File or Namespace, or inside an Interface, Module Structure or Procedure.

42. Enlist Languages that .NET Framework Supports.
2. Managed C++ Codes
3. C#
4. VBScript
5. JScript

43. What are Interfaces in VB.NET.

Interfaces define the properties, events and methods that classes can implement. Interfaces allow you to define features as small groups of closly related properties, methods, and events. With Interfaces, you can define features as small groups of closely related members.

44. What are Data Adapters in ADO.NET?

ADO.NET uses a data adapter as a bridge vetween the dataset and the datasource which is the actual database. Data Adapter provides the Fill() methods to retrieve data from the database and populate dataset. ADO.NET uses a data adapter object to mediate between the dataset object and the database.

45. Enlist the Differences between VB and VB.NET.

1. VB.NET is an Interpreted Language whereas VB.NET is a Compiled one.

2. Visual Basic is a Backword compatible whereas VB.NET is not backward compatible.

3. VB cannot be used to develop Multi-Threaded applications whereas VB.NET helps to develop Multi-Threaded applications.

46. What is JIT in VB.NET?

JIT represents Just in Time. It is basically a Compiler. It is a facility that is invoked by the CLR to convert the Intermediate Language into Machine Level Code. When the Assembly is loaded the method calls are invoked for compilation into native code. The .NET framework assembly files such as dll and exe cannot be executed by the target processor unless it is converted into native code.

47. Explain Friend Access Modifier in VB.NET.

The Friend keyword in the declaration statement specifies that the elements can be manipulated from within the same assemby but not from outside the assembly.


Friend demo As String

Friend modifier can be used only at Module, Interface in Namespace level.

48. Enlist Tools for VB.NET Development.

The tools for VB.NET development are as follows:
1. Mono Development Platform (Linux)
2. Microsoft Visual Studio

So this was the list of some important VB.Net interview questions and answers. If you found any information incorrect or missing in above list then please mention it by commenting below.

Leave a Reply

Your email address will not be published. Required fields are marked *