My answer to a common programming interview question