Live data from Hacker News

Ask HN: Can engineers from Google or Facebook solve whiteboard questions easily?

news.ycombinator.com

11–20 of 206 posts

Re: Ask HN: Can engineers from Google or Facebook solve whiteboard questions easily?

#11
post #5

Earlier quoted context omitted.

> algorithmic primitives from which modern algorithms are born. What is a good way to learn more about these?

The only reason it seems to even learn them is to pass an interview... What a utterly stupid and broken process. All it's testing is recall, that you've memorized some algorithms that 99% of developers will never need. Especially when these are really hard problems that people have studied for years, to think that anyone who hasn't memorised the solution is working this stuff out in an hour on a whiteboard is crazine…

There is nothing about learning how basic data structures and algorithms work that won't help you in your day to day development.

You might be "fine" without it in a certain category of job, but rather than be dismissive about it you could be excited about having a massive wealth of information that you can use to do your job better.

There will always be something else to learn, wether it be how to apply Domain Driven Design to your work or how to work with graphs when munging data. It's always worth it.

[edit] Run on sentence

Re: Ask HN: Can engineers from Google or Facebook solve whiteboard questions easily?

#12
I often do, both for fun and to prepare myself to give a question I'd like to use in an interview. The thing about interview questions at Google is there's a very fine line they need to walk: if they're too easy they give no useful information about the candidate, and if they're too hard they can never be solved in 45 minutes, again yielding no useful information. You also need to be able to provide some hints, because the vast majority of candidates need a prod in the right direction now and then.

As someone with access to the entire canon of Google interview questions, I've gone through the 20 or 30 with the highest rating, and none of them are ridiculously hard. The general pattern is either 1. a coding problem, meaning a relatively easy algorithm with plenty of opportunities to screw up the implementation so we can see how well you code and how well you catch your own errors, test your code, etc and 2. an algorithms problem that's really just a dressed-up version of some basic algorithm like BFS or dynamic programming so we can see if you can make the leap from theory to application.

Obviously I'm at an advantage here because I've seen most of the questions in use today, but whenever I encounter a new one I can intuit what's being asked and what it'll take to solve. I'm sure other companies have different sorts of questions that optimize for different things, but for our questions once you do enough of them you can sort of do any of them.

--

By the way, in my experience, those seem to be the biggest pitfalls for both job candidates at Google and programmers I meet in the real world. Sure, you crammed algorithms before you came here, but can you apply them in any real-world way? Sure you know your web/mobile app framework back to front, but will you hit a wall when asked to do something novel? Sure you can write a for loop to iterate over a data set, but will you fall on your face when that data set is petabytes in size?

I've become good at Google's questions because they generally test for those two things: nitty-gritty coding skills and an ability to generalize basic algorithms. The best candidates are those who know their algorithms inside and out, have the ability to break down and transform a problem until they can apply something in their toolkit, and have the coding chops to translate their concept into an implementation. All skills which, you may notice, make for a good engineer.

If you've ever wondered why we still do whiteboard interviews, that's why. Except you can use a chromebook now if you prefer, but you get the point.

Re: Ask HN: Can engineers from Google or Facebook solve whiteboard questions easily?

#13
post #5

Earlier quoted context omitted.

> algorithmic primitives from which modern algorithms are born. What is a good way to learn more about these?

The only reason it seems to even learn them is to pass an interview... What a utterly stupid and broken process. All it's testing is recall, that you've memorized some algorithms that 99% of developers will never need. Especially when these are really hard problems that people have studied for years, to think that anyone who hasn't memorised the solution is working this stuff out in an hour on a whiteboard is crazine…

What better way is there to try and get the best assessment of someone’s coding ability in a 45 minute timeframe?

Re: Ask HN: Can engineers from Google or Facebook solve whiteboard questions easily?

#14
post #5

Earlier quoted context omitted.

> algorithmic primitives from which modern algorithms are born. What is a good way to learn more about these?

The only reason it seems to even learn them is to pass an interview... What a utterly stupid and broken process. All it's testing is recall, that you've memorized some algorithms that 99% of developers will never need. Especially when these are really hard problems that people have studied for years, to think that anyone who hasn't memorised the solution is working this stuff out in an hour on a whiteboard is crazine…

"these are really hard problems that people have studied for years"

Because of this. So that when you encounter a problem, you know how it can be solved efficiently. If you disregard existing knowledge, you are likely to spend a lot of time cooking up something complex and half-assed that creates an unnecessary maintenance load.

Like music is composed of fundamentals, similarly most problems in computing can be decomposed such that familiar approaches can be applied to them. I think the categorization of Aho's "Foundations of Computer Science" is pretty much to the point on which fundamental formulations are practical to know.

Re: Ask HN: Can engineers from Google or Facebook solve whiteboard questions easily?

#15
What do you mean by "whiteboard questions"?

The ones I had at my FB interviews are questions I would describe as "any competent engineer should be able to solve most of these in an interview slot" sort of questions — Simple data structures (sometimes explicit, sometimes implicit as part of the problem statement), simple strategies (breadth first, depth first), and a basic understanding of time (and space!) complexity.

