Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Is my starter interview question too simple?
6 points by faanghacker 14 days ago | hide | past | favorite | 25 comments
I conduct SWE candidate interviews at Google. My first question is intended to be a conceptually simple one, where the candidate must translate a certain everyday business logic into code. The logic has to do with counting the number of days from the beginning of the year, for a given date. I provide the number of days per month if the candidate doesn't know them. I also provide a function to check for leap years. There isn't anything inherently tricky about it.

I added this question as a warm-up question before the other two main questions that are more conventional coding interview questions that involve algorithms and data structures. The solution is simpler than the solution to the two main questions.

To my surprise, I found that most candidates take half of the 45 minutes allotted to do this question. It's only meant to take no more than 10 minutes. Many do the other two questions in less time.

While I won't directly post the question here, I wonder if it's so simple that my candidates are wondering if there's a hidden trick. Could that be why the candidates are taking so long?

This might come as a surprise, but a whole bunch of people going around out there have no clue whatsoever when it comes to this stuff. They believed in the race to the bottom, that literally anyone can do this kind of thing, and decided to back it up when applying.

I'm not saying you're getting all of the bad ones, but there's probably something going on if a supposedly simple problem (this, FizzBuzz, pick whatever you want) fails. Yeah, I know, someone's going to mention the environment, and the pressure of it being an interview, and that's certainly true.

All I can say to that is that I've posed FizzBuzz itself to someone who claimed aptitude, totally randomly over a chat session, not as part of an interview, just us chatting randomly. I think we were actually talking about how interviewing was such a pain. They themselves talked a great deal... but then never delivered on it.

Besides, you work at Google. Don't you see this all around you? They're already on the inside.

You say:

1. [The] question is intended to be a conceptually simple one.

2. There isn't anything inherently tricky about it.

3. I won't directly post the question here.

Without the question we can't tell you if it's simple to grasp. In other words, we can't evaluate the question from its solution.

Do they know it's a warmup and how much time you expect them to spend on it? I can easily imagine doing the question methodically and talking through my approach, and spending 20 min to do so. And I can also see the value in a candidate that approaches it that way, vs one who fires off the answer without doing some planning, even if it's an easy question.

I dont have context to know how you're asking it, but if you're not already, be clear about what you're looking for in the answer and the amount of time / effort you think the candidate should spend.

How should I respond if I tell them it's a warmup that shouldn't take more than 10 minutes, and they're still having trouble? Isn't that going to demoralize them?

It might be possible that candidates are afraid that their solution is not clever enough for you, i.e they assume that you want something like a one line formula that only contains numbers and basic arithmetic operators.

The way I would solve something like that is by mentioning that it is a good approach to do time calculations with some library functions so that I won't have to deal with all the weird edge cases, then start with a loop over the months and later refine that to get rid of the loop, but it is very much possible that an interviewer might view this loop negatively.

There might also be some cultural aspects. While the Gregorian calendar is probably somehow used everywhere in the world, I think there might also be some other calendar formats being used in parallel.

If it is the first interview of the day, maybe the candidates are also just nervous? I remember when I had my on site interview at Google, the first warm up question had something to do with probability and could be easily solved with linearity of expectation. In the months before that interview I had dealt quite a lot with probability for my master thesis - but at that day I was quite nervous and I had not slept well, so I spend quite a lot of time on that question. I think I answered later questions better, although it was not enough in the end.

Do you usually see some correlation between the warm-up question and later performance?

I am not sure if that is necessary, but what might help is by starting to calculate the number of days from the start of the month and then adapt the question.

I've gotten some candidates who come from backgrounds with non gregorian calendars. In those cases we spend a minute talking about their calendar and then I ask them to write it for their calendar.

Is the business logic difficult to understand? From what you’ve described, counting the days sounds trivial, so I’d imagine it’s not the part people are stuck on. Saying that though, time in general is notoriously difficult to deal with. Maybe they are over complicating it in their own minds. It’s hard to say without knowing the question.

"I added this question as a warm-up question before the other two main questions that are more conventional coding interview questions that involve algorithms and data structures."

It sounds like the other two questions are rehearsed and expected, while the warm-up question is unexpected.

