The Reverse Words in a String III interview question asks you to reverse the characters of each individual word in a sentence while preserving the word order and the spaces between them. Unlike the previous versions, the word order stays the same — only the characters within each word are reversed. Leading and trailing spaces are not present in this variant.
This problem is asked at Microsoft, Salesforce, Amazon, Walmart Labs, Google, and Bloomberg as a simpler counterpart to the full word-reversal problem. It tests per-word string manipulation — a common operation in text processing, data formatting, and display systems. It also introduces the concept of operating on substrings independently, which is a building block for more complex string transformations.
The pattern is word-by-word character reversal. Split the string on spaces to get individual words. Reverse each word using [::-1] in Python or a two-pointer helper. Join the reversed words back with a single space. This is O(n) time and O(n) space. In-place on a char array: find each word's boundaries using two pointers and apply reverse within each boundary.
Input: "Let us code today"
Split: ["Let", "us", "code", "today"].
Reverse each word:
"Let" → "teL"."us" → "su"."code" → "edoc"."today" → "yadot".Join: "teL su edoc yadot".
Compare with Reverse Words in a String: that would give "today code us Let" — completely different operation.
' '.join(...) correctly.For the Reverse Words in a String III coding problem, the two-pointer string interview pattern applied word-by-word is the foundation. In Python, ' '.join(word[::-1] for word in s.split()) is a clean one-liner. Interviewers at BNY Mellon and Wissen Technology use this to test fluency with string splitting and Python's slice reversal. Practice the in-place two-pointer approach as well — find each word's start by scanning for non-space, find end by scanning to the next space, then reverse in-place within those bounds.