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.
It is a weird question because when d is large compared to the elements of the array the number of possible triplets are Omega(n^3), hence there cannot be any O(n^2) solution. So is the obvious solution pointed out in the earlier comments everything that there is about this problem? weird!
- hamoon.mousavi June 16, 2014So let me make my point clear by means of an example: let the array be 1,2,3,...,n and let d = 3*n. Then every 3 distinct numbers a,b,c in your array is going to satisfy a+b+c < d, and there are n \choose 3 many of them which is of order O(n^3).