Morgan Stanley
Work in HR? Unlock Free Profile

Morgan Stanley Analyst Interview Question (student candidate)

I interviewed in New York, NY and was asked:
"There are 3 types of coins. The values are 1, 2, 5, respectively. What's the algorithm to get the minimun number of coins if the sum of them is N?"
Tags: technical, algorithm
Add Tags [?]

Part of a Analyst Interview Review - one of 993 Morgan Stanley Interview Reviews

Answers & Comments

of 0

dynamic programming

- Interview Candidate on Sep 05, 2012
of 0

(function foo(n){
    var coins = [1,2,5]
    var num = 0;
    while (coins.length){
        var coin = coins.pop()
        num+= Math.floor(n/coin);
        if(!n) break;

- grim face on Sep 07, 2012

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords, helping to categorise interview questions that have something in common.