VB.Net Interview Questions & Answers

Posted On:December 16, 2018, Posted By: Latest Interview Questions, Views: 206, Rating :

VB.Net Interview Questions and Answers

Dear Readers, Welcome to VB.Net Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your Job interview for the subject of VB.Net. These VB.Net Questions are very important for campus placement test and job interviews. As per my experience good interviewers hardly plan to ask any particular questions during your Job interview and these model questions are asked in the online technical test and interview of many IT companies.

1. What is vb.net?

vb.net is a windows based programming language.it supports oops concept.

interview Questions on VB.Net

2. what is the base class of .net?

system.object

 

3. what is difference between namespace and assembly?

namespace is a collection of different classes. whereas an assembly is the basic building blocks of the .net framework.

 

4. what is the difference between early binding and late binding?

calling a non-virtual method, decided at a compile time is known as early binding. calling a virtual method (pure polymorphism), decided at a runtime is known as late binding.

 

5. what is intermediate langauge?

microsoft intermediate language(msil or il) is the cpu -independent instruction set into which .net framework programs are compiled. it contains instructions for loading, storing initializing, and calling methods on objects.

 

6. what is commom language runtime?

clr also known as common language run time provides a environment in which program are executed, it activate object, perform security check on them, lay them out in the memory, execute them and garbage collect them.

 

7. what is common type system?

the common type system is a rich type system, built into the common language runtime, which supports the types and operations found in most programming languages.

 

8. what is common language specification?

The common language specification is a set of constructs and constraints that serves as a guide for library writers and compiler writers.

 

9.What’s the difference between private and shared assembly?

private assembly is used inside an application only and does not have to be identified by a strong name.

shared assembly can be used by multiple applications and has to have a strong name.

 

10. What namespace does the web page belong in the .net framework class hierarchy?

System.web.ui.page

 

11. What is an assembly?

Assembly are the basic buiding blocks of the .net framework.they are the logical grouping of the functionality in a physical file.

 

12. What are the advantages of an assembly?

Increased performance. better code management and encapsulation. it also introduces the n-tier concepts and business logic.

 

13. What is code access security?

CAS - code access security is the part of the .net security model that determines whether or not a piece of code is allowed to run, and what resources it can use when it is running.

 

14. What are the difference between structure and class?

structures are value type and classes are reference type

structures can not have constructors or destructors.

classes can have both constructors and destructors.

structures do not support inheritance, while classes support inheritance.

 

15. What is the differences between dataset.clone and dataset.copy?

Dataset.clone copies just the structure of dataset (including all the datatables, schemas, relations and constraints.); however it doesn’t copy the data.

dataset.copy, copies both the dataset structure and the data.

 

16. What is the use of internal keyword?

Internal keyword is one of the access specifier available in .net framework , that makes a type visible in a given assembly , for e.g : a single dll can contain multiple modules.

 

17. What is the difference between the debug class and trace class?

Use debug class for debug builds, use trace class for both debug and release builds.

 

18. What are class access modifiers?

Access modifiers are keywords used to specify the declared accessibility of a member or a type. this section introduces the four access modifiers :

§  public

§  protected

§  internal

§  protected inertnal

§  private

 

19. What is portable executable?

The file format used for executable programs and for files to be linked together to form executable programs.

 

20. What is the difference between system.string and system.stringbuilder classes?

System.string is immutable, system.stringbuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.

 

21. What is tracing?

Tracing refers to collecting information about the application while it is running. you use tracing information to troubleshoot an application.

 

22. What is the difference between a thread and a process?

A process is an instance of an running application. and a thread is the execution stream of the process. a process can have multiple thread.

 

23. What is serialization?

Serialization is the process of converting an object into a stream of bytes.

de-serialization is the opposite process of creating an object from a stream of bytes. 

serialization/de-serialization is mostly used to transport objects.

 

24.How a base class method is hidden?

Hiding a base class method by declaring a method in derived class with keyword new. this will override the base class method and old method will be suppressed.

 

25. What is a constructor?

A special method always called whenever an instance of the class is created.

 

26. What is polymorphism?

Mean by more than one form. ability to provide different implementation based on different number / type of parameters.

 

27. What is an interface?

An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body.

 

28. What is the difference between an exe and a dll?

DLL is an in-process component whereas exe is an out-process component.exe is for single use whereas you can use dll for multiple use.

exe can be started as standalone where dll cannot be.

 

29. What is the gac?

Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. the global assembly cache stores assemblies that are to be shared by several applications on the computer. this area is typically the folder under windows or winnt in the machine.

 

