4 ms·
Your problem actually is a good illustration of the whiteboard test problems. I just tried it, and it was trivial to do in a minute or two on my laptop. Howeve
by PeterisP 7y ago
Your problem actually is a good illustration of the whiteboard test problems.
I just tried it, and it was trivial to do in a minute or two on my laptop. However, I did took note of two syntax mistakes that I made in the python REPL that were immediately obvious there and took seconds to fix, but which I most likely would not have noticed on a whiteboard.
So there's quite a bunch of problems where if the acceptable "format" of the answer is "hey, I'll just pull out my laptop from the backpack and push the solution to github in 15 minutes" then it'd be okay, but it'd be hard to do it while 'whiteboarding' without access to immediate feedback and easily accessible API documentation.
For example, I work in many languages, and for many APIs I can't remember whether in this particular language the same thing is called add or append or something else; e.g. I've worked on Java code for a dozen years and would be a quite productive Java developer, but since I haven't written any new code in Java for quite some time recently, I can't remember off of my head what's the right boilerplate to open a text file for reading in Java - it's something that a Java tutorial might have in the first pages right after Hello world, but I'd still have to look up the incantation to pass the encoding properly - there's like three Reader classes to instantiate and I don't recall their names off the top of my head.
- new299 7y agoDo you think you could rough out an answer on a whiteboard that would have roughly the right structure? When I used this question I wasn't looking for accurate syntax. If it was a solution that looked like it would work, after some debugging etc. I'd consider that a pass. Regardless most people couldn't answer it, which I considered surprising.
- PeterisP 7y agoSure, the structure is obvious; one was an issue of a method being named differently than I remembered, the other was an off-by-one error that'd show up in testing.
- new299 7y agoSo, it wasn’t obvious to many candidates I interviewed. For example, one candidate tried to create a solution involving 3 nested for loops.
- itronitron 7y agoAssuming these candidates already made it past an initial filter it would be interesting to ask the filtered out applicants the same question and see how well they do
- deanclatworthy 7y agoNobody is punishing trivial syntax errors in whiteboard interviews. Nobody is taking your code and checking it runs. It’s about your approach to problem solving and your ability to communicate that.
- JustSomeNobody 7y agoIs this really true though? I mean, I've been in development long enough to know that people go just plumb ape shit over the silliest things.
- davidjnelson 7y agoA cs professor at Stanford that hired at google said they _absolutely_ care if your code compiles and works correctly. This is the “coding fluency”[1] metric. The author of cracking the coding interview also touches on this. 1. https://www.programmercoach.com/2017/04/interview-insider-coding-fluency.html?m=1 https://www.programmercoach.com/2017/04/interview-insider-co...
- b3b0p 7y agoI also was able to solve it in a couple/few min after seeing the comment. I did have a couple issues, index was off by one, and didn't catch an issue if I had already seen the substring using a brute force nested loop, but otherwise it works (Python). Edit: I also did it without a nested loop using a dictionary. Why I didn't think of this initially I don't know. I've also had a couple FAANG onsites and get nervous as can be, but that's just a practice more and be more confident with my abilities problem I feel. No offers though yet. Still trying and practicing.