Morgan Stanley interview question

implement vector