Link to home
Start Free TrialLog in
Avatar of inthedark
inthedarkFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Visual Basic Prospective Employee Knowledge Assessment

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.
SOLUTION
Avatar of VBClassicGuy
VBClassicGuy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"what's wrong with this code" :)

>>data types Single and YesNo for Jet need to be declared as what for SQL? REAL and BIT<<
Yes/No -> BOOLEAN (Synonyms: BIT, LOGICAL, LOGICAL1, YESNO)
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"



Avatar of inthedark

ASKER

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?

1) UK VAT

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
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"


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.
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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Thanks for the help. I used suggestions from all of you in the final thing.  Thanks for the humour Ark.