Reported July 2026
TikToktwo pointers

Reverse the Interior of Vowel-Bounded Words

Reported by candidates from TikTok's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live TikTok OA. Under 2s to a working solution.
Founder's read

The constraint that matters in this TikTok OA, reported July 2026, is that every word gets touched at most once, so anything fancier than a single pass per word is wasted effort. You loop the array, test each word's endpoints, and reverse the middle in place. It's a two-pointers problem dressed up as string manipulation. The first read feels trickier than it is, because the case rules and the endpoint rule look like traps. They aren't. If you blank on the day, StealthCoder runs invisibly on your desktop as a safety net while you work through it.

The problem

You are given an array of strings text, where each string represents a word.
A word qualifies when both its first and last characters are vowels. The vowels are a, e, i, o, and u, and the check is case-insensitive.
For every qualifying word, reverse only the substring between its first and last characters. Keep the two endpoint characters unchanged. Leave every other word unchanged and preserve the original array order.
Return the modified array of strings.

Function
solution(text: String[]) → String[]

Examples
Example 1
text = ["apple","banana","OranGe"]
return = ["alppe","banana","OGnare"]
apple begins with a and ends with e, so reversing ppl produces alppe.
banana does not begin with a vowel and remains unchanged.
OranGe begins and ends with vowels; reversing ranG produces OGnare.

Constraints
Every element of text is a non-empty word.
Vowel checks are case-insensitive, while every character's original case is preserved.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is to separate the check from the reversal. First, lowercase only the first and last characters and test them against aeiou. Don't lowercase the whole word, since you must preserve original case in the output. If it qualifies, reverse the substring from index 1 to length-2 and glue the endpoints back on. Slicing and reversing works, or you can swap with two pointers. The pitfalls are small but real. A one-letter word like "a" has the same first and last character, and a two-letter word like "ae" has an empty interior, so reversing changes nothing. Make sure your slice bounds don't crash on those. Check Example 1 by hand: OranGe becomes OGnare, with case moving along with each character. Time is linear in total characters. If you freeze on the live OA, StealthCoder is the hedge that reads the problem and hands you the pass.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Reverse the Interior of Vowel-Bounded Words cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass TikTok's OA.

TikTok reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Reverse the Interior of Vowel-Bounded Words FAQ

How hard is this TikTok OA question really?+

Easy. It's a single pass over the array with a vowel check and a substring reversal. The difficulty is in the edge cases, not the algorithm. If you can reverse a string and index into one, you can solve it in a few minutes.

What's the trick to the vowel-bounded reversal?+

Check only the first and last characters, lowercased, against aeiou. If both pass, reverse everything between them and keep the endpoints fixed. Never lowercase the stored word, because the output has to keep each character's original case.

What edge cases should I test?+

Single-character words like "a", two-letter words like "ae" where the interior is empty, and mixed-case words like OranGe. Also test a word with a vowel on only one end. Your slice logic shouldn't throw on any of them.

Is the two-pointers pattern still asked in OAs?+

Yes. Two-pointers and in-place string manipulation show up constantly because they're quick to write and easy to grade. This TikTok problem, reported July 2026, is a clean example of that style.

How do I prepare for this in 48 hours?+

Write the solution once from scratch in your language. Practice slicing and reversing strings, then run the apple, banana, and OranGe example. Add the one-letter and two-letter cases. That covers essentially everything this problem can throw at you.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with TikTok.

OA at TikTok?
Invisible during screen share
Get it