r/AskComputerScience • • Dec 13 '16

Is this example interview from Google an accurate representation of format and difficulty?

https://www.youtube.com/watch?v=XKu_SEDAykw
33 Upvotes

5 comments sorted by

22

u/Badgrs Dec 13 '16

Disclaimer: this is based on my experience with the final, on-site interview for an entry level software engineer position between 1 and 3 years ago. Interviews earlier in the process were easier and more behavioral, in my experience.

For an entry level software engineer position, it's fairly accurate. The question itself (find two values in a list that satisfy a condition) is definitely on the easier end of the spectrum, but most technical interview questions will follow a similar format, typically along the lines of

Given [some data] represented in [some fairly straightforward data structure] and [some logical condition], determine if [said condition] is true for [some data].

Or very similar variants like

Given [some data] represented in [some data structure], perform [some operation] and return [some sample of the data or condition about the data].

The questions are typically set up so that there are multiple "valid" solutions, e.g:

  • a naive, inefficient one (i.e. the n2 approach briefly mentioned as he got started)

  • a reasonable, but still inefficient one (i.e. the log(n)-ish approach with binary searches)

  • a good, potentially clever approach (i.e. the solution he landed on when the list was sorted)

  • a crazy, over-optimized approach that no sane interviewer would expect you to know/find, but may exist so that you can impress them

The questions will also scale to multiple "difficulties", e.g.:

  • with lots of simplifying assumptions (the data can assumed to be sorted, all integers, valid, etc.)

  • with realistic expectations (usually discarding some previous simplifying assumptions, e.g. the data can't be guaranteed to be sorted)

  • with "Google scale" (e.g. the data is astronomical in size and is impossible to fit in memory)

  • occasionally… they'll add an interesting or confusing requirement or constraint, sometimes this is to force you to find a more generic solution, other times it's to see if you can find a clever optimization with new assumptions.

However… and this is probably the most important bit… getting the question right is not the ultimate goal. Communicating how you think through the question is the most important thing that the interviewer wants to see. Second to that is familiarity with data structures, control flow, and a really solid grasp of complexity analysis.

Also, not all of the questions will be like this. It varies on who your interviewers are and what mood they're in (on-site interviews are typically several 1-on-1 interviews throughout the day, and a "non-interview interview" over lunch). There will likely be some "brain teaser-y" questions. There will likely be some stupidly specific questions that will completely stump you. The goal for you is to demonstrate your technical knowledge and critical thinking and communication skills. If you make it to the final interviews, your recruiter wants you to get hired.

Interviewing at Google is intense. Fun… but intense.

3

u/watsreddit Dec 13 '16

This does seem to me to be really easy. I would think the actual interviews would be a lot more difficult.

1

u/[deleted] Dec 17 '16

From my personal interview experience this definitely CAN be a real question. it's an easy one that's certainly below average in terms of algorithm difficulty, but definitely possible.

3

u/[deleted] Dec 14 '16

[removed] — view removed comment

1

u/watsreddit Dec 14 '16

Yeah I'm just guessing. I don't really know. It just seems surprisingly easy, which makes sense since they would want a simple example to demonstrate the approach one should take to technical interviews.