4 ms·
Okay, so there's sort of a spectrum, with true puzzles (like "How many golf balls would fit inside a jumbo jet") on one side, and true work sample tests (like "
by wikwocket 11y ago
Okay, so there's sort of a spectrum, with true puzzles (like "How many golf balls would fit inside a jumbo jet") on one side, and true work sample tests (like "Work with us to address a programming challenge typical of what we do") on the other side.
True puzzles do not provide very much useful information, as they are often based on a trick, and don't actually overlap a lot with what we do. Even algorithmic puzzles are pretty dumb.
But problem solving, O(n), and composing algorithms is very important to what we do. So what I'm looking for when I ask you to write a function so solve X is:
- Can you understand a problem and critically think about it?
- Can you handle super-basic logic to work out a solution?
- Do you at least vaguely understand performance concerns, i.e. can you identify whether a given input is problematic, or talk about possible ways to improve it?
- cmorgan8506 11y agoI feel like there's always a "trick" to them though. For example, find the only non repeating number in the following sequence: 1,2,3,99,3,2,1. This can be done in O(n) time and 0(1) space if you use bitwise operators. Now, you either have experience with bitwise operations, or you don't (no pun intended). If you don't, you are very unlikely to approach it from that angle and likely won't get the optimal solution.
- rifung 11y agoThis is true, but I doubt they are just looking to see if you can find the answer. From my experience, they are much more interested in seeing how you approach the problem and can analyze your own algorithm's performance. I think if anything the latter is more important than coming up with optimal solution. I've definitely encountered questions where I wasn't familiar with a certain topic, and usually they'll realize it and just give me hints. I did also have interviewers who just watched me struggle though.
- wikwocket 11y agoNo, I would never ask a question with a trick in mind. I am not interviewing for people who know tricks, because approximately zero percent of our business problems can be solved with tricks. I am looking for competent execution, because that's what matters day-to-day. If I had asked a question like that, and if you can do some bitwise voodoo to solve it in O(n), great. But what I'd be looking for is, can you solve it all? Do you understand the problem statement enough to write a general sort of algorithm? If your first pass is O(n^4) and I point it out, can you understand this, and think of ways to improve? If I point out a problematic or erroneous input, can you reason about what will happen? Etc. I think this is what we need to look for in interviews. Certainly not, can you solve this brain teaser I read in a magazine.