They're probably glad they didn't hire you either.
...and chances are that the interviewer would be fine with any of them, or ask questions after you've shown a solution.
If I'd asked such a question, and got no sense of pushback, I'd be a little nervous about hiring that person and having them need close supervision - because they were to scared to point out ambiguity in direction.
That's the exact opposite impression I have; someone who doesn't need to ask many questions, as long as they can justify their decisions well, is definitely more preferable to someone who constantly asks and needs to be lead every little step of the way.
Asking for clarification before starting isn't anywhere close to "needs to be lead every little step". If you are hiring a work crew for roadside ditch digging than your interview method might be a good idea, but for a job where implementation details matter - bad idea. One of my more difficult professional experiences was fighting the urge to displace blame for a wasted week of work, which would have been avoided had I asked for the tasking to be described back to me - or had he spoken up and said "Do you mean this or that?"
questions like that don't show you how they'll be on the job, they're an opportunity to see their thought process, but you won't get that without talking to them.
A better answer would be either "Yep sounds good to me" or something along the lines of "Let's step back and first define what a state machine should do".
Even if GP was not getting the job it is the responsibility of a good interviewer that GP leaves the room having learned something. If GP left this interview still not knowing what a state machine is (or what the interviewer thinks a state machine is) or no closer to an implementation of a state machine then the interviewer has failed as much as the candidate.
I strongly disagree. An interview is an assessment, not a tutorial.
When the CTO says “we need a thing”, I don’t sit down and start writing. I try to learn what we’ll need so I can build something that satisfies my stakeholders’ needs.
If I were interviewing you, and said “hey userbinator, make a paragraph”, and you did that without asking WTF I was talking about, the rest of the session may not go well.
they may be glad they didn't hire them, it's hard to say how they feel, but i bet they're one of those companies out their complaining they can't seem to hire anyone at any price.
At that point, it's probably best to stop arguing, and code. They probably want to argue with you about your code, not their spec.
But when I got the reply "Do you not know what a state machine is?", I think I might have thanked them for their time, and left. I would have been sorely tempted to come back with "Yes, a state machine is an abstraction, and you seem to want a concrete implementation, but you don't seem to want to fill in the details of your requirement. Is it a good use of our time together for me to complete your spec, so there's something for me to code up?"
It sounds like they didn't want you; perhaps your face didn't fit. They say most interviews are decided in the first couple of minutes.
def next_state(state):
if state == 90000:
return 0
return state + 1
But more seriously; once I was asked to implement offsetof in an interview for an entry level C++ position. I didn't quite remember that this was impossible during the heat of the interview, but I did remember enough to not produce an incorrect solution that relies on undefined behavior. I didn't get that job.
Me: So, each instance should represent a state, and include a list of states it could transition to, and methods to transition to them? Is that what you had in mind?
Them: Well, if that's what you think a state machine is, then sure.
Me: There are a million ways I could implement this. What context will this be used in? I can make sure I write something that meets those requirements.
Them: Do you not know what a state machine is?
Me: Of course. But how are you planning to use it?
Them: I can't believe you don't know what a state machine is.
So as far as I can tell, I have no idea how to implement one.
(I'm so glad I didn't get that job.)