Amazon Interview Question

Just a basic question from Cracking the Coding Interview