Of course, you can hike up the difficulty a tonne (e.g. by replacing plain binary trees with red/black trees) and progressively fewer people will be able to solve those, but in my experience that's not common in an interview environment at FB.

Ultimately, the fact that the interview process includes whiteboard questions means that people at those companies _do_ perform decently (for some definition of decently) at those problems — that's how people are selected.

Re: Ask HN: Can engineers from Google or Facebook solve whiteboard questions easily?

#16
post #5

Earlier quoted context omitted.

The only reason it seems to even learn them is to pass an interview... What a utterly stupid and broken process. All it's testing is recall, that you've memorized some algorithms that 99% of developers will never need. Especially when these are really hard problems that people have studied for years, to think that anyone who hasn't memorised the solution is working this stuff out in an hour on a whiteboard is crazine…

There is nothing about learning how basic data structures and algorithms work that won't help you in your day to day development. You might be "fine" without it in a certain category of job, but rather than be dismissive about it you could be excited about having a massive wealth of information that you can use to do your job better. There will always be something else to learn, wether it be how to apply Domain Drive…

> There is nothing about learning how basic data structures and algorithms work that won't help you in your day to day development.

Having a basic understanding of these things is NOT the same as being able to regurgitate them on a whiteboard, under the stress of the interview process.

Re: Ask HN: Can engineers from Google or Facebook solve whiteboard questions easily?

#17
post #2

I work for Google and have never been good at the "Here's an NP-hard problem you haven't heard of, write correct code for nlogn solution on whiteboard in language of choice" question. I had to train extensively (reading CLR, practicing) to be able to pass. However, large numbers of engineers at Google are very good at solving whiteboard questions. A lot of it comes from practice, a lot comes from knowing the common p…

I have worked at Google for 7 years. I am a SWE and mostly agree with the parent.

I am, I think objectively, a pretty good software engineer and often couldn't solve my peers interview questions in the time allotted. I try to do my part by conducting interviews with questions that I think demonstrate the ability to actually code and think abstractly as opposed to regurgitating some random algorithm that has been memorized. I ask a simple CS 100-200 level, one-word-answer question about an algorithm and then move on to a coding question.

Despite the difficulty of some of the questions that others ask, often the interviewer wants the interviewee to pass and so will throw a hint. It's important to keep commicating because that is how those hints will be delivered.

Ironically, I never interviewed because I came in from an acquisition. Yes, I was very lucky.

Re: Ask HN: Can engineers from Google or Facebook solve whiteboard questions easily?

#18
post #5

Earlier quoted context omitted.

> algorithmic primitives from which modern algorithms are born. What is a good way to learn more about these?

The only reason it seems to even learn them is to pass an interview... What a utterly stupid and broken process. All it's testing is recall, that you've memorized some algorithms that 99% of developers will never need. Especially when these are really hard problems that people have studied for years, to think that anyone who hasn't memorised the solution is working this stuff out in an hour on a whiteboard is crazine…

> The only reason it seems to even learn them is to pass an interview...

While I agree that the process is broken, a solid understanding of algorithms and data structures is very important for developers at my company. And nobody knows all, or even most of the algos or data structures! But we do have large amounts of data and some pretty complex analytic problems, and a poor design can cost a lot of time and AWS $. Likewise over-engineering something small is a waste of time not just in writing but maintaining it.

I agree that most e-commerce or business web developent probably don't need this level of formal skill.

Whiteboard questions are useful, but not for figuring out trick questions. Instead for figuring out how the candidate approaches problems.

Re: Ask HN: Can engineers from Google or Facebook solve whiteboard questions easily?

#19
post #13
post #5

Earlier quoted context omitted.

The only reason it seems to even learn them is to pass an interview... What a utterly stupid and broken process. All it's testing is recall, that you've memorized some algorithms that 99% of developers will never need. Especially when these are really hard problems that people have studied for years, to think that anyone who hasn't memorised the solution is working this stuff out in an hour on a whiteboard is crazine…

What better way is there to try and get the best assessment of someone’s coding ability in a 45 minute timeframe?

IMO not doing it. Why'd you do it? There are much more important factors than someone's ability to do a whiteboard exercise while under stress. You can e.g. check their Github, ask them to make a simple example project at home, etc.

Re: Ask HN: Can engineers from Google or Facebook solve whiteboard questions easily?

#20
post #12

I often do, both for fun and to prepare myself to give a question I'd like to use in an interview. The thing about interview questions at Google is there's a very fine line they need to walk: if they're too easy they give no useful information about the candidate, and if they're too hard they can never be solved in 45 minutes, again yielding no useful information. You also need to be able to provide some hints, becau…

> Sure you can write a for loop to iterate over a data set, but will you fall on your face when that data set is petabytes in size?

I also asked a question in HN yesterday. It looks like there are more questions on data structure and algorithm for big data. However, books I read don't focus much in this area. As I haven't worked on big data before, that would also be a challenge for me.

Post reply on HN