Amazon Interview Question: Given a triangle of integers,... | Glassdoor

Interview Question

Software Development Engineer Intern Interview

Given a triangle of integers, find the path of the largest

  sum without skipping.
Answer

Interview Answer

3 Answers

0

I used a binary tree with a recursive algorithm to return the largest sum. He seemed happy but I am sure this was less than ideal. I think the proper way would be to use an array of integers and use the index.

Interview Candidate on Mar 9, 2014
3

Could you elaborate the question further. What do you mean by triangle of integers? Is it a List of list integers? Also, for the path, what is the starting point? Is it allowed to go right/left/diagonally?

Anonymous on Oct 17, 2015
2

The question is not complete. I am guessing the question should be something like this
http://rosettacode.org/wiki/Maximum_triangle_path_sum#Java

Suresh on Dec 26, 2015

Add Answers or Comments

To comment on this, Sign In or Sign Up.