Scala Interview Question – Reverse Integer

Problem Statement

http://cottonwoodsteakhouse.com/gallery-2/dustball-rally-2015/ Given a 32-bit signed integer, determine its reverse. Since we have signed integer as input we can have negative values, so for Input => -123 Output => -321, also need to take care of Overflow cases which should results in Output => 0 (Invalid). Read more Scala Interview Question – Reverse Integer