Morgan Stanley interview question

write a daemon