Yahoo Interview Question for Software Engineer / Developers






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

I assume there exists at least an angle in which the 2 planes in which these 2 lines exist are parallel (else how do you define distance?).

Now draw a third line perpendicular to line 1. Measure the distance to when this line hits line2.

Does this make sense?

- Nix October 17, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Though you can google the math formula for this problem, but I personally prefer to do it in this way:
for one of the two 3D line, express it in three linear equations:
x = a1 * t + b1
y = c1 * t + d1
z = e1 * t + f1
for the other line, you have coefficient a2,b2....f2

now the distance can be expressed as a function of t.
so a little simple math can find the min of distance.

- geniusxsy October 19, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

by the way, the problem was part of this year's Google Code Jam Round1C prob2.

- geniusxsy October 19, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Nix: How do you guarantee that you can have two parallel planes always, why can't you have just two intersecting planes. Now how do you tackle the problem? check it out beibe !

- baidu October 19, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

If the planes are not parallel then the lines would intersect and if they do.. the minimum distance will be zero and the maximum distance will be infinity.. so they ahve to be parallel

- clrs March 02, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

even if lines are parallel they may be skew lines
therefore there exist a distance between 2 lines.

- gaurav April 12, 2010 | 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