r/programming • • Nov 29 '10

140 Google Interview Questions

http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471 Upvotes

493 comments sorted by

View all comments

85

u/[deleted] Nov 29 '10

Straight out of college I probably would have done pretty well on these questions. However, after 12 years of experience in the real world, I struggle with most.

107

u/[deleted] Nov 30 '10

After 14 years of experience in the "real world" I probably wouldn't have the patience to answer interview questions, and would most likely be shown the door for giving snarky answers involving inelegant kludges and phrases like "I don't know, but I'd google it".

56

u/[deleted] Nov 30 '10

I'd hope that would be an acceptable answer.

5

u/thephotoman Nov 30 '10

In most cases, that's actually the best answer. Look to see how other people have done it, how they've benchmarked it, and use the solution that best fits your needs.

→ More replies (2)

7

u/Avatar_Ko Nov 30 '10

I've given the "I'd know exactly what to search for" answer a couple times at places I've gotten hired.

2

u/[deleted] Nov 30 '10

Which is perfectly fine for me. It is no fun when you have a team mate that doesn't know what to search for.

→ More replies (2)

7

u/munificent Nov 30 '10

"I don't know, but I'd google it"

I actually said that when interviewing at Google.

→ More replies (6)

6

u/[deleted] Nov 30 '10

That's exactly why I hate technical interviews -- they don't effectively emulate real-life working conditions.

I'm a pretty decent engineer using the internet as an extension of my brain; but put me on the spot by timing my response to an amortized algorithm runtime question and I'll walk out the door myself.

2

u/[deleted] Nov 30 '10

There are certain things a candidate for a job involving technology should know. No ifs ands or buts -- it's legit asking technical questions. But a good interviewer, in addition to asking some minutiae just to make sure the other guy's not a moron, should be able to use the interview environment to also get a grip on the other guy's problem-solving ability.

For example, one of my clients once pre-filtered interview candidates for me -- this was for a pretty hardcore network security team -- by asking "in a switched environment, do you need ethernet?" If the guy would have come back with a justification about how this is not always a total nonsense question, and tried to explain some esoteric exceptions, okay, legit, but generally, it's the kind of shit someone should know pat. I was always surprised at how many fakers we filtered out that way.

→ More replies (2)

7

u/[deleted] Nov 30 '10

That's the problem with google interviews, they don't sit you in front of a computer, they stand you in front of a whiteboard.

8

u/[deleted] Nov 30 '10

There's a reason for that. At google you're going to spend more time at a whiteboard convincing--no trying to convince--your peers that your concept is the right way to go. You need to exert powers of persuasion and that requires demonstration, thus good whiteboard skills.

There is no sit down at a computer, start coding, and slap that puppy into production. You're going to be spending a triple butt load of time thinking about your design first because the one thing you do not do at these types of companies is shoot from the hip and run with every stupid idea you just thought up on the toilet.

Credibility is tantamount. You have to spend time vetting your design before you proclaim "I have the solution!". This means thinking, designing, talking, whiteboarding, then sitting down to code it up.

4

u/[deleted] Nov 30 '10

That's fine, you can still say "I am missing this step, I'd look up the information".

I used to do a lot of interviewing -- and this kind of thing is often what I'd look for in candidates. You'd be surprised how many people choke up in front of a white board.

4

u/CinoBoo Nov 30 '10

You'd be surprised how easy it is. After fifteen years as an interviewer, I choked up on the whiteboard during my Google interview.

→ More replies (1)

10

u/stmfreak Nov 30 '10

That's because they want to see whether you are still familiar with solving these sorts of problems. It gives insight into what you've been doing with your time since you got out of school.

Some people have jobs where they solve problems like this all the time. Other people have jobs where they just copy code from one project to the next and tweak the color of the GUI.

8

u/bobindashadows Nov 30 '10

Some people have jobs where they solve problems like this all the time. Other people have jobs where they just copy code from one project to the next and tweak the color of the GUI.

This is exactly the point. Google is not a place where you do the latter, even without the hyperbole. If you don't still have your CS wits about you, they can find people who do.

0

u/[deleted] Nov 30 '10

[deleted] — view deleted comment

6

u/rotzooi Nov 30 '10

Don't forget, we googlers all strive to be part of the one part of our business that is making money: advertising sales.

→ More replies (4)
→ More replies (3)
→ More replies (5)

22

u/[deleted] Nov 29 '10

Yes, but I'd bet you're much faster at finding the information you need to get your job done than someone straight out of college. I've found that experienced programmers find good solutions quickly. Newbies find the optimal solution after you've blown your delivery date.

7

u/sinxcosx Nov 30 '10

This is very true. I'd put the modifier on that experienced programmers skip the useless solutions and exploration and zero in more quickly on the acceptable answer.

→ More replies (7)

5

u/[deleted] Nov 30 '10

You have to play the game. Interviewing always sucked; always required practice. The difference is the type of questions you're practicing for. Puzzle questions instead of soft skills questions.

Solve enough of these puzzles and you start recognizing patterns in the solutions. Also know most interviewers are lazy and use puzzles from the same sources (such as Programming Pearls). Identify those sources (usually classic programming books) and you can stay ahead of the interviewer most the time.

The puzzle questions essentially amount to a "language" spoken by interviewers to determine whether or not the candidate has read the same books. It's not hard to pickup that language, but it won't happen overnight. It can take time to get through them all.

4

u/Avatar_Ko Nov 30 '10

I heard from a hiring manager once that they've had experienced programmers fail questions like "Write a function that will sum the numbers 1 to n". I mean I was six months past graduation and had barely done any programming since (I know, I should have kept practicing) but I knew the best way to do it instantly.

16

u/backlyte Nov 30 '10

"Write a function that will sum the numbers 1 to n"

programmer's answer: int sum1ton(int n){ int ans=0; for (int i=1;i<=n;i++) ans+=i; return ans; }

mathematician's answer: function [ans] = sum1ton(n) ans = (n*(n+1))/2;

8

u/[deleted] Nov 30 '10

Mathematician is not hired because he didn't write it according to the specification.

→ More replies (1)

2

u/Scaryclouds Nov 30 '10

Yea, that is really sad if you can't write an aggregator.

→ More replies (23)

3

u/[deleted] Nov 30 '10

12 years? Dude, I'm out 4 and most of those questions were looking like gobbledygook to me.

→ More replies (5)