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.
As the square plot is centred around (0, 0), we can't have a plot of odd dimensions (seeing test cases, I guess that the coordinates are integral). Now when we try to get the sum of points on the boundary for dimension = 2, 4 etc, we see that the sum is 3 * (dimension) * (dimension).
- Naman Bhalla June 28, 2019From now on, let me take n as the dimension. We have to find least n such that 3 * sum of squares of even numbers till n is greater than or equal to our input. The sum of squares of first n natural numbers can be calculated using 2n(n+1)(2n+1)/3. Thus we have to find least n such that 2n(n+1)(2n+1) is less than or equal to our input (Note that the outer 3 got cancelled with the denominator). Do a binary search over n and get it!). Answer = 4 * n (we have to return perimeter).