Sure, 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.
So, it wasn’t obvious to many candidates I interviewed. For example, one candidate tried to create a solution involving 3 nested for loops.
Re:Tech Interview Handbook
by itronitron on Sunday August 18, 2019 @02:00PM
(#20731757)
Assuming 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
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.