Morgan Stanley
3.4 of 5 1,410 reviews New York, NY 5000+ Employees

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 [?]
Answer Flag Question

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

Answers & Comments

of 0
dynamic programming
- Interview Candidate on Sep 05, 2012 Flag Response
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 Flag Response

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.

Glassdoor is your free inside look at Morgan Stanley interview questions and advice. All interview reviews are posted anonymously by Morgan Stanley employees and interview candidates.