Talent Development Interview Questions

19,172 talent development interview questions shared by candidates

Say we have a row of houses on a street, each with an individual value attached to it. The values are guaranteed to be >=0. The values come in an array; the index of the array represents the number of the house, the element the value of the house. (e.g. [5,0,4,6,10] - house 1 has value 5, house 2 value 0, etc.). You must now determine which houses to rob to maximize the value of goods stolen, with the caveat that you cannot rob consecutive houses, and are allowed to go back to rob a house you initially skipped. Using a language of your choice, write a function which takes in an array (as specified) and determines the maximum value of good stolen, and return that value.
avatar

Silicon Valley Next Talent Program

Interviewed at SAP

4.2
Feb 17, 2017

Say we have a row of houses on a street, each with an individual value attached to it. The values are guaranteed to be >=0. The values come in an array; the index of the array represents the number of the house, the element the value of the house. (e.g. [5,0,4,6,10] - house 1 has value 5, house 2 value 0, etc.). You must now determine which houses to rob to maximize the value of goods stolen, with the caveat that you cannot rob consecutive houses, and are allowed to go back to rob a house you initially skipped. Using a language of your choice, write a function which takes in an array (as specified) and determines the maximum value of good stolen, and return that value.

Viewing 451 - 460 interview questions

Glassdoor has 19,172 interview questions and reports from Talent development interviews. Prepare for your interview. Get hired. Love your job.