These #programing interview question answers assume the string is ASCII. In the real world that assumption is naïve. This error is so common. Not every user is going to be a white guy in California that only speaks English. These questions also seem to assume the only right answer is in Java. Because once again because that is the only language he speaks.