3 ms·
I highly doubt I would ask if the inputs are sorted. I wouldn't expect them to be (why would they be, after all?), and I'd probably just give a solution that wo
by baddox 9y ago
I highly doubt I would ask if the inputs are sorted. I wouldn't expect them to be (why would they be, after all?), and I'd probably just give a solution that works regardless.
- FilterSweep 9y agoI think you just received some good interview advice, unintentionally.
- baddox 9y agoNot for interviewing for a company with reasonable interview practices.
- btschaegg 9y agoI agree. Also, since we're talking about two entries here, there really isn't much work to do... One could even argue that relying on the order of the items in this case is going to result in a worse design overall (it's one additional thing the caller can get wrong).