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.
This can be solved with a variation on pivot of 0 (from quicksort).
Some solutions here tried to go that way but they do not keep relative position. In order to do that, we need a little bit more info.
1. Scan the array and count positive numbers (O(n))
2. Start with two pointers- one at the start and one in position (arrayLength - numOfPositives).
3. As long as the first pointer points to a positive number, swap elements and increment second pointer.
4. If first points to negative number, increment first pointer.
This works because instead of going backwards you swap the positive integers in order.
This allows us to pivot without losing order. Unless I am missing something, this is O(n) time and O(1) space.
- streamer July 24, 2015