Reported October 2026
Ripplingsimulation

Stateful Log Transform and Search

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 October 2026, and the whole thing hinges on one ordered list of stored strings that you append to and scan. It's a stateful logger: REMOVE, TRUNCATE and CAPITALIZE write a transformed log and return its index, and SEARCH walks the list with keyword matching. The hinted pattern is binary search, but nothing here is sorted, so don't force it. This is a simulation problem with sharp edge cases. If you blank on the details under the clock, StealthCoder runs invisibly as a safety net during the live OA. Know the traps first.

The problem

Process an ordered operation sequence for a logger that stores transformed logs in insertion order.
["REMOVE", log, target]: delete every non-overlapping literal occurrence of the non-empty target from left to right, store the result, and output its zero-based insertion index.
["TRUNCATE", log, n]: keep the first n characters, store the result, and output its zero-based insertion index.
["CAPITALIZE", log]: convert every ASCII lowercase letter to uppercase, leave all other characters unchanged, store the result, and output its zero-based insertion index.
["SEARCH", deduplicate, keyword1,...]: use case-sensitive literal-substring OR matching over stored logs. Visit logs in insertion order. If deduplicate is true, output each matching log once. If it is false, output the log once for each distinct input keyword it contains, in keyword-input order. Repeated keyword arguments count once.
The method returns one row per operation. A write row contains its insertion index as one decimal string. A search row contains its ordered matching logs.

Function
processLogs(operations: String[][]) → String[][]

Examples
Example 1
operations = [["REMOVE","banana bandana","ana"],["CAPITALIZE","Mix 42"],["TRUNCATE","abcdef","3"],["SEARCH","true","A","band"],["SEARCH","false","a","b"]]
return = [["0"],["1"],["2"],["bna band"],["bna band","bna band","abc","abc"]]
Removing non-overlapping ana occurrences stores bna band. The deduplicated search returns it once. The non-deduplicated search emits it for both a and b, then emits abc for those two keywords.
Example 2
operations = [["CAPITALIZE","alpha"],["TRUNCATE","alphabet","5"],["REMOVE","aaaa","aa"],["SEARCH","true","alpha","ALP"],["SEARCH","false","a","aa"]]
return = [["0"],["1"],["2"],["ALPHA","alpha"],["alpha"]]
Search is case-sensitive. The empty stored log matches neither keyword. With deduplication disabled, lowercase alpha contains a but not aa.
Example 3
operations = [["TRUNCATE","hello","0"],["SEARCH","true","x"],["REMOVE","xxxyxx","xx"],["SEARCH","false","x","x","y"]]
return = [["0"],[],["1"],["xy","xy"]]
Truncating to zero stores an empty log. Removing xx left to right from xxxyxx stores xy. Repeated keyword x counts once, so xy is emitted for distinct keywords x and y.

Constraints
1 <= operations.length <= 10^4.
Logs, non-empty removal targets, and keywords contain at most 200 printable ASCII characters.
Each truncation length is between 0 and the corresponding input-log length.
Each search supplies at least one keyword. Its deduplicate value is true or false.
The sum of stored log count * distinct keyword count across all searches is at most 2 * 10^5.

Reported by candidates. Source: FastPrep

Pattern and pitfall

Store logs in a plain list. Each write op transforms the input string, appends it, and returns the old list size as a string. REMOVE needs a left-to-right, non-overlapping scan. Java's String.replace does that for a non-empty target, but check that 'xxxyxx' with 'xx' gives 'xy'. TRUNCATE is a substring from 0 to n. CAPITALIZE must touch only a-z, so write a manual loop. For SEARCH, first dedupe the keywords while keeping first-seen order. Then for each log in insertion order, if deduplicate is true, emit it once when any keyword is contained. If false, emit it once per distinct keyword it contains, in keyword order. The pitfall is repeated keywords counting twice. The constraint on log count times distinct keywords is what makes the brute-force contains check fine. If the live OA freezes you, StealthCoder is the hedge. Binary search is a red herring.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Stateful Log Transform and Search 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 would have shipped this the night before his JPMorgan OA if he'd had it.

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. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Stateful Log Transform and Search FAQ

What's the actual trick in the Rippling stateful log problem?+

There's no clever algorithm. It's careful simulation. Keep a list of logs, apply each transform, and handle SEARCH precisely. The points are deduping keywords first, keeping keyword-input order, and emitting per distinct keyword when deduplicate is false.

Is binary search really needed here?+

No. The hint says binary-search, but logs are stored in insertion order and aren't sorted. The constraint on log count times distinct keywords is at most 2 * 10^5, so a direct contains check per log and keyword is fast enough.

How do I handle REMOVE correctly?+

Delete non-overlapping occurrences of the target left to right. Standard replace-with-empty does this for a non-empty target. Test 'xxxyxx' removing 'xx', which must give 'xy', and 'aaaa' removing 'aa', which gives an empty string.

What edge cases should I test before submitting?+

Test TRUNCATE to 0, which stores an empty log that matches nothing. Test repeated keywords like x, x, y. Test case sensitivity, since 'ALP' doesn't match 'alpha'. Test a CAPITALIZE input with digits and spaces, which stay unchanged. Check that the write rows return the index as a string.

How do I prepare for this in 48 hours?+

Write the solution once from scratch and run all three examples. Spend your time on the SEARCH output rules, since that's where people lose points. Practice string-processing simulation generally, because this OA rewards reading the spec carefully more than algorithm knowledge.

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