
Interview questions for VB
This one came up today and would be a damn good test of 'the right stuff'.
You have five text boxes on a form, with tabindexes 0 through 4. Explain the
algorithm which VB uses to renumber these tabindexes when one is changed.
Example, if you change the text box with tabindex 2 to have a new value of
4, the five textboxes will now have the tab indexes 0,1,4,2,3 instead of
0,1,2,3,4. OTOH if you changed the textbox with tabindex 2 to have a new
value of 0, you'd get 1,2,0,3,4 instead.
The idea is to derive an algorithm (in English will do) for what VB is doing
here. It is *reasonably* simple but not blindingly obvious.
The interesting thing about this question is that it is really quite a deep
one. You have to have a bit of a scientific mind and do a bit of
experimentation and make a few hypotheses. It really tests logical thinking
extremely well.