News for hackers. Stuff that matters.
Re:Optimizations on Linear Search (2016) by kevinventullo on Sunday October 04, 2020 @09:04AM (#24678737)
> Now you have to check that your vector has at least one element.

Which may lead the candidate to ask the interviewer “What should be the behavior on an empty vector?” Returning MIN_INT or throwing an exception may both be reasonable depending on the application, but I would consider it good signal if the candidate at least acknowledges that this is an edge case.

There are no comments on this comment yet.