Reported September 2026
Ripplingstring

Token Validation

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

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

Rippling reportedly served this one in September 2026, and it looks friendlier than it is. Count the tokens in a string that pass four rules: length at least 3, only letters and digits, at least one vowel, at least one consonant. It's a string scan, nothing fancy. The pain is in the edge cases, like digits that count as neither vowel nor consonant and runs of spaces that create empty segments. If you blank on the details, StealthCoder is the safety net running invisibly during the live OA.

The problem

You are given a string tokenString containing tokens separated by one or more spaces.
A token is valid only when all of the following conditions hold:
It contains at least 3 characters.
Every character is an ASCII letter or decimal digit.
It contains at least one vowel: a, e, i, o, or u, ignoring letter case.
It contains at least one consonant, meaning an ASCII letter that is not a vowel.
Digits are allowed, but they are neither vowels nor consonants. Return the number of valid tokens in tokenString. Empty segments created by repeated spaces are ignored.

Function
countValidTokens(tokenString: String) → int

Examples
Example 1
tokenString = "This is an example string 234."
return = 3
The valid tokens are This, example, and string. The tokens is and an are too short, while 234. contains a non-alphanumeric character.
Example 2
tokenString = "a1b 123 bcE9"
return = 2
a1b and bcE9 each contain a vowel and a consonant. 123 has no letters, so the result is 2.
Example 3
tokenString = "AEI bcd xy!"
return = 0
AEI has no consonant, bcd has no vowel, and xy! contains a non-alphanumeric character.

Constraints
For this exercise, assume 1 <= tokenString.length <= 100000.
For this exercise, assume tokens are separated by one or more ASCII space characters.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The input can hit 100000 characters, so you want one linear pass. Brute force isn't really the risk here. Re-scanning each token several times or building heavy structures is just wasteful. Split on spaces, skip empty segments, then walk each token once with three flags: hasVowel, hasConsonant, and allAlnum. Bail out early the moment a character isn't a letter or digit. Lowercase each letter before checking against the vowel set. The classic pitfalls are treating digits as consonants, using a library isAlpha that accepts non-ASCII letters, and forgetting the length check. Example 1 trips people with the trailing period in 234., which kills that token. Total work is O(n) time and O(1) extra space if you scan in place. If you freeze mid-OA, StealthCoder can hand you the clean loop while you keep your head straight.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill Token Validation 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. If you're reading this with an OA window open, you're who this was built for.

Get StealthCoder

Related leaked OAs

⏵ The honest play

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

Rippling reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Token Validation FAQ

How hard is the Rippling Token Validation question really?+

Easy on algorithm, medium on carefulness. It's a single linear scan with a few flags. Most lost points come from edge cases: digits counting as neither vowel nor consonant, punctuation inside a token, and repeated spaces producing empty segments.

What's the trick to Token Validation?+

Track three things per token in one pass: whether you've seen a vowel, whether you've seen a consonant, and whether every character is alphanumeric. Then check length at least 3. Digits only help the alphanumeric check, nothing else.

Do I need a regex or can I just loop?+

A plain loop is safer. Split on spaces, ignore empty pieces, and check each character with explicit ASCII range tests. Regex works but it's easy to get wrong on case and anchors, and a loop is simpler to debug under pressure.

What's the time complexity I should aim for?+

O(n) where n is the length of tokenString, up to 100000. Every character is visited once. Extra space can be O(1) if you scan in place, or O(n) if you split into a list first. Both are fine.

How do I prepare for this in 48 hours?+

Write the solution once from scratch, then test the three given examples plus cases like multiple spaces, a token of exactly 3 characters, all digits, and uppercase vowels. Confirm your vowel check ignores case and your consonant check excludes digits.

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

OA at Rippling?
Invisible during screen share
Get it