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 did both methods shown above.
In one with worst case O(n^2), I looped over the whole array looking poles that meet the criteria for left array elements (less than pole value). When found, I then check the right elements in an inner loop to make sure they are at least the value at the pole. If not, the outer loop moves to the next element. This returns the first valid pole only.
In the second with worst case O(n) but using more memory, I created 2 supporting arrays of the same size as the original. The first array will indicate which elements are valid poles using the left criteria (less than or equal pole value.) The values will be the same as original if that element is a pole that meets the criteria with all of the elements to its left. If not, the value will be -1. Similarly, the second array will indicate which elements are valid poles using the right criteria (all to the right are greater than or equal pole value). Again, the values in the array will be the same be the same as the original array if that element meets the right criteria (all elements to its right have values that are greater than or equal to that pole). A third and final loop in this second method loops over both generated arrays and picks out elements with the same index and value (ones with -1 are ignored). These elements represent all valid poles that meet criteria for elements to the left and right.
- sunspotting June 14, 2015