28 ms·
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 har
by titanomachy 2y ago
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.
- crooked-v 2y agoLeetcode questions are definitely step 1 in Meta interviews, at least as of the round I went through earlier this year.
- robertlagrant 2y agoI 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.
- titanomachy 2y agoI do get lots of leetcode-style questions, just not leetcode hard questions.
- whimsicalism 2y agoWhenever 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-obstacles-elimination/description/ https://leetcode.com/problems/shortest-path-in-a-grid-with-o...
- titanomachy 2y agoI once got asked something like this (at Google): https://leetcode.com/problems/expression-add-operators/description/ https://leetcode.com/problems/expression-add-operators/descr... Pretty sure all the others were easy or medium.
- tzs 2y agoI'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 https://oeis.org/A007764
- titanomachy 2y agoWhen I got this in an interview they definitely wanted better than brute force.
- whimsicalism 2y agoreally? 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
- Mystrl 2y agoOh 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.
- tikhonj 2y agoI 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.
- Aurornis 2y agoI 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.