Coming from my own experience interviewing at Google. This problem is seems relatively simple to what I have been asked in coding interviews.

I have faced this in a coding interview(not at google). The coding question was so simple that I spent talking about different scenarios and edge cases that I was slower than expected. The interviewer said that, I have completed the most challenging part and its only a basic if statement. THAT'S IT! And I was like "This can't just be this?. There is a trick or I been getting ask a trick question here". As a candidate who has personally faced this an interview, preparing for FAANG interview sets the coding questions bar so high that even simple questions need to be analyzed over and over because as per a candidate this can't be that easy, right?!

It sounds tricky, not because it's hard, but because of all the exceptions to date format.

If we simplify it to be fake dates by assuming all months have 30 days, and the input is MM/DD (i.e. 04/30), then it's trivial, multiplying MM*30 + DD.

That said, the solution for the real dates, would just be a bunch of maps ... month numbers mapped to how many days they have, { 1: 31, 2: 28 }, etc. Same for leap years, another map. And then it's the same formula as above but looking up the values first.

In other words, this may be hard for the wrong reasons I feel. Junior candidates would take longer, but it's bcause of the exceptions of date format. Perhaps you can think of a similar problem that uses something other than dates, and that has more regularity in its type.

They usually figure out the mapping/array of dates per month early.

If you play chess and want to improve your game, then one of the best ways to do it is to make it a a habit to ALWAYS take at least 30 seconds for every move. Even for very trivial recaptures. This is because in chess one small mistake is enough to blow the whole game. You may be observing something similar. The time candidates take on your warmup question may not be indicative of skill.

Initially I thought about adding an “expected finishing time” next to it might be a good idea, but now I think that would just be another source of stress. A better idea might be having a difficulty indicator such as labeling questions as (one/two/three star).

What does this give you over jumping straight to the conventional questions? If the main goal of the interview is to extract signal about coding and general problem solving ability, why not just do the other two problems?

Also, seemingly simple tasks can get people tangled up, particularly in an interview situation: there is a performance aspect to interviews, and this type of question can trip up people who are expecting your typical array/hashtable/linked-list style questions.

Why don’t you just have a smalltalk about candidate’s experience as a warm up?

Whats the point of wasting time and attention span on dumb question if the real ones are following?

If they failed the warm up but passed the other two would they get a good rating from you?

If they passed the warm up but failed one of the other two would they get a good rating from you?

The warm up seems pretty unnecessary.

As for your question unless you can determine some correlation with the time taken for warm up and acceptance - why does it really matter how long it takes them? I’d make the question even simpler, making all days of months the same and eliminating leap year logic.

I would make sure I set expectations and say this is a 10 minute problem. I would also expect them to take longer than you, and usually 3x longer is a good estimate. Candidates are nervous and brains do strange things. I was give the exact same coding question I’ve asked dozens of time and I _forgot_ the solution and had to do it from first principles.

If the questions can just be remembered then they're completely pointless

It was and is supposed to be solvable from first principles. It wasn’t a “gotcha” or “stump the idiot” question. Like any question, it would be easier if you know it first. The point of the post is that things that people know may be hard to remember during the interview and to give them more time than you would need for the same question yourself.

Fizzbuzz could take an hour if you go after it from every angle. Be honest with yourself. Your "main question" would personally take you at least thirty minutes to properly explore had you never seen it before. Dispense with the warm-up. Finish the interview on-time for once in your life.

We don't explore it from every angle. I try to speed them up by saying things like "first 3 months have 31/28/31 days, and use '...' for the remaining days so you don't have to write it out.

A few candidates have finished in under 5 minutes.

Great, I take everything back. Ask the warmup, and the warmup alone, as that seems to yield precisely the desired subset in five minutes time, and you can go back to your real work.

You have the evidence in front of you. It seems like you didn't test the question out before putting it in front of interviewees. You need to take into account stress as well.

Why don't you ask them?

This is too easy, you’re just wasting everyone’s time by asking this. (Maybe that’s your goal.) And yes, many candidates will think it’s a trick question. I would spend the time asking questions you can get meaningful signal from.

As an aside, I found this kind of time wasting question to be not uncommon at Google and other FAANGs.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact