Hacker News new | past | comments | ask | show | jobs | submit login

I would have failed this question badly. I'm curious, how would you check that without access to any number or math operations? I think I would try something similar to what he did with his sum_table, but that too was disallowed. They're constraints I've never had to deal with, nor seen before.





Math operators like division aren’t native to your (traditional) cpu, they are implemented in code, for example using similar algorithms as the ones taught to us in grade school to multiply big numbers one digit at a time on paper and “long division”.

All math operations can be implemented with bitwise operators, too, i am pretty sure

Likely the interviewer specifically needed the candidate to do that, implement the math, and tried to steer them that way numerous times (no sum table, dont use the type system, no math operators). Thats likely also why they suggest allowing limited use of Google, because they realize many people will need a refresher on bitwise operations. But they don’t want to outright tell you what to search for, they needed to see some resourcefulness. When they suggested OP was cheating they likely didn’t mean it personally and actually wanted to help steer OP towards an acceptable solution. Rather than saying it’s cheating they could have said it avoids the main thing we need to see, or outright say “please implement the low level math from first principles”

In my opinion the candidate showed resourcefulness in their own way indeed, but sometimes its not even up to the person administering an interview for example if they have been given a rubric.


> Math operators like division aren’t native to your (traditional) cpu, they are implemented in code

If you are talking about tiny microprocessors or old ARM chips, sure. But so are programming languages! They should have really asked him to code his solution in machine code then. After all, that's what you typically do in a NodeJS job :)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: