Reported January 2026
Rampsimulation

Worker Management, Part 1: Office Registration

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

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

The detail that trips people in Ramp's January 2026 worker register OA is the open session. Ashley walks in at 100 and never leaves, and GET has to ignore it. This is Level 1 of a four-part series, so the code you write now gets extended later. It's a simulation with a hash map: add workers, toggle in and out on REGISTER, sum completed sessions on GET. Nothing exotic, but string outputs and edge cases decide whether you pass. If you blank mid-assessment, StealthCoder runs invisibly as a safety net while you work through the query loop.

The problem

The source assessment is a cumulative four-level worker-hours register for contract workers at a facility. Each level includes every operation from the earlier levels. This page implements Level 1 and returns one string result for every query in input order.
Level 1: Workers and Office Sessions
["ADD_WORKER", workerId, position, compensation] adds a new worker and stores the worker's position and compensation. If workerId already exists, leave the system unchanged and return false; otherwise return true. Worker IDs and positions contain only English letters and spaces.
["REGISTER", workerId, timestamp] records an office entry when the worker is outside and records an exit when the worker is inside. Calls to REGISTER arrive in increasing timestamp order. Return invalid_request for an unknown worker and registered after a successful entry or exit.
["GET", workerId] returns the worker's total time in the office using completed sessions only. A current session without an exit contributes nothing. Return the empty string when the worker does not exist.
FastPrep Runner Interface
The source uses an array of query rows and one string output per query. FastPrep exposes the same operation rows as workerManagementLevel1(String[][] operations) and returns String[]. Numeric arguments are encoded as base-10 strings.
Multipart Series
Part 1: Office Registration
Part 2: Top Workers
Part 3: Promotions and Salary
Part 4: Double-Paid Intervals

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

Examples
Example 1
operations = [["ADD_WORKER","Ashley","Middle Developer","150"],["ADD_WORKER","Ashley","Junior Developer","100"],["REGISTER","Ashley","10"],["REGISTER","Ashley","25"],["GET","Ashley"],["REGISTER","Ashley","40"],["REGISTER","Ashley","67"],["REGISTER","Ashley","100"],["GET","Ashley"],["GET","Walter"],["REGISTER","Walter","120"]]
return = ["true","false","registered","registered","15","registered","registered","registered","42","","invalid_request"]
Ashley's completed sessions are [10,25) and [40,67), totaling 42. The entry at 100 is unfinished and does not count.

Constraints
1 <= operations.length <= 500, matching the source's query-count bound.
Every row uses an operation available at this level, has the documented arity, and satisfies the source-stated operation preconditions.
Every numeric argument is a valid base-10 integer string.
Worker IDs and positions contain only English letters and spaces.
All REGISTER calls are supplied in increasing timestamp order.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is per-worker state in a hash map: position, compensation, total completed time, and the entry timestamp of the current session (or null if outside). On REGISTER, if the entry is null, store the timestamp and return registered. Otherwise add timestamp minus entry to total, clear the entry, and return registered. GET returns total as a string, and only completed sessions count, so never add the open session. Common pitfalls: returning booleans instead of the strings true and false, forgetting that an unknown worker gives invalid_request on REGISTER but an empty string on GET, and overwriting an existing worker on a duplicate ADD_WORKER. Keep the structure clean because Levels 2 to 4 add top workers, promotions and double-paid intervals. StealthCoder is the hedge if the state design goes sideways under the clock, but this one is easy to hand-trace against the example.

The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.

If this hits your live OA

You can drill Worker Management, Part 1: Office Registration 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 for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.

Get StealthCoder

Related leaked OAs

⏵ The honest play

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

Ramp reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Worker Management, Part 1: Office Registration FAQ

How hard is the Ramp worker management OA really?+

Level 1 is easy. It's a hash map plus a toggle, with about 500 operations at most. The difficulty is the series format, where later levels build on your code, so a sloppy Level 1 costs you later.

What's the trick to REGISTER?+

Store an entry timestamp per worker. If it's empty, this call is an entry, so save the timestamp. If it's set, this call is an exit, so add the difference to the total and clear it. Both cases return registered.

What does GET return for an open session?+

Nothing extra. Only completed sessions count. In the example, Ashley's entry at 100 has no exit, so her total stays at 42. An unknown worker returns an empty string, not zero.

What output mistakes cause failed tests?+

Every result is a string. Return "true" and "false" for ADD_WORKER, "registered" or "invalid_request" for REGISTER, and the number as a base-10 string for GET. Parse timestamps and compensation from strings first.

How do I prepare in 48 hours?+

Write this one from scratch twice with a class holding a worker map. Then add a top-workers sort and a salary field to see how it grows. Hand-trace the Ashley example until every output matches.

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

OA at Ramp?
Invisible during screen share
Get it