So I have an on-site interview in 2 weeks with a respectable hardcore software company, and part of the interview prep stuff that was given to me was this excellent article by Steve Yegge: https://sites.google.com/site/steveyegge2/five-essential-phone-screen-questions
Area 5 in the article was a wake up call, because although I've been writing code and doing web dev since I was 12, I had never heard of bitwise operators like '>>' and '^' ever in my life! I need to learn these topics, and fast, since I don't have much time for my big interview. And since I'm a person who does a lot better when I understand the underlying theory, rather than simply memorizing techniques, I would really appreciate a short book, or even articles to get me up to speed on bits, bytes and binary for a practical, low-level programmer.
Can anyone please share a short and practical guide suitable for a person who has many years experience with high level languages like Python?
Left Shift = Multiply by 2 ^ n (without checking for overflow [1]).
Right Shift = Divide by 2 ^ n (without rounding)
As all data in stored, and processed in binary representation right/left shifts are fun hacks we gain from this system. Moving an entire integer 1 space left/right will double/halve its value! Its also very easy to replicate this operation in hardware.
Absolute Beginner Guide on S/O https://stackoverflow.com/questions/141525/absolute-beginner...
[1] Sometimes, it depends, its actually complicated, depends on language, machine, etc.