We had a debate a few days ago at work about some question we ask during interviews.
We are in the on-going process of hiring "junior" C++ developers which is kind-of new to the company (we used to hire only experienced programmers, but those are hard to find in our geographical area).
For more experienced applicants, we usually ask C++ questions, some code reading exercises and inheritance, cast, const-correctness, static questions. The goal being to check if the applicant has enough experience with the language (if somebody claims he has 6 years of experience with C++ but can't write a
const getter, then something is wrong for instance).
But for "junior" applicants, those kind of questions don't seem relevant: obviously junior people can't possibly know about all the features of a language, and it is expected of them that they will need some learning time.
I thought of asking a question like:
"Say you are a given a list of millions of integers. Write some function that computes the average of the numbers."
Obviously the main goal of this question isn't to get a perfect solution but to see how the applicant think. First he should ask about the list:
- How are the numbers organized ?
- Are they sorted ?
- Where do the numbers come from ? A file ? Some network socket ?
- Do we know the count of items beforehand ?
Then I expect him/her to raise several problems:
- The sum of the integers will likely overflow.
- Do we need an exact average or something close-enough will do ?
- What if the list is empty ?
- ...and so on.
Obviously, if the applicant doesn't know what classes, functions to use I tell him/her: he/she could get that information on the Internet in a real situation anyway.
Now, some of my coworkers think that is a terrible question because it is vague and open, claiming that "junior" applicants are stressed during interviews and can't think properly, making the test moot. I can see their point, but I still don't agree.
So my questions are: is this kind of question acceptable for testing "junior" applicants ? What makes a good "junior" interview question ?