News for hackers. Stuff that matters.
Re:Whiteboard interviews are a test of obedience, not intell... by tedunangst on Monday June 03, 2024 @06:02PM (#40568103)
This will be shocking, but honestly, the point of asking someone to code up fizzbuzz on the whiteboard is not sifting for obedient slaves. Hand to god, chop down the cherry tree, no lie.
Re:Whiteboard interviews are a test of obedience, not intell... by zaptheimpaler on Monday June 03, 2024 @06:10PM (#40568182)
It isn't if the problem is FizzBuzz or a slightly more challenging and realistic problem. When its 1-2 leetcode hards in 45 minutes that can only be solved by having done hundreds of those problems, it does seem the purpose is more to just gauge how many such problems you've spent time grinding on before even though they have very little relevance to programming.
Re:Whiteboard interviews are a test of obedience, not intell... by titanomachy on Monday June 03, 2024 @06:34PM (#40568420)
I've interviewed at various "prestigious" companies widely considered to be rigorous in their interviewing, and no one has ever asked me to solve 2 leetcode hards in 45 minutes. I think I might have gotten one leetcode hard question ever. Most companies seem to ask relatively straightforward questions, although they do sometimes expect you to solve them quite quickly.

Doing a bunch of leetcode problems (something like 20-30 hours over a few weeks) certainly made it easier to answer questions quickly, largely by becoming more fluent in the language and libraries.

Re:Whiteboard interviews are a test of obedience, not intell... by whimsicalism on Monday June 03, 2024 @06:50PM (#40568569)
Whenever someone tells me they've been asked a leetcode hard in an interview, I always ask them "which one". I don't think I've ever gotten a response that was an actual LC hard.

This is the only LC hard I've ever been asked in an actual interview https://leetcode.com/problems/shortest-path-in-a-grid-with-o...

Re:Whiteboard interviews are a test of obedience, not intell... by titanomachy on Monday June 03, 2024 @07:01PM (#40568696)
I once got asked something like this (at Google): https://leetcode.com/problems/expression-add-operators/descr...

Pretty sure all the others were easy or medium.

Re:Whiteboard interviews are a test of obedience, not intell... by tzs on Monday June 03, 2024 @10:37PM (#40570153)
I'm curious why the rated that one hard.

They say the maximum length of the input digit string is 10, so there are at most 9 places where an operator can be inserted. At each possible insertion point there are 4 possibilities: insert one of the 3 allowed operators or do not insert anything.

That's only 262144 possible expressions. Just brute force evaluating all of them, filtering out the ones that do not equal the target, and then filtering out those that violate the no leading zeros requirement should be fast enough even on a slow computer.

The other hard ones I've seen have all allowed inputs large enough that brute forcing would be way too slow, and so cleverness is required. E.g., that shortest path in a grid problem that was posted a comment or two above. My first thoughts on that one were to just generate all possible paths with the obstacles ignored, and then find the shortest path(s) that do not cross more than the number of obstacles we are allowed to eliminate.

But the grid can be up to 40x40. By 10x10 we're already up to 41044208702632496804 possible paths [1], so brute force is not an option.

[1] https://oeis.org/A007764

Re:Whiteboard interviews are a test of obedience, not intell... by titanomachy on Tuesday June 04, 2024 @09:02AM (#40574142)
When I got this in an interview they definitely wanted better than brute force.
Re:Whiteboard interviews are a test of obedience, not intell... by whimsicalism on Tuesday June 04, 2024 @11:40AM (#40575738)
really? it says it’s a backtracking solution. i imagine you could speed it up a bit by memoizing, but it would still be pretty brute force
Re:Whiteboard interviews are a test of obedience, not intell... by Mystrl on Monday June 03, 2024 @08:27PM (#40569369)
Oh hey that's the question I got for my recent amazon onsite (slightly different constraints). I couldn't find the exact question online and I thought it was a "fair" medium question. IMO this is a pretty good question there's a really easy suboptimal solution so people don't get completely stuck, the optimizations are pretty straightforward and there's a lot of room to demonstrate you can write clean code.

*Fair meaning there's no crazy tricks to it or any obscure algorithms just applying DSA fundamentals.

Re:Whiteboard interviews are a test of obedience, not intell... by jmd42 on Monday June 03, 2024 @09:14PM (#40569671)
Right - I think it's fair to expect somebody to come up with some kind of approach to solving this, even if they've never encountered the problem or drilled Leetcode before. At least to be able to conceptualize the problem and make a decent attempt.

I wouldn't expect more than brute force. But being able to reason about this, having some working familiarity with graphs etc, is not an unfair bar.

Re:Whiteboard interviews are a test of obedience, not intell... by Aurornis on Monday June 03, 2024 @07:23PM (#40568889)
I was in a Slack dedicated to interviewing for a while. People reported their experience back.

Lot of people claimed they got "Leetcode Hards" after failing an interview, but none of them could ever point to the actual question they failed, or even remember it!

I'm sure some interviewers somewhere like to mix LC Hards into the interview loop, but it doesn't appear to be as common as internet comments make it sound.

Re:Whiteboard interviews are a test of obedience, not intell... by tikhonj on Monday June 03, 2024 @06:58PM (#40568664)
I haven't done any Leetcode so I have no idea of what "medium"/"hard"/etc are, but the last time I interviewed, the two problems I failed were very fiddly dynamic programming problems—the hard part was not even the dynamic programming, but rather the problem-specific setup (based on chess rules and geometry, respectively).

I am sure I would have done better at those with practice, entirely because I would have seen lots more fiddly dynamic programming problems and not because I would have picked up any general-purpose skills or knowledge I don't have as-is.

Re:Whiteboard interviews are a test of obedience, not intell... by crooked-v on Monday June 03, 2024 @06:42PM (#40568482)
Leetcode questions are definitely step 1 in Meta interviews, at least as of the round I went through earlier this year.
Re:Whiteboard interviews are a test of obedience, not intell... by titanomachy on Monday June 03, 2024 @06:48PM (#40568542)
I do get lots of leetcode-style questions, just not leetcode hard questions.
Re:Whiteboard interviews are a test of obedience, not intell... by robertlagrant on Monday June 03, 2024 @06:45PM (#40568517)
I did Meta in about 2020 and they did not ask anything like that in step 1. They asked a single question that I had about 20 minutes to figure out. Nothing particularly leet codey about it; just a question that was basically asking for a dictionary implementation that also had a list for most recent access. The point wasn't the advanced algorithm; it was comprehension and a bit of code.
Re:Whiteboard interviews are a test of obedience, not intell... by whimsicalism on Monday June 03, 2024 @06:49PM (#40568549)
2 leetcode hards is just absolutely an exaggeration, i've done tons of these interviews and i've only been asked a formal "LC hard" once and that one I believe was a misclassification and was probably more of a medium
Re:Whiteboard interviews are a test of obedience, not intell... by tzs on Monday June 03, 2024 @10:11PM (#40570026)
I've seen Leetcode problems that Leetcode classifies as "Hard" where it is actually not at all hard to come up with an algorithm that would solve them in O(n^2) time and/or space, and this would be fast enough in almost all cases, but the problem specification specifically asks for something faster and it is achieving that that makes the problem difficult.

When companies use such a problem do they usually include the time and/or space constraints from Leetcode or are they usually fine with O(n^2)?

Re:Whiteboard interviews are a test of obedience, not intell... by eindiran on Monday June 03, 2024 @06:09PM (#40568172)
At some point the test stopped being fizz buzz and started being "reproduce Brent's cycle detection algorithm from memory or from first principles if you have forgotten what it is", which isn't testing your ability to program in any meaningful way.
Re:Whiteboard interviews are a test of obedience, not intell... by convolvatron on Monday June 03, 2024 @06:21PM (#40568300)
i used to ask cycles in a graph. we were building a database, used graphs alot.

if we cant talk about the problem together from first principles and make some progress, and you cant demonstrate that you're tracking the discussion at all then we cant work together on that database.

sure, for devops, who cares.

Re:Whiteboard interviews are a test of obedience, not intell... by kristjansson on Monday June 03, 2024 @06:16PM (#40568246)
Whiteboard questions are great, if the question is like two orders of magnitude simpler than the day to day. At that point you’re answering “has this person seen a computer before, and are they able to do the simplest possible task?”. Which I think your experience has also shown, can be a live question for far more candidates than one would expect.

The problems come when a company overestimates that threshold, either by selecting too hard a task, or believing their work requires more than it does. Then the question selects for (a) savants and (b) people who study for interviews. Unsurprisingly (b)s outnumber (a)s, and then get pissed when they realize how disconnected the material they studied is from the job, and write things like TFA.

Re:Whiteboard interviews are a test of obedience, not intell... by tikhonj on Monday June 03, 2024 @06:55PM (#40568623)
The purpose of a system is what it does. And what Leetcode-style whiteboarding tests—very much not fizzbuzz!—substantially do is select for people who have specifically prepared for Leetcode-style problems.

Describing that as selecting for "obedience" is rather dramatic and provocative, but it's directionally right.

That's what the article is about, it isn't about the sort of basic programming test that anybody should be able to pass without explicit preparation.

Re:Whiteboard interviews are a test of obedience, not intell... by roncesvalles on Monday June 03, 2024 @09:23PM (#40569718)
I mostly see them as a way to filter out people who are out of the loop, which turns out to be a pretty decent proxy for a lot of things.