TechHui

Hawaiʻi's Technology and New Media Community

A pretty neat programming interview question

Views: 162

Tags: algebra, interview, logic, programming, technical

Comment

You need to be a member of TechHui to add comments!

Join TechHui

Comment by Leo D on March 24, 2014 at 10:21pm

10-15 mins.  They want to see the candidate's reasoning more than just whether they get the right answer.  By plugging in numbers, one can get an intuition that the straight average won't work.

Most of this blog post consists of my personal analysis of the general problem of averaging ratio quantities.  But, as an interview question, I think the ideal way to get at the answer is to realize that if d = 2*d_1 (total distance = twice distance of first lap ) and v = 2*v_1 (combined speed must be equal to twice speed of first lap), then total time=(total distance)/(combined speed)=(2*d_1)/(2*v_1)=d_1 / v_1=t_1.  Since total_time = t_1, we know that t_2 must equal zero, and v_2 is infinity.

Comment by Joseph Lui on March 24, 2014 at 1:30pm

Ooooo... how much time was given to complete this question?

Sponsors

web design, web development, localization

© 2014   Created by Daniel Leuck.

Badges  |  Report an Issue  |  Terms of Service