3 ms·
I tend to start off with a "calm-the-nerves" question, something like "write me a function to print out all the numbers from INT_MAX down to 0", which has a (sm
by spacedcowboy 6y ago
I tend to start off with a "calm-the-nerves" question, something like "write me a function to print out all the numbers from INT_MAX down to 0", which has a (small) gotcha in the termination condition, but is relatively simple.
Then I'll ask something like "write a function to find the nth-to-last entry in a singly-linked list", which is possibly difficult if you haven't come across multiple-runners before.
But the meat of the interview is something like "design me an algorithm to manage the entry-gate for a car-park that can cope with bikes (1/2 space), cars (1 space) and busses (4 spaces)".
There's so much you can do with that last one. The most impressive answers I get are those that recognize it as malloc() with zones, and cope with the corner-cases (can't park a bus around the corner of a car-park, 4 spaces have to be in a straight line...)
I mean, I have a variety of questions like each of the above, and I tailor the interview to suit what other members of the team are asking too, but the quick-functions at the start are really to calm nerves and get them into the swing of the interview. The main point is the design/thought-process one, which takes the majority of the time.