Microsoft Interview Question

Reverse a string by word order with increasing constraints