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 may be misunderstanding something here, and if I am please disregard, but it seems like this solution is almost correct. Let's keep with the question in the sense that they hypothetically want to toggle bits 11-15, it appears that this solution will only toggle bits 11-14.
I think
should be slightly altered to
As an example, let's take the number: 85499444
[represented in binary as 0000 0101 0001 1000 1001 1110 0011 0100]
Assuming
and
.
With the original solution of:
We get a mask of
As we can see this only has an effect on bits 11-14.
However, with the slight alteration of:
We get a mask of
Which we can see has an effect on bits 11-15.
That said
This effectively toggles bits 11-15 of the number 85499444.
TL;DR
Unless I misunderstood, I think the correct solution is actually:
}
- datta016 August 01, 2013