3 ms·
This is not cheating. Tech companies are literally looking for candidates who have seen the problem before. If they were truly testing for engineering skills,
by nine_zeros 4y ago
This is not cheating. Tech companies are literally looking for candidates who have seen the problem before.
If they were truly testing for engineering skills, the interview would mirror real day to day world more.
- rurban 4y agoIf this would have been true, he would have asked about Gauss (it's one of the most famous math tricks in highschool afterall). he didn't ask, op didn't know either. so I would have suspected cheating. op's answer is constant n, but could have been improved to n/2 on average with a hash table. (but some constant overhead). so it really depends on the size of n.