is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
I believe strezh posted the implementation for bit reversal, not rotation as described at: hxxp://stackoverflow.com/questions/746171/best-algorithm-for-bit-reversal-from-msb-lsb-to-lsb-msb-in-c
Although the question does not state which rotation direction is required I've posted my left rotate solution:
Basically does a left-rotate using a shift. The main problem with a shift is that truncated bits are not rotated into the other "side". Therefore we use bitwise-OR to set the otherwise truncated bits after shifting them down into position.
- drivehappy March 18, 2011A right rotate implementation should be straightforward with an alteration of the shift operators.
The only gotcha is that the right-shift operation will propagate the signed bit into vacated bit positions as described here: hxxp://msdn.microsoft.com/en-us/library/336xbhcz(v=VS.100).aspx - hence why I use an (unsigned int) cast.