Microsoft Interview Question

How would you code in less time this ...?