Interview Question for Interns


Team: mobile engineering
Country: United States
Interview Type: Phone Interview




Comment hidden because of low score. Click to expand.
1
of 1 vote

search for extreme set of points on the three axes that is with minimum and maximum x coordinate andd similarly for other two axes. (can be multiple points on a plane)

These points will be in 6 different planes each having multiple points ( at faces of cuboid)

Now same problem reduces to finding minimum points in a 2d plane which will enclose all the points in that plane . Now again do similar step that is forming pair of extreme along x and y co-ordinate . These points will be included . For left over points they may or may not be included . They will be included if they don't lie in the existing figure .
This can be checked as follows.

Consider A,B,C,D points (three are already included so check for 4th one if this is already in the figure or not)
D is within ABC if
Area (ABC)= Area(ABD)+AREA(BCD) +AREA(ACD)
If true no need to include . Otherwise include
This can be extended for any number of points

- words&lyrics July 22, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

yes this indeed is near to correct logic...

- kavish July 22, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

since we have to enclose all N points, so we can always choose any 5 points in 3-D space (forming prims ) which will enclose all points.
correct me if i am wrong.

- zeroByzero July 21, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

we have to choose the points from the given list of points...

- kavish July 21, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Could we define what it means for a set of K points to enclose another set of N points?

- eugene.yarovoi July 21, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

the set of k points shud form the vertices of the polygon or 3d figure enclosing all the given set of n points and those k points shud be from the given n points...

- kavish July 22, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

In what manner is the enclosing 3d figure to be constructed from the selected k points?

- eugene.yarovoi July 22, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

this is actually a modified version of convex hull problem...refer to that for any doubts...

- kavish July 22, 2012 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

5 points, (prism)

- bhargav July 21, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

you have to atleast give the algo...and it won't always be a prismit can have more than 5 points as edge...

- kavish July 21, 2012 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

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.

Learn More

Resume Review

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.

Learn More

Mock Interviews

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.

Learn More