3 ms·
Let’s not overthink this. Microsoft is using this test as a low-pass filter to get rid of candidates who would: - not find any answer in a few minutes - find
by whiplash451 4y ago
Let’s not overthink this. Microsoft is using this test as a low-pass filter to get rid of candidates who would:
- not find any answer in a few minutes
- find a wrong answer and argue about it in an obnoxious way
Any reasonable answer would probably do.
You would probably get more brownie points for asking what you need to optimize for (compute, storage) than providing what seems to be the best solution (using the sum trick).
- zwischenzug 4y agoExactly. It’s basically fizzbuzz. The fact that he thought about this in advance and had an answer ready to explain is also a green flag for such an early filter.