30. How does cas work?

The cas security policy revolves around two key concepts - code groups and permissions. each .net assembly is a member of a particular code group, and each code group is granted the permissions specified in a named permission set.

 

31. What is difference between metadata and manifest?

Metadata and manifest forms an integral part of an assembly( dll / exe ) in .net framework . out of which metadata is a mandatory component , which as the name suggests gives the details about various components of il code viz : methods , properties , fields , class etc.

 

32. What is the top .net class that everything is derived from?

System.object

 

33. How is method overriding different from method overloading?

When overriding a method, you change the behavior of the method for the derived class. overloading a method simply involves having another method with the same name within the class.

 

34. What is a formatter?

A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.

 

35. What is an arraylist?

The arraylist object is a collection of items containing a single data type values.

 

36. What is static member?

The member defined as static which can be invoked directly from the class level, rather than from its instance.

 

37. What is overloading?

A process of creating different implementation of a method having a same name as base class, in a derived class. it implements inheritance.

 

38. When do you use virutal keyword?

When we need to override a method of the base class in the sub class, then we give the virtual keyword in the base class method. this makes the method in the base class to be overridable. methods, properties, and indexers can be virtual, which means that their implementation can be overridden in derived classes.

 

39. What is the purpose of xml namespaces?

An xml namespace is a collection of element types and attribute names. it consists of 2 parts

the first part is the uri used to identify the namespace

the second part is the element type or attribute name itself.

 

40. What is a constructor?

A constructor is invoked when you use the new operator, or use the various methods of reflection to create an instance of a class.

 

41. What is the difference between system.string and system.stringbuilder classes?

System.string is immutable, system.stringbuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.

 

42. What is the use of jit ?

JIT (just - in - time) is a compiler which converts msil code to native code (ie. cpu-specific code that runs on the same computer architecture).

 

43. What is the difference between early binding and late binding?

calling a non-virtual method, decided at a compile time is known as early binding. calling a virtual method (pure polymorphism), decided at a runtime is known as late binding.

 

44. Which method do you invoke on the dataadapter control to load your generated dataset with data?

dataadapter’s fill () method is used to fill load the data in dataset.

 

45. What is the purpose of an assembly?

An assembly controls many aspects of an application. the assembly handles versioning, type and class scope, security permissions, as well as other metadata including references to other assemblies and resources. the rules described in an assembly are enforced at runtime.

 

46. What is authentication and authorization?

Authentication is the process of identifying users. authentication is identifying/validating the user against the credentials (username and password).

authorization performs after authentication. authorization is the process of granting access to those users based on identity. authorization allowing access of specific resource to user.

 

47. What are the types of authentication?

There are 3 types of authentication.

windows authentication

forms authentication

passport authentication.

 

48. What is a literal control?

The literal control is used to display text on a page. the text is programmable. this control does not let you apply styles to its content.

 

49. What are the namespace available in .net?

Namespace is a logical grouping of class.

system

system.data

system.io

system.drawing

system.windows.forms

system.threading

 

50. What is side-by-side execution?

The clr allows any versions of the same-shared dll (shared assembly) to execute at the same time, on the same system, and even in the same process. this concept is known as side-by-side execution.

 

51. What are the different types of caching?

There are three types of caching :

output caching

fragment caching

data caching.

 

52. What is reference type and value type?

Reference type : reference types are allocated on the managed clr heap, just like object types. a data type that is stored as a reference to the value’s location. reference types can be self-describing types, pointer types, or interface types.

Value type : value types are allocated on the stack just like primitive types in vbscript, vb6 and c/c++. value types are not instantiated using new go out of scope when the function they are defined within returns.

 

53. What is delegates?

Delegates are a type-safe, object-oriented implementation of function pointers and are used in many situations where a component needs to call back to the component that is using it.

 

54. What is authentication and authorization?

Authentication is the process of identifying users. authentication is identifying/validating the user against the credentials (username and password).

authorization performs after authentication. authorization is the process of granting access to those users based on identity. authorization allowing access of specific resource to user.

 

55. What is a static class?

Static class is a class which can be used or accessed without creating an instance of the class.

 

56. What is sealed class?

Sealed classes are those classes which can not be inherited and thus any sealed class member can not be derived in any other class. a sealed class cannot also be an abstract class.

 

57. What are the two main parts of the .net framework?

There are the two main parts of the .net framework are :

the common language runtime (clr).

the .net framework class library.

 

58. What is the advantage of using system.text.stringbuilder over system.string?

Stringbuilder is more efficient in cases where there is a large amount of string manipulation. strings are immutable, so each time it's being operated on, a new instance is created.

 

59. What is reflection?

All .net compilers produce metadata about the types defined in the modules they produce. this metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection.

 

60. What is an application domain? how they get created?

An application domain can be thought of as a lightweight processes controlled by the .net runtime. application domains are usually created by hosts like windows shell, asp.net and ie. when you run a .net application from the command-line, the host is the shell. the shell creates a new application domain for every application.

 

61. What is the difference between compiler and interpreter?

Compiler :

a compiler is a program that translates program (called source code) written in some high level language into object code.

Interpreter:

an interpreter translates high-level instructions into an intermediate form, which it then executes. interpreter analyzes and executes each line of source code in succession, without looking at the entire program; the advantage of interpreters is that they can execute a program immediately. .

 

62. What is a class?

Class is concrete representation of an entity. it represents a group of objects, which hold similar attributes and behavior. it provides abstraction and encapsulations.

 

63. What is an object?

Object represents/resembles a physical/real entity. an object is simply something you can give a name.

 

64. What is abstraction?

Hiding the complexity. it is a process of defining communication interface for the functionality and hiding rest of the things.

 

65. How do you convert a string into an integer in .net?

Int32.parse(string) 

convert.toint32()

 

66. Describe the compilation process for .net code?

Source code is compiled and run in the .net framework using a two-stage process. first, source code is compiled to microsoft intermediate language (msil) code using a .net framework-compatible compiler, such as that for visual basic .net or visual c#. second, msil code is compiled to native code.

 

67. What is boxing and unboxing?

Boxing :

boxing is an implicit conversion of a value type to the reference type.

examples : stuct type, enumeration type

Unboxing :

unboxing is an explicit conversion from the reference to a value type.

examples : class , interface.

 

68. How do you create threading in .net? what is the namespace for that?

System.threading.thread

 

69. What is method overloading?

Method overloading occurs when a class contains two methods with the same name, but different signatures.

 

70. What is method overriding?

An override method provides a new implementation of a member inherited from a base class. the method overridden by an override declaration is known as the overridden base method.

 

71. What is difference between inline and code behind?

Inline code written along side the html in a page. code-behind is code written in a separate file and referenced by the .aspx page.

 

72. What is an abstract class?

An abstract class is a class that must be inherited and have the methods overridden. an abstract class is essentially a blueprint for a class without any implementation.

 

73. What is the difference between datagrid and gridview?

Datagrid is used in windows application and gridview is used in web and in datagrid we cannot write the code for datagrid properties where as for grid view we can write the code like template column item template etc this will not be done in datagrid.

 

74. What is the use of system.diagnostics.process class?

The system.diagnostics namespace provides the interfaces, classes, enumerations and structures that are used for tracing.

the system.diagnostics namespace provides two classes named trace and debug that are used for writing errors and application execution information in logs.

 

75. What is the difference between static or dynamic assemblies?

Assemblies can be static or dynamic.

Static assemblies : 

can include .net framework types (interfaces and classes), as well as resources for the assembly (bitmaps, jpeg files, resource files, and so on).staticassemblies are stored on disk in portable executable (pe) files. 

Dynamic assemblies :

which are run directly from memory and are not saved to disk before execution. you can save dynamic assemblies to disk after they have executed.

 

76. What are the difference between structure and class?

structures are value type and classes are reference type.

structures can not have contractors or destructors. classes can have both contractors and destructors.

structures do not support inheritance, while classes support inheritance

 

77. What is difference between class and interface?

Class : is logical representation of object. it is collection of data and related sub procedures with defination.

Interface : is also a class containg methods which is not having any definations.class does not support multiple inheritance. but interface can support.

 

78. What is the use of errorprovider control?

The errorprovider control is used to indicate invalid data on a data entry form.

 

79. How many languages .net is supporting now?

When .net was introduced it came with several languages. vb.net, c#, cobol and perl, etc. 44 languages are supported.

 

80. How many .net languages can a single .net dll contain?

Many.

 

81. What is metadata?

Metadata means data about the data i.e., machine-readable information about a resource, . such information might include details on content, format, size, or other characteristics of a data source. in .net, metadata includes type definitions, version information, external assembly references, and other standardized information.

 

82. What is the difference between custom control and user control?

Custom controls are compiled code (dlls), easier to use, difficult to create, and can be placed in toolbox. drag and drop controls. attributes can be set visually at design time.

