Over a million developers have joined DZone.

Best Tech Interview Question I've Seen

· Java Zone

Discover how AppDynamics steps in to upgrade your performance game and prevent your enterprise from these top 10 Java performance problems, brought to you in partnership with AppDynamics.

I'm a curator of tech interview questions. I'm starting to work with our HR group on a tech recruiting strategy, so I've been looking for more questions. I got an email from a recruiter via a New York Java Meetup group (which is free). The email, of course describes the job requirements, but the best part of the email was the following section:

By starting at the top of the triangle and moving to adjacent numbers on the row below, the maximum total from top to bottom is 27.

5
9
6
4
6 8
0
7 1 5

I.e. 5 + 9 + 6 + 7 = 27.
Write a program in a language of your choice to find the maximum total from top to bottom in triangle.txt, a text file containing a triangle with 100 rows. Send your solution and resume to [123456 AT yodle dot com], replacing 123456 with the maximum sum for the triangle.

 

I had to try to solve the puzzle to see what they did. I tried my first solution, and got my mail bounced back to me... I got immediate feedback from a "unit test." My second solution didn't work either. My third worked... I'm down to 5 lines of Groovy that take about 150 ms.

Yodle had a great job posting. Note: I don't work for Yodle, so if you want to speak with them, you'll have to figure out their culture. On the other hand, if you want a similar culture (at least in part of our HUGE company - SunGard is #380 on the fortune 500), and want to work in a variety of projects, you can always email me. If you can solve this puzzle (and possibly have some finance experience), the interview process will probably just a formality :).

I'm going to have to work on something like yodle's for SunGard Consulting. We currently have job postings like this, which can definitely use some fine tuning.

<sales_pitch>If you want to hire some consultants who can solve those kinds of problems, you can email me for that as well.</sales_pitch>

 

From http://www.jroller.com/Solomon/entry/best_tech_interview_question_i

The Java Zone is brought to you in partnership with AppDynamics. AppDynamics helps you gain the fundamentals behind application performance, and implement best practices so you can proactively analyze and act on performance problems as they arise, and more specifically with your Java applications. Start a Free Trial.

Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}