View Single Post
Old 01-20-2004, 06:54 PM   #4 (permalink)
magua
Tilted
 
I think about the problems that we've had over the past month, and ask those. This avoids the arbitrariness of the brain teaser, but enables you to see how the applicant thinks. I encourage them to think out loud.

Some examples over the years. Obviously, these won't translate to your company, but should illustrate the principle:

1) (HTML webpage design) You have four select elements, such that the option the user chooses in select #1 influences which options can be seen in select #2, which'll influence select #3, which'll influence select #4. There's too much data to load it all into the page and then show/hide. How would you structure the page so that choosing an option in select x would load select (x+1) without having to reload the entire page?

2) (SQL) You have a table, Customer, that has a primary key, CustomerID, and a foreign key to itself, ParentCustomerID. How would you write a stored procedure that, given a CustomerID, returned all descendents (that is, children, grandchildren, great-grandchildren, etc)

3) (Visual Basic) What's wrong with the following code from a form (and as I type this from memory, I apologize for syntax mistakes. It is supposed to be legal code.)?

Code:
Public m_colButtons As Collection
...
Public Sub Form_Load()
   Dim ctl As Control

   Set m_colButtons = New Collection
   For Each ctl In Me.Controls
      If TypeOf ctl Is CommandButton Then
         m_colButtons.Add ctl
      End If
   Next ctl
End Sub
magua is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73