3 ms·
EX1: You wrote code before asking for more details you fail. EX2: Then again some people view asking questions as stalling. This is interviewing, not a mathem
by mechanical_fish 16y ago
EX1: You wrote code before asking for more details you fail.
EX2: Then again some people view asking questions as stalling.
This is interviewing, not a mathematics competition or a judicial proceeding. It's not a test, it's a first date.
If your interviewer applies either of these rules so strictly that you "fail", you probably don't want to work for them...
...unless you really are the type of person who wants a work environment where such rules apply strictly, and you happen to have the same ruleset as the person who is interviewing you. In which case the two of you may work together very well, and the interview will be a big success.
The first rule of interviewing is: Although one of you is leading, and one of you is following, you are interviewing each other. It's a conversation. If I start out answering your question on a track that you don't want to follow -- integers and not vectors, Lisp but not ASM -- you need to lead me in the right direction, just as you would do if we were discussing a real problem. Your ability to guide the conversation, and my ability to follow, and our resultant ability to establish a rapport and keep the conversation moving, is what is under test here. The problem itself is far less important.
P.S. I have seen that XOR trick before, once, but it still blows my mind. I can never understand it without spending half an hour in a corner muttering to myself. Is there a field where that trick is so idiomatic that it's a reasonable thing to expect a candidate to come up with it an interview?
- sushantsharma 16y agoyou don't have to use xor, this will work and perhaps easy to follow /* assume x = 5, y = 10; */ x = x + y; /* x = 5 + 10 = 15*/ y = x - y; /* y = 15 - 10 = 5 */ x = x - y; /* x = 15 - 5 = 10 */
- mfukar 16y agoUntil overflow occurs. Xor is safer.
- Retric 16y agoYes, ultra low power embedded computers. 2 years ago a friend was working on a 32khz 8bit cpu with 384 bytes of ram and 2,000 bytes of ROM. The problem may have been simple but he setup multi tasking so he could do some networking while still keeping track of some other things and manual error correction because the memory was being flipped in the field. Basically, it needed to operate for years in a remote location on the power output of a watch battery and when your putting a million of the things in the field better code wins out over better hardware. PS: In the end he still he still had 12 bit's of unused memory and in his words "you can do a lot with 12 bit's of ram".