VB.NET Interview Questions

Want to become an expert in cracking VB.NET interview questions/Visual Basic .NET interview questions?

Start with practicing the questions below. Whether a question involves multiple choice or live coding, we will give you hints as you go and tell you if your answers are correct or incorrect.

After that, take our timed public VB.NET Interview Questions Test.

To use our service for testing candidates, buy a pack of candidates.


1. Merge Names

VB.NET Arrays Public New

Implement the UniqueNames method. When passed two arrays of names, it will return an array containing the names that appear in either or both arrays. The returned array should have no duplicates.

For example, calling MergeNames.UniqueNames({'Ava', 'Emma', 'Olivia'}, {'Olivia', 'Sophia', 'Emma'}) should return an array containing Ava, Emma, Olivia, and Sophia in any order.

Easy 
10min
VB.NET 15.0, .NET Framework 4.7
 


  •   Example case: System.NotImplementedException at Module1.MergeNames.UniqueNames(String[] names1, String[] names2) in MergeNames.vb:line 6
  •   Each array has distinct names: System.NotImplementedException at Module1.MergeNames.UniqueNames(String[] names1, String[] names2) in MergeNames.vb:line 6
  •   Each array has duplicate names: System.NotImplementedException at Module1.MergeNames.UniqueNames(String[] names1, String[] names2) in MergeNames.vb:line 6
  •   Arrays have some names in common: System.NotImplementedException at Module1.MergeNames.UniqueNames(String[] names1, String[] names2) in MergeNames.vb:line 6


2. User Input

VB.NET OOP Public New

User interface contains two types of user input controls: TextInput, which accepts all characters and NumericInput, which accepts only digits.

Implement the class TextInput that contains:

  • Public sub Add(c As Char) - adds the given character to the current value
  • Public function GetValue() As String - returns the current value

Implement the class NumericInput that:

  • Inherits TextInput
  • Overrides the Add method so that each non-numeric character is ignored

For example, the following code should output "10":

Dim input As TextInput = New NumericInput()
input.Add("1")
input.Add("a")
input.Add("0")
Console.WriteLine(input.GetValue())
Easy 
15min
VB.NET 15.0, .NET Framework 4.7
 


  •   Example case: System.InvalidCastException
  •   Adding various characters to TextInput: System.NullReferenceException
  •   Adding numeric characters to NumericInput: System.InvalidCastException
  •   Adding various characters to NumericInput: System.InvalidCastException


3. Folders

VB.NET Serialization Public New

Implement a function FolderNames, which accepts a string containing an XML file that specifies folder structure and returns all folder names that start with startingLetter. The XML format is given in the example below.

For example, for the letter "u" and XML file:

<?xml version="1.0" encoding="UTF-8"?>
<folder name="c">
    <folder name="program files">
        <folder name="uninstall information" />
    </folder>
    <folder name="users" />
</folder>

the function should return "uninstall information" and "users" (in any order).

Hard 
20min
VB.NET 15.0, .NET Framework 4.7
 


  •   Example case: System.NotImplementedException at Module1.Folders.FolderNames(String xml, Char startingLetter) in Folders.vb:line 8
  •   All folder names start with starting letter: System.NotImplementedException at Module1.Folders.FolderNames(String xml, Char startingLetter) in Folders.vb:line 8
  •   Root folder name starts with starting letter: System.NotImplementedException at Module1.Folders.FolderNames(String xml, Char startingLetter) in Folders.vb:line 8
  •   Complicated folder structure: System.NotImplementedException at Module1.Folders.FolderNames(String xml, Char startingLetter) in Folders.vb:line 8


If you feel ready, take one of our timed public VB.NET Interview Questions tests:
  • HTML/CSS, JavaScript, VB.NET, and SQL Online Test (Easy / Hard)
  • VB.NET Online Test (Easy / Hard)
  • VB.NET and .NET Online Test (Easy / Hard)
  • VB.NET and SQL Online Test (Easy / Hard)
Not exactly what you are looking for? Go to our For Jobseekers section.