Microsoft interview question

Write a program to do X