Domanda di colloquio di Microsoft

Implement a method to parse a string into an integer. Detect overflow.

Risposta di colloquio

Anonimo

11 ago 2015

Protip: if asked something like this, don't use a regular expression or something sassy like Integer.parseInt(...). It will not impress your interviewer. The parsing part is easy, overflow detection is a little more tricky.