Clearwater Analytics Interview Question: Write a method that accepts a... | Glassdoor

Interview Question

Software Developer Interview Boise, ID

Write a method that accepts an integer and then returns an

  integer with the digits reversed. For example, if the integer 123 is passed in, the integer 321 is returned.

Interview Answer

1 Answer


It was an interesting intellectual problem but a terrible example of what a software engineer should do. If I had a boss that told me to solve a problem like this, I would tell him to go home and sober up because only a drunk man thinks like this.
I answered it using mod 10 and div 10 functions to pull each number off and then reassemble the reversed number.

Interview Candidate on Sep 29, 2011

Add Answers or Comments

To comment on this, Sign In or Sign Up.