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.
@Paul:
- tamas October 08, 2015It's easy to see the cyclicity:
As a start:
1 mod 4 = 1.
1 xor 0 = 1.
Then in the 2nd step (n mod 4 = 2) you xor an even number (ie ending 0 in binary) with 1, thus it will always result in n+1.
In the third step (n mod 4 = 3) you xor a number by itself (the result was n+1 in the previous iteration), which naturally returns 0.
In the last step (n mod 4 = 0) you xor a number by 0, which results in the number itself.
Since that's even you will xor that with n+1, which is odd, the only bit difference will be the least significant, thus will result in 1 and the cycle starts over.