Fog Creek Software
Discussion Board

Good interview approaches?

Comment on this design

class Engine {};
class Car : public Engine {};

(Stolen from someone else) - assuming it's an OO position, I think this is a great question.

Question with no answer. ("How many gas stations do you think the city of detroit has?") see how they think.  ("Well, the city has 1.6 Million people in it.  I fill up my gas tank twice a week.  The average person probably fills up less, because some people don't drive or have 1 car families.  That's 12 gallons a week on average.  A typical gas station probobably services about 1 customer per minute ... etc")

Give them a semi-hard (15 minutes to solve) problem and let them solve it in the language they claim the MOST competance in. 

4) Like #3, but make it a trivial (5 minutes) recursive function.

--> Does this sound good?


Matt H.
Tuesday, December 2, 2003

I do not like question 2: is it going to reveal somehing interesting about the person being interviewed? Really?

And why so many programming exercices? Ok, my question is why only small programming exercices?  Why not more CS theory? Let's see, I'd say: "Ok, by your curriculum you seem proficient in OO, so tell me what OO really means. Why going to OO having yet procedural/structured programming? Tell me like if I was a non OO programming related person."

If the guy starts to say nonsense words... well, you know. I'd follow with encapsulation and abstracion issues, short questions, easy ones if you know what it is programming about.

If he knows what he is talking about, make some questions like "We are going to forget OO and return to not OO programming, do you think it is a good idea? What can I create with OO and can not without?"

All that talking will give you a strong impression about his/her background related to CS. Is he/she coherent? Etc.

And, about the exercices, it's ok if you ask him/her to program in paper using exactly C++/Java/whatever syntax, but I'd rely more on procedures, algorithms, ideas. You can have got 2 kind of exercices: one it's about knowing the language, and another one is about solving problems (in invented language, for example).

Tuesday, December 2, 2003

I'm not a big OO guy so I don't get the first one.

Wouldn't you do:
class engine{ };

class car
  engine e;
  door[] d;
  // etc.

Tuesday, December 2, 2003

Mr.: You got it right.

Car has-a engine, not car is-a engine.

It's an inappropriate use of inheritance.

Matt H.
Tuesday, December 2, 2003

Wrong, different cars have different kinds of engines. It should be engine* e, not engine e.

Smart Alek
Tuesday, December 2, 2003

Actually, it should be:

template< class T >
class Car
    T engine;


Chris Tavares
Tuesday, December 2, 2003

> Wrong, different cars have different kinds of engines. It
> should be engine* e, not engine e.

That depends on your programming language.

Tuesday, December 2, 2003

This type of question was discussed ad nauseum in the "Tea in China" thread.

Here's something I really want to know. How many Gas Stations are there in New York, NY? I've only seen about 4 in my life. One on Houston & Broadway, one off the FDR, one in east 60's, and one on either 7th or 9th avenue, I forget where, probably in the 20's or 30's, I saw it when driving downtown one day.

New York as 12 million people, but few of them have cars. On the other hand, there's a LOT of taxi's. Now assuming taxi's are specially modified to hold extra gas (let's say twice your normal amount) and most gas tanks are designed to travel 400 miles, which is about 6.5 hours, a cab could go all day without refueling even under start/stop conditions. So that cab could refuel at the cab company, which is probably located in queens somewhere.

Also, cabs travel all over the city anyway, and certainly I've seen them refueling at Broadway & Houston, they would be OK with there being just a few gas stations because they're constantly going uptown, downtown, crosstown, etc.

Now I'm going to assume I've seen about 1/3 (more or less, who knows, I've probably seen much more than that) of the city south of Central Park, and that what I haven't seen is most likely resedential and industrial and therefore more likely to have a gas station than the 1/3 that I've seen. So 4 gas stations times 3 is 12 with a fudge factor of, let's say 3 gas stations is 15 gas stations south of Central Park.

Now, I'm going to double that number for dealing with north of the 60's because even though I don't know, I'm going to say that that area is more residential and less commercial. So about 30 gas stations on Manhattan Island.

A quick Google turns up:

GAS STATIONS (PETROL STATIONS, AUTOMOTIVE FUELS) (38 listings) File Created: 10-Nov-03
Tuesday, December 2, 2003

My favorite interview question is What is the difference between the number one and the numeral one?

Bryan Shaw
Tuesday, December 2, 2003

when I interviewed, the senior dev guy had several implementations of an algorithm (for calculating bowling scores) written in different languages.  He'd pick one in a language you didn't know (I got PL/1) and ask you to find the logic flaw in it.

Tuesday, December 2, 2003

Bryan, is there just one difference?  Is there a single-best interpretation of 'number' out there?  I thought that after the initial failures to axiomatize mathematics in set theory and Russell/Whitehead's system, people gave up on a single representation.  If you're just looking for details of Arabic numerals, that seems like a pretty trivial interview question to me.

Tuesday, December 2, 2003

Thanks for answering my question!

To pay-it-forward (so to speak) Dr. Math (and google) to the rescue:

Tuesday, December 2, 2003

That's an interesting site MR, but I think that Doctor Peterson's response is troubling in at least one respect.  He says that, for example, you wouldn't say that the number 'pi' doesn't exist because you can't write its value on a scrap of paper (it being irrational and all).  But does Chaitin's constant exist?  There's some danger in that definition.

Tuesday, December 2, 2003

Obviously the answer to Bryan's question is that there is no such thing as the numeral one, since one is a number, not a numeral. "1" on the other hand is a numeral, not a number. Bryan, what would a person's reply to the question tell you about their suitability for the job?

Tuesday, December 2, 2003

So, giving the job to someone that strokes your ego enough to like dumb questions is a good way to interview?

Simon Lucy
Tuesday, December 2, 2003

Matt H.,

I think that is a fine and well-thought out set of interview questions that will give you relevant information if you are hiring a developer.

Dennis Atkins
Tuesday, December 2, 2003

What sort of reply are you looking for in question 1?

It's pretty easy to reel off a response like "it's using inheritance instead of encapsulation", but I'd also mention that by using inheritance you're exposing the whole internal implementation of Engine to Car when it doesn't need to, and you'd have to recompile Car everytime Engine changes.

One of the problems I have in interviews is finding the right words to explain something. I can explain my current project to a non techy, because it's something I do quite a lot. I'd be hard pushed to explain what a pointer is to them, though, even though I understand what it is.

Better Than Being Unemployed...
Wednesday, December 3, 2003

> So, giving the job to someone that strokes your ego enough to like dumb questions is a good way to interview? <

Yes, if you want to hire an employee who will like your dumb management decisions.
Wednesday, December 3, 2003

I told a friend about Joel's "impossible question" (number of gas stations and the like).

He told me that a similar question was asked by Enrico Fermi. The question was "how many piano tuners are in Chicago?"


Nadav Aharoni
Thursday, December 4, 2003

*  Recent Topics

*  Fog Creek Home