Visual Basic Prospective Employee Knowledge Assessment

Posted on 2011-09-02
Medium Priority
Last Modified: 2012-05-12
I found somewhere on the internet an excellent list of questions which you could give to somebody to test their knowledge of Visual Basic 6.

I have tried to find these questions again but have so far been unable.

Can anybody suggest anything?  I need 2 tests one for VB6 and one for VB.NET.

Thanks in advance.
Question by:inthedark
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
LVL 14

Assisted Solution

VBClassicGuy earned 400 total points
ID: 36473222
For VB6, how about:

1. When creating a table for use with either SQL Server or Access, the data types Single and YesNo for Jet need to be declared as what for SQL? REAL and BIT.

2. What method is called right before a form unloads? FORM_QUERYUNLOAD

3. To empty out a database table but keep the table, should you use the Drop or Delete statement? DELETE

4. Which uses less memory, the PictureBox or Image control? IMAGE

5. Without API calls or special coding, how do you display a PNG picture using standard VB6 controls? YOU CAN'T

6. The value of False is zero. What is the value of True? -1

7. If you insert the text of "1" through "10" into a sorted ListBox, what will the results look like in the ListBox? 1, 10, 2, 3, 4, 5, 6, 7, 8, 9

8. How do you correct the above situation? PAD VALUES WITH LEADING ZEROES SO ALL TEXT IS THE SAME LENGTH

9. Using the default settings of a Label, what will the text "Love & Marriage" look like? LOVE _MARRIAGE

10. What two ways to correct the above situation? USE TWO AMPERSANDS, OR SET THE UseMnemonic PROPERTY TO FALSE
LVL 49

Accepted Solution

Martin Liss earned 800 total points
ID: 36473957
LVL 46

Assisted Solution

aikimark earned 400 total points
ID: 36476978
I'm a big fan of "what's wrong with this code" challenges.  Look at this old EE question:

The questions you ask should be a good indicator of the type of work to be done and expertise level for which you are hiring.  For instance, if this job will be database intensive, you should ask more database questions.

If you this job will be maintaining old code, you should ask questions about the type of code actually found in your system (classes, forms, objects, API calls, etc.)
Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

LVL 28

Expert Comment

ID: 36479699
"what's wrong with this code" :)

>>data types Single and YesNo for Jet need to be declared as what for SQL? REAL and BIT<<
Number (FieldSize =Single) -> SINGLE (Synonyms: FLOAT4, IEEESINGLE, REAL)
See http://msdn.microsoft.com/en-us/library/aa211091(v=office.11).aspx

>>What method is called right before a form unloads? FORM_QUERYUNLOAD<<
FORM_QUERYUNLOAD is an EVENT, not METHOD. Furthermore, following code won't fire QueryUnload and Unload events though Unload METHOD was called:
   Dim f As New Form2
   Unload f

>>To empty out a database table but keep the table, should you use the Drop or Delete statement? DELETE<<
Why TRUNCATE is missing? It's much faster and resets autonumber fields as well.

>>Without API calls or special coding, how do you display a PNG picture using standard VB6 controls? YOU CAN'T<<
WebBrowser1.Navigate "yourimage.png"

LVL 17

Author Comment

ID: 36484942
Thanks for your help so far.... we interviewed 2 people so far and neither could do the first question; do you thing it was too hard?


Background information: In the UK the calculation of VAT is based on the following formula:

VATTotal = GoodsValue * VatRatePercentage /100

The Vat is always rounded to 2 decimal places. So the invoice total is calculated by adding the Goods and VAT:

InvoiceTotal = GoodsValue + VATTotal

Employees give an accountant their expenses which only include amounts including VAT.  The VB programmer needs to write a program to calculate the Goods and VAT values from the invoice total.  The programmer created 2 textboxes one for the entry of an invoice total and one for a VAT rate percentage.  A display button to calculate and display the goods and vat values was also added.

You need to fill in the missing lines so that the goods and VAT values are correctly calculated. Calculate the goods value first.

Private Sub cmdDisplay_Click()

Dim curInvoiceTotal As Currency
Dim curVATRate As Currency
Dim curGoods As Currency
Dim curVAT As Currency
Dim sResult As String

' get the invoicetotal from the textbox
curInvoiceTotal = CCur(txtInvoiceTotal)

' get the vat rate percentage
curVATRate = CCur(txtVATRate)

' ** Fill in the missing code

curGoods =

curVAT =

' Display the result
sResult = "Goods Value: " + Format(curGoods, "0.00") + vbCrLf
sResult = sResult + "VAT Value: " + Format(curVAT, "0.00")

MsgBox sResult, vbInformation, "Goods & VAT Calculator"

End Sub
LVL 17

Author Comment

ID: 36484946
For your interest the next 2 questions which nobody could answer..........were these too hard as well?

2) Hex Notation

In the following code:

Dim lMyLong As Long

lMyLong = &H1234
lMyLong = lMyLong / &H100
MsgBox "lMyLong=" + Hex(lMyLong)

What would the message box display?

3) RGB Colours

Screen colours are represented by long value which can be generated by the RGB(Red,Green,Blue) function.

For example RGB(16,17,18) will create a long hex value of &H121110.

Add the missing lines so that you can get the Red, Green & Blue values from a long colour.

Dim sResult As String
Dim lRed As Long
Dim lBlue As Long
Dim lGreen As Long
Dim lColour As Long

lColour = 1184016

lBlue = lColour/&H10000

' ** complete the missing code

lGreen =

lRed =

sResult = "Red: " + CStr(lRed) + vbCrLf
sResult = sResult + "Green: " + CStr(lGreen) + vbCrLf
sResult = sResult + "Blue: " + CStr(lBlue)
MsgBox sResult, vbInformation, "Red Green Blue Values"

LVL 46

Expert Comment

ID: 36485008
I don't think are too hard, but it depends on the level of developer you are looking for and type of code they will be maintaining/developing.
LVL 49

Expert Comment

by:Martin Liss
ID: 36485048
Rather than asking specific questions (which will probably either insult or stump him/her) you'd probably be better off trying to determine how they go about solving problems. For example I'd rather hire someone who says that he would go to Experts Exchange or VBForums if he can't figure out how to do something after giving it a reasonable amount of time on his own rather than spending days of his (and the company's) time on it. I would also ask him how he goes about solving problems and if he is familiar with Debug. I'd also contact his references early on to get a idea of how he performed there.
LVL 28

Assisted Solution

Ark earned 400 total points
ID: 36486125
These questions have nothing to do with programming (and VB6 in particular). They require basic school math skills. Whom are you looking for? Coders? Remove these questions and stay with VB6 syntax knowledge. Developers? Remove all explanations like "calculation of VAT is based on the following formula...", "Screen colours are represented by long value..." and code - leave the task: "Calculate and display Goods and VAT values for UK knowing Invoice total and VAT rate" and examine final code. For example your first question's answer can be:
For curGoods=0 To 1000000
     For curVAT=0 to 1000000 Step 0.01
           If curGoods + curVAT = curInvoiceTotal Then
               If  curVAT = curGoods * curVATRate/100 Then Exit For
            End If

Open in new window

Do you like it?
LVL 46

Expert Comment

ID: 36486254
A classic "what's wrong with this code" case is updating a database on a record-by-record basis or coordinating two recordsets instead of doing a table join.
LVL 17

Author Closing Comment

ID: 36510178
Thanks for the help. I used suggestions from all of you in the final thing.  Thanks for the humour Ark.

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
Article by: Shawn
IT teams define success as solving problems quickly. To enable ITSM modernization we have to think of adopting the tools and methods that will enable resolution of ITSM issues more quickly.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question