Favorite Technical Interview Questions?

One technical gem I got asked at my last interview: "If a group of five customers orders the rib special with coke, calculate your tip".

With the word "customers" i'm assuming that 'i am the server'. Which means that the tip will be proportionally to the service provided. If the service is sh*t, no tip. If the service is great, a good tip should be rewarded. But they order the 'special' which means the client has little expectations regarding the service.
 
Interesting thread. Having been working as a "developer" for about 2 years. I'm shocked that I know 20% of what has been mentioned (might have to do with terminology). Any idea where I should start in studying this. Doing my Informatics degree from second semester this year but in the interim. Where do I start?

Any good question tries to get an understanding of how well the candidate understands both theory and practice, as well as how well they are able to combine the two. The theory to my first question (random memory access), is a gateway to a discussion on fault tolerant computing, how memory sub-systems work, and the distinct roles played by the OS and processor architecture for memory access. So, the theoretical, and functional basics would be covered in an OS and architecture class, while anyone with experience or interest in systems programming will likely take it further. Someone with a strong interest in optimization and performance programming, would also certainly encounter these topics early in their research/career.

My second question (dot product) touches on several aspects of processor architecture, compiler optimization (and knowing when and how it can and can not optimize), as well as numerical computing. There are generally classes on the first two, and some universities have courses on numerical computing. Really understanding what a dot product is, and why it is such a fundamental operation, would require some maths courses. For me, most of this knowledge comes from work experience and practice - my suggestion is to try write a ray-tracer, and then make it fast - very educational in so many aspects of computing, and also very satisfying. :)

Gnome's questions would be covered by a course in Java (preferably as a demo language for OO theory, rather than a course on syntax of course) + several years of experience using it, and understanding of network and internet technology (generally covered insufficiently in CS classes, so you would also have had to do your own research, or worked in this area to give a really good answer), and a relevant university course on math. I encountered one way functions in an "applied algebra" course (coding theory), a computer security course, and at least one of the various theoretical CS modules I did as an undergrad. Most universities offer courses (usually at honours level) on distributed computing and/or HPC, which may touch on the CAP theorem (unless it's just a front for a GPU programming course :-) ).

In the interview's I've been too, we are given a "test" to solve, figure that out and you get called in for a face-time interview. And that was it,

Many jobs, especially the ones for more junior to mid-level candidates are very straightforward to interview for. They need someone who can code in language Z, test if they can code in language Z (or similar language Z' :) ). They need someone who knows technology X, they can test for knowledge/skill on technology X.

For more senior roles, they often need someone to participate in the design of the overall system - choosing the technology, architecting the software, designig the regression infrastructure, or even better: they have to hire someone who can do job Y, because no current employee even knows where to start. In those scenarios, the job description is way more nebulous and the interview tends to be much more about ascertaining interest, skill, ability to communicate, ability to apply theory, depth and breadth of knowledge, lateral thinking, etc. Actually getting the answers correct off pat, becomes far less important, than the candidate convincing the interviewer that s/he has the ability to solve complex problems independently. I've actually been amazed at how well some top devs progress with a problem in a field they've only briefly touched. Anyway, this is often where the more esoteric questions come from. (Well, that and junior interviewers who expect concrete answers to hazy, ill-defined riddles - sigh ;) ).
 
Last edited:
Another question that covers a lot from candidate communication skills, high level design and also low level skills: How would you go about implementing a lock-free queue?
 
The litmus test question (i.e. a poor answer for this is an early reject for me, but does not indicate sufficiency) that I tend to ask most frequently of developers is:
If you fill a pointer with random data, and write some other random data to the dereferenced address, what is the worst that could happen? Explain.

Trick question.

You cannot fill a pointer with random data. A pointer is a variable which contains the address in memory of another variable . You can change the address of the pointer , but you cannot fill it with anything other than an address.

Although this answer is obtuse , it points out the fragile nature of technical questions in interviews and how they have to be carefully worded.
 
Trick question.

