re: Top 20 String Coding Problems from Programming Job Interviews VIEW POST

FULL DISCUSSION
 

The java example of reversing a string in-place is wrong. Strings are immutable in Java. The example given will involve two array copies.

 

Well, while you are correct, it's about logic. In reality, it's better to use StringBuilder.reverse() but yes, mentioning that fact can impress some interviewers too.

code of conduct - report abuse