REAL-TIME VB.Net Interview Questions & Answers For PRACTICE
Last updated on 04th Jul 2020, Blog, Interview Questions
These VB.Net Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of VB.Net . As per my experience good interviewers hardly plan to ask any particular question during your interview, normally questions start with some basic concept of the subject and later they continue based on further discussion and what you answer.we are going to cover top 100 VB.Net Interview questions along with their detailed answers. We will be covering VB.Net scenario based interview questions, VB.Net interview questions for freshers as well as VB.Net interview questions and answers for experienced.
1. What is Metadata?
Metadata is termed as “Data about content of the data” and it is found in the catalog of libraries. Practically, it is used at back side of book to see the necessary topic.
2. What is the difference between VB and VB.Net?
Following are the differences between VB and VB.Net:
|Platform dependent||Platform Independent|
|VB is backward compatible||VB.Net is not backward compatible|
|Exception Handling by ‘On Error…..Goto’||Exception Handling by ‘Try….Catch’|
|Cannot develop multi-threaded applications||Can develop multi thread applications|
3. What is the difference between C# and VB.Net?
Following table gives differences between C# and VB.Net:
|Optional Parameters are accepted||Optional Parameters are not accepted|
|Not case sensitive||Case Sensitive|
|Nothing is used to release unmanaged resources||‘Using’ is used to release unmanaged resources|
|Support of Both structured and unstructured error handling||Unstructured error handling|
4. What is namespace?
A namespace is an organized way of representing Class, Structures and interfaces present in .NET language. Namespaces are hierarchically structured index of a class library, available to all .NET Languages.
5. Which namespace are used for accessing the data?
System.Data namespace is used for accessing and managing data from the required data source. This namespace deals only with the data from the specified database.
6. What is JIT?
JIT is termed as Just in Time compiler which is used as a part of runtime execution environment. There are three types of JIT and they are:
- Pre-JIT – Compiles at the time of deployment of an application
- Econo-JIT – Compiles called methods at runtime
- Normal JIT – Compiles called methods at runtime and they get compiled first time when called
7. What is an assembly and its use?
An assembly is one of the elements of a .NET application and it termed as a primary unit of all .NET applications. This assembly can be either DLL or executable file.
8. What is strong name in .NET assembly?
Strong Name is an important feature of .Net and it is used to identify shared assembly uniquely. Strong name has solved the problem of creating different object with same name and it can be assigned with the help of Sn.exe.
9. What are the different types of assembly?
There are two types of assembly –
- Private – A private assembly is normally used by a single application and it is stored in application’s directory.
- Public – A public assembly or shared assembly is stored in Global Assembly Cache(GAC) which can be shared by many applications
10. What is the difference between Namespace and Assembly?
Assembly is physical grouping of all units and Namespace logically groups classes. Namespace can have multiple assemblies.
11. What is INTERNAL keyword in .Net Framework?
INTERNAL keyword is one of the access specifier which will be visible in a given assembly i.e. in a DLL file. This forms a single binary component and it is visible throughout the assembly.
12. What are Option Strict and Option Explicit?
.Net generally allows implicit conversion of any data types. In order to avoid data loss during data type conversion, Option Strict keyword is used and it ensures compile time notification of these types of conversions.
Option Explicit is the keyword used in a file to explicitly declare all variables using declare keywords like Dim, Private, Public or Protected. If undeclared variable name persists, an error occurs at compile time.
13. What is the use of New Keyword?
New keyword is used with the constructor in which it can be used as a modifier or an operator. When it is used as a modifier, it hides inherited member from the base class member. When it is used as an operator, it creates an object to invoke constructors.
14.What is ReDim keyword and its use?
Redim keyword is exclusively used for arrays and it is used to change the size of one or more dimensions of an array that has been already declared. Redim can free up or add elements to an array whenever required.
- Dim intArray(7, 7) As IntegerReDim Preserve intArray(7, 8)ReDim intArray(7, 7)
15. What is jagged array in VB.Net?
Jagged array is nothing but an array of arrays. Each entry in the array is another array that can hold any number of items.
16. What is Manifest?
A Manifest is a text file that is used to store metadata information of .NET assemblies. File type of Manifest can be saved as a type PE. Assembly Name, Version, Culture and key token can be saved as a Manifest.
17. What are all the differences between Dispose and Finalize()?
Finalize method is called by Garbage collector which helps us to make free of unmanaged resources. There are some other resources like window handles, database connections are handled by iDisposable interface.
Dispose method is handled by IDisposable interface to explicitly release unused resources. Dsipose can be called even if other references to the object are alive.
18. What is Garbage Collection?
collection is also known as automatic memory management, which is used for automatic recycling of dynamically allocated memory. Garbage collection is performed by Garbage collector which will recycle memory if it is proven that memory will be unused.
19. What are the types of generations in garbage collector?
There are three types of generations in garbage collector.
- Generation 0 – This identifies a newly created object that has been never marked for collection.
- Generation 1 – This identifies an object which has been marked as collection but not removed.
- Generation 2 – This identifies an object that has survived more than one sweep of the Garbage collector.
20. What is the use of Option explicit?
Variable must be compulsorily declared when the Option Explicit is termed as ON. If it is OFF, variables can be used without declaration.
21. What is the difference between C#, VB, and VB.Net?
Differences between C# and VB.Net:
In VB.Net Optional Parameters are accepted, not case sensitive, nothing is used to release unmanaged resources, support of both structured and unstructured error handling.
In C# Optional Parameters are not accepted, case sensitive, ‘Using’ is used to release unmanaged resources, unstructured error handling.
Differences between VB and VB.Net:
VB is platform dependent, backward compatible, exception Handling by ‘On Error…..Goto’, Interpreted, Cannot develop multi-threaded applications.
VB.Net is Platform Independent, VB.Net is not backward compatible, Compiler Language, Exception Handling by ‘Try….Catch’, multi-thread applications can easily be developed.
22. Explain Metadata, namespace, which namespace is used for accessing the data, What is JIT?
Metadata is termed as “Data about the content of the data” and it is found in the catalog of libraries. Practically, it is used to analyzed data of database can be used for some other purpose also.
A namespace is an organized way of representing Class, Structures, and interfaces present in the .NET language. Namespaces are a hierarchically structured index of a class library, available to all .NET Languages.
It stands for Just in Time compiler which is used as a part of the runtime execution environment. There are three types of JIT and they are:
Normal JIT – Compiles called methods at runtime and they get compiled the first time when called.
Pre-JIT – Compiles at the time of deployment of an application.
Econo-JIT – Compiles called methods at runtime.
Let us move to the next VB.NET Interview Questions.
23. What is an assembly, its type, its use and what is a strong name in .NET assembly?
An assembly is one of the elements of a .NET application and is termed as a primary unit of all .NET applications. This assembly can be either a DLL or an executable file.
There are two types of assembly:-
- Private – A private assembly is normally used by a single application and it is stored in the application’s directory.
- Public – A public assembly or shared assembly is stored in Global Assembly Cache which can be shared by many applications.
- Strong Name is an important feature of.Net and it is used to identify shared assembly uniquely.
Strong Name has solved the problem of creating a different object with the same name and it can be assigned with the help of Sn.exe. This is the most common VB.NET Interview Questions which is asked in an interview.
24. What are Option Strict, Option Explicit, and INTERNAL keyword in.Net Framework?
Net generally allows implicit conversion of any data types. In order to avoid data loss during data type conversion,
option strict keyword is used and it ensures compile-time notification of these types of conversions.
Option Explicit is the keyword used in a file to explicitly declare all variables using declare keywords like Public, Dim, Private, or Protected.
If an undeclared variable name persists, an error occurs at compile time.
INTERNAL keyword is one of the access specifiers which will be visible in a given assembly
In a DLL file. This forms a single binary component and it is visible throughout the assembly.
25. New Keyword in.Net Framework?
A new keyword is used with the constructor in which it can be used as a modifier or an operator.
When it is used as a modifier, it hides inherited member from the base class member. When it is used as an operator, it creates an object to invoke constructors.
26. Explain jagged array in VB.Net?
The jagged array is an array of arrays. Each entry in the array is another array that can hold any number of items. This is the frequently asked VB.NET Interview Questions in an interview.
27. What is Garbage Collection in VB.net?
Garbage collection is also known as automatic memory management, which is used for automatic recycling of dynamically allocated memory. Garbage collection is performed by a Garbage collector which will recycle memory if it is sure that memory will be unused.
28. Difference between System.String and System.StringBuilder classes?
System.string class is non-updatable and it will create a new string object instead of updating the same.
But updating in the same string object is possible for the StringBuilder class. So, the operation of a string builder is faster and efficient than the string class.
29. Difference between int and int32?
Int32 represents 32-bit signed integer whereas it is not a keyword used in VB.Net.
30. What is Hashtable?
Hashtable is set to be items with key and value pairs. Keys are referred to as indexes and a quick search can be performed for values by searching through the keys.
Learn VB.Net Certification Course to Advance Your CareerWeekday / Weekend BatchesSee Batch Details
31. 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.
32. Enlist Languages that .NET Framework Supports.
- Managed C++ Codes
33. 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.
34. 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.
35. 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.
36. 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.
37. 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.
38. Enlist Tools for VB.NET Development.
The tools for VB.NET development are as follows:
- 1. Mono Development Platform (Linux)
- 2. Microsoft Visual Studio
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. What is your understanding of .net framework?
Irrespective of your experience in vb.net language, this is a frequently asked question at interviews. You need to explain that the .net framework is a collection of different classes and services and exists as a layer between .net applications and the underlying operating system. Also, talk about how.net framework consists of different web forms, window forms, and console applications.
42. What is Array List in vb.net?
Ans:Explain that the Array List in vb.net represents an ordered collection of an object that can be indexed individually. In simpler terms, it is an alternative to an array with a difference where you can add and remove items from a list at a specified position using an index and the array resizes itself automatically.
43. Explain the term CLR in context of VB.net?
Ans:This is a common question that is asked at the VB.net interviews. You need to explain that CLR or Common Language Runtime is a crucial aspect of the .NET framework. It is responsible to take care of the code execution of the program including code verification, garbage collection, code access security, and intermediate language (IL).
44. List down the differences between Vb.net and Vb6?
The question is asked to check your understanding of the language. There are a few important differences that you need to explain here including:
- While vb6 is a scripting language, vb.net is a programming language.
- Unlike vb6 Vb.net is an object-oriented language.
- While vb6 used ADO as a data access technology and record-sets to implement data access applications, vb.net uses ADO.NET and datasets to build data access applications.
- Unlike vb6 Vb.net supports multiple versions and multithreading.
45. Explain data type conversion in VB.Net?
With such questions, the interviewer is trying to assess your previous knowledge of the language. Explain that the process of converting one variable type to another is known as the data type conversion. This is sometimes also known as casting in VB.NET.
46. What do you understand by Global Assembly Cache (GAC)?
As an experienced VB.net professional, you’re expected to be familiar with various terminologies used in the language such as GAC, CTS, serialization, CLS, etc. You need to explain that GAC or Global assembly cache is used where shared .NET assembly resides. Below are the criteria for using GAC:
- If.net application has to be shared with other applications.
- If.net assembly has any special security requirements.
47. What is the difference between ‘system.string’ and ‘system.string builder’ classes?
While the ‘system.string’ class creates a new string object, updating in the same string object is possible for string builder class instead. Also, the operation of a string builder is much faster and efficient as compared to the string class.
48. What are satellite assemblies in Vb.net?
A satellite assembly is a DLL that contains only resource strings. Satellite assemblies in vb.net are used for localising the resources of the application.
49. What is garbage collection in the context of vb.net?
This is another frequently asked question at vb.net interviews. You need to explain that garbage collection is a low-priority process in vb.net that serves as an automatic memory manager. The main purpose of this is to manage the allocation and release of memory for the applications
50. Explain the meaning of delegate in .NET?
A delegate in vb.net is very similar to a function pointer in C or C++ language. It allows the programmer to encapsulate a reference to a method inside a delegate object. Additionally, it can be used to create a custom event within a class.
UPGRADE Your Career with VB.Net Training By Highly Experienced Faculty
- Instructor-led Sessions
- Real-life Case Studies
51. What are nested classes?
A class that can be declared within the scope of another class. These classes are considered within the scope of the enclosed class and are available within that class or scope.
52. What is Enumerator?
An Enumerator or Enum is a value type with a set of constants given to the set of the list. Enumeration is used when definition is required for more than one number.
53. What is Delegate?
A delegate is defined as an object that can refer to a method. Whenever a delegate is assigned to a method, it behaves exactly like that method.
- public delegate int performaddition(int z, int b);
54. What is Globalization?
Globalization is nothing but making the application Internationalize and localizing the application to other languages or cultures. Culture is nothing but a combination of Language(English) and the location like US or UK.
55. What is the difference between Dataset and Datareader?
|Datareader has read only access to the data and it is set to be forward only.||Dataset can hold more than one table from the same data source. It even stores relationships between tables.|
|Datareader cannot persist contents as it is read only||Dataset can persist contents|
|Datareader is connected architecture||Dataset is disconnected architecture|
56. What is the difference between value and reference types?
Value types directly store the data and it is allocated to stack. Reference type store a reference to the value’s memory address and are allocated to heap.
57. What is TRACE in VB.Net?
TRACE allows the user to view how the code has been executed in detail. This tells how the code is working.
58. 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.
59. What are Shared Assemblies?
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.
60. 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:
- C# supports unsafe code blocks for improved performance.
- C# also supports Multi Line comments and static classes
- Anonymous methods and Partial interfaces
61. 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.
62. 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.
63. 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.
64. 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.
65. What is Assembly Manifest?
Every Assembly contains an Assembly Manifest. It consists of the following:
- The Assembly’s Identity (Name and Version)
- File Table describing all other files that make up the assembly.
- Assembly Reference List that contains information about External Dependencies.
- Global Objects
66. Explain .NET compilation process.
- Compilation of source code to managed code / Intermediate Language (IL).
- Compilation of IL to platform-specific code by the CLR.
- MSIL defines a set of portable instructions which are independent of any specific CPU.
67. Enlist the Garbage Collection Methods in .NET Framework.
The .NET Framework garbage collection methods are as follows:
68. 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.
69. 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.
70. 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:
- Shared Assemblies
- Private Assemblies
71. 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.
72. 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.
73. 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.
74. How do you define a Class in VB.NET?
- Class Demo
- Public Name as String
- End Class
75. Enlist Types of Data Validations.
- Code Checking
- Data Type Validation
- Complex Validation
- Range Checking
76. 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.
77. 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.