You cannot fill a pointer with random data. A pointer is a variable which contains the address in memory of another variable . You can change the address of the pointer , but you cannot fill it with anything other than an address.

Although this answer is obtuse , it points out the fragile nature of technical questions in interviews and how they have to be carefully worded.

A pointer is a variable that contains an address, and an address is just a numerical index into memory. By putting a random number/offset/address in the pointer variable, you are filling it with random data, which is the same as a random address. I think that you’re confusing the term “random data” with “any data”.

Also, although the answer is obtuse, if someone had to give me that, it would mean that they completely failed to grok the intent of the question, which would be a very valuable data point for an interviewer.
 
Last edited:
I was put in front of a computer and told to write an arithmetic library in Java that didn't involve using the native arithmetic operators.

I think the best way to test people is to get them to fix a complex bug that you have found in your code and fixed. Obviously you would need to pick something that can be isolated into its own environment.

1) They don't have to fix the bug to learn something, their approach teaches you a lot about their thinking.
2) It tests how quickly they can learn a new piece of technology, framework or language.

I think this is a far more comprehensive test of what a programming job actually entails (face it, most of our time is fixing stupid bugs, not writing efficient algorithms)
 
If you fill a pointer with random data, and write some other random data to the dereferenced address, what is the worst that could happen? Explain.

The heat death of the solar system as you create a mini singularity which sucks you 5 billion years into the future via the CPU fan.

Or a BSOD if you're lucky.
 
The heat death of the solar system as you create a mini singularity which sucks you 5 billion years into the future via the CPU fan.

Or a BSOD if you're lucky.
:)


A BSOD is a certainty a possibility. My follow up would be, to ask under which circumstances it would BSOD?
 
I was put in front of a computer and told to write an arithmetic library in Java that didn't involve using the native arithmetic operators.

I think the best way to test people is to get them to fix a complex bug that you have found in your code and fixed. Obviously you would need to pick something that can be isolated into its own environment.

1) They don't have to fix the bug to learn something, their approach teaches you a lot about their thinking.
2) It tests how quickly they can learn a new piece of technology, framework or language.

I think this is a far more comprehensive test of what a programming job actually entails (face it, most of our time is fixing stupid bugs, not writing efficient algorithms)

Some interviewers I know ask things like this. The difficulty is that it’s much harder to come up with questions like this, especially when the answers start getting around (Glassdoor, etc.). I don’t think that it’s too much of stretch to treat debugging and coding skills as highly correlated. I think that something like a rational arithmetic library isn’t a bad question (is that perhaps what they wanted?)
 
Some interviewers I know ask things like this. The difficulty is that it’s much harder to come up with questions like this, especially when the answers start getting around (Glassdoor, etc.).
There is the eternal fountain of bugs in production that solve that problem.

I think that something like a rational arithmetic library isn’t a bad question (is that perhaps what they wanted?)
I think it is pretty comprehensive, as you can cover unit tests as well.
 
:)


A BSOD is a certainty a possibility. My follow up would be, to ask under which circumstances it would BSOD?
1) Running windows < 10 otherwise the colour changes
2) accessing an address which is not in the program's allocated memory space

NB, I'm not a coder so I don't expect to get these right.

I'm still going with heat death though.
 
1) Running windows < 10 otherwise the colour changes
2) accessing an address which is not in the program's allocated memory space

NB, I'm not a coder so I don't expect to get these right.

I'm still going with heat death though.

2 is correct, but only if you are running in ring 0/kernel mode (ie, kernel mode driver or Core OS code). Otherwise when the page fault handler can’t find the page, it will just tear down the process.
 
I don't get it
With programming software, you are not always aware of all the constraints and requirements, being able to come up with a clear logical answer, code it so that others can follow that logic, and extend it when required, that is the hallmark of a good coder. Reason, logic and domain specific experience
 
That's the problem with the necro-revival-threads, somebody (aka @John_Phoenix) inevitably ends up responding to a very old post.
 
Top
Sign up to the MyBroadband newsletter
X