3 ms·
> 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
by kevinventullo 6y ago
> 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.