auser control is shared among the single application files.

 

83. What keyword is used to accept a variable number of parameter in a method?

“params” keyword is used as to accept variable number of parameters.

 

84. What are different types of jit ?

There are three types of jit :

pre - jit

econo - jit

normal - jit.

 

85. What is difference between c# and vb.net?

c# is case sensitive while vb is not case sensitive.

vb.net does not support xml while c# support xml

vb.net supports with constructor while c# do not.

 

86. What does assert() method do?

In debug compilation, assert takes in a boolean condition as a parameter, and shows the error dialog if the condition is false. the program proceeds without any interruption if the condition is true.

 

87. Why string are called immutable data type?

The memory representation of string is an array of characters, so on re-assigning the new array of char is formed & the start address is changed . thus keeping the old string in memory for garbage collector to be disposed.

 

88. What is the difference between convert.tostring and .tostring() method?

Convert.tostring handles null while i.tostring() does not handles null.

 

89. How many types of transactions are there in com + .net ?

There are 5 transactions types that can be used with com+.

disabled

not supported

supported

required

required new

 

90. What is a datatable?

A datatable is a class in .net framework and in simple words a datatable object represents a table from a database.

 

91. How many namespaces are in .net version 1.1?

124.

 

92. What is a dataset?

A dataset is an in memory representation of data loaded from any data source

 

93. What is the difference between in-proc and out-of-proc?

An inproc is one which runs in the same process area as that of the client giving tha advantage of speed but the disadvantage of stability becoz if it crashes it takes the client application also with it.

outproc is one which works outside the clients memory thus giving stability to the client, but we have to compromise a bit on speed.

 

94. What is the differnce between managed code and unmanaged code?

Managed code: code that runs under a "contract of cooperation" with the common language runtime. managed code must supply the metadata necessary for the runtimeto provide services such as memory management, cross-language integration, code access security, and automatic lifetime control of objects. all code based on microsoft intermediate language (msil) executes as managed code.

Un-managed code:code that is created without regard for the conventions and requirements of the common language runtime. unmanaged code executes in the common language runtime environment with minimal services (for example, no garbage collection, limited debugging, and so on).

 

95. What is difference between constants, readonly and, static?

Constants: the value can’t be changed.

Read-only: the value will be initialized only once from the constructor of the class.

Static: value can be initialized once.

 

96. What is the difference between convert.tostring and .tostring() method?

Convert.tostring handles null while i.tostring() does not handles null.

 

97. What are the advantages of vb.net?

The main advantages of .net are :

.net is a language independent

automatic memory management(garbage collection)

disconnected architecture

object oriented.

 

98. What is strong-typing versus weak-typing?

Strong type is checking at the variables in compile time.

weak typing is checking the variables at run-time.

 

99. What is the root class in .net?

System.object is the root class in .net .

 

100. What is the maximum size of the textbox?

65536

 

101. What is managed code execution?

The .net framework loads and executes the .net applications, and manages the state of objects during program execution. this also provides automatically garbage collections.

 

102. What is the strong name in .net assembly?

Strong name is similar to guid (it is supposed to be unique in space and time).

in com components. strong name is only needed when we need to deploy assembly in gac.

strong names use public key cryptography (pkc) to ensure that no one can spoof it. pkc use public key and private key concept. following are the step to generate a strong name and sign an assembly:

 

103. How to run a dos command in vb.net?

Shell("cmd.exe /c c:\first.exe < in.txt > out.txt")

 

104. What are the assembly entry points?

An assembly can have only one entry point from dllmain, winmain or main.

 

105. What are remotable objects in .net remoting?

Remotable objects are the objects that can be marshaled across the application domains. you can marshal by value, where a deep copy of the object is created and then passed to the receiver. you can also marshal by reference, where just a reference to an existing object is passed.

 

106. What are the types of authentication?

There are 3 types of authentication.

windows authentication

forms authentication

passport authentication.

 

107. What namespaces are necessary to create a localized application?

System.globalization

system.resources

 

108. Which namespaces are used for data access?

System.data

system.data.oledb

system.data.sqlclient

 

109. What is a session and application object?

Session object store information between http requests for a particular user. 

session variables are used to store user specific information where as in application variables we can’t store user specific information.

while application object are global across users.

 

110. What is static constructor?

A static constructor is used to initialize a class. it is called automatically to initialize the class before the first instance is created or any static members are referenced.


VB.Net Multiple choice Questions & Answers
VB.Net Interview Questions & Answers