Wednesday, 27 February 2013

Morgan Stanley Quant Test

Morgan Stanley took a test for it's Quantitative Analyst profile. The test had 2 sections "Easy" and "Difficult" and total duration was about 2.5 hours.


1) Prove no square matrices A, B exists such that AB-BA = I. (Hint: use trace(X))

2) Each amoeba my transform to 0 amoeba (means that it's dead), 1 amoeba (stays itself) or 2 amoebas (reproduces a child). We initially have 1 amoeba. Find probability of the process up with 0 amoeba in the end.

3) Consider all strings composed of of {0, 1, 2}. Find number of strings such that no two 1s are consecutive in the string.

4) Given X, Y are Uniform(0,1) random variables. Find distribution of X^2 + Y^2.

5) Write algorithm to find lowest common ancestor of 2 nodes in a binary tree.

6) Solve the recurrence f(a, b) = f(a, b-1) + f(a-1, b-1) with base cases
    f(0, 0) = 1,
    f(0, k) = 0,
    f(k, 0) = 1. (Hint: Did you observe it's a Pascal Identity)


1) Give an algorithm to find longest alternating subsequence in an array of numbers. The sequence need not be continuous. Alternating means that 1st term is greater than 2nd term, 2nd term is smaller than 3rd term and so on OR 1st term is smaller than 2nd term, 2nd term is greater than 3rd term and so on.

2) You are given a stream of numbers. Give an efficient data structure to find median of the numbers read so far from the stream in O(1) time.

3) You are given w white balls and b black balls initially in a box. Each time we randomly draw a ball from the box and remove it.We continue until no white ball is left in the box. Find the expected number of black balls in the box in the end.

4) Give a method to randomly choose any K-size subset from an N-size subset, however, N is not known to you.

5) Find all functions f, such that f(mA+nB) = mf(A) + nf(B), f(AB) = f(BA), where A, B are square matrices, find f in terms of a matrix M.


  1. Good post!

    Do you want to work home-based? With internet access, Unemployed pinoys (UEP) can provide you a job where you can work at home and earn money while being able to spend time with your family or loved ones at home.

    Join us now at

  2. I must say you had done a tremendous job,I appreciate all your efforts.Thanks alot for your writings......Waiting for a new . please visit:Packers And Movers Bangalore

  3. Thank you for sharing.please visit here for more detail:

    Packers and Movers Bangalore

  4. Thank you for sharing. please visit here for more detail:

    Packers and Movers Delhi

  5. Thank you for sharing.please visit here for more detail:

    Packers and Movers Hyderabad

  6. Best Outfits For Young ladies, Womens and Girls
    We Have Some For You In Your Budget For more…
    Plz visit:-Sarees

  7. Have Lovely and Beautiful Salwar Suit And Many More…
    We Have Some For You In Your Budget For more…
    Plz visit:- Salwar Kameez

  8. We offers first and exclusive access to the world's most fascinating homes. from royal estates to artist's lofts and everything between - we dedicated to bringing its readers the best in style and design.
    Architecture and Design

  9. Fancy designer wear our website and reasonable price More…
    We Have Some For You In Your Budget For more…
    Plz visit:- Designer Sarees

  10. really a vry nice blog i really appreciate all your efforts ,thank you so mch for sharing this valuable information with all of us.
    Packers And Movers Bangalore

  11. The most beautiful woman at the venue.
    In India Kurtis is are the most obvious choice for the brides.There are many designer Kurtis in our site...
    We have New Massive Collection For Here....
    Pakistani Dress
    Designer Sarees
    Wedding Lehenga
    Salwar Kameez
    Salwar Suit
    Anarkali Suit
    Anarkali Dress
    Wedding Dress
    Punjabi Suits

  12. An adorable personality partnered with a perfect choice for Designer Dress unbeatable.
    Even before the blossom of modernization in Indian culture, kurta, sarees, and salwar kameez had been part of India's unique civilization.
    In India,Designer Salwar Kameez are the most obvious choice for the Young Ladies & Girls.There are many Designer Salwar Kameez in our site...
    Punjabi Dress
    Wedding Saree
    Lehenga Choli
    Ghagra Choli
    Silk Saree
    Ladie Suit
    Indian Saree
    Designer Dress
    Brindal Dresses
    Designer Kurtis

  13. Have Lovely and Beautiful Salwar Suit Saree, Gown And Many More…
    We Have Some For You In Your Budget For more…
    Plz visit:
    Brindal Lehenga
    Pakistani Dress
    Designer Saree
    Wedding Lehenga
    Salwar Kameez
    Salwar Suit
    Anarkali Suit

  14. Industry of movies offers numerous kinds of movies.
    These are particular genres of movies which entertain us.
    They make us laugh, make us cry and sometimes makes us scare also, but in any case we get entertained and feel excitement.
    to watch & download Movie...Plz Visit,...
    kingsman: the golden circle full movie free download
    kingsman: the golden circle full movie download 720

  15. Search of movers packers in your city has become very simple now!
    Best Movers Packers Mumbai

  16. Very Informative and useful, keep it up the great work. For free free download fully pc games, you may also visit us. Ocean of Games

  17. Get latest sports info at

  18. very nice website on this topic. Would like to read more. Here is the link to my website
    Images For 4th Of July 2018
    Fourth Of July Quotes
    4th Of July 2018 Messages

  19. Your website has very good content. Here is link to another website that has useful content
    Friendship Day SMS

  20. The icoshowcase is a platform to analyze and rate all the latest ICO list like upcoming Icos, active Icos and Ico calendar. Even anyone can list their Icos for free on the site. Stay tuned on the site for further information about latest ICO list in 2018.

    Ico list
    upcoming icos
    ico calendar
    active icos

  21. Enjoyed reading the article.Article is very informative. This Blog providing very nice information.Really explains everything in detail. I learn new information from your article. Thank you for this post. Good luck.
    EPABX dealers in Trivandrum