DEV Community

Discussion on: Top 20 String Coding Problems from Programming Job Interviews

Collapse
 
philrod1 profile image
Phil

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

Collapse
 
javinpaul profile image
javinpaul

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.