Reported November 2025
IBMhash table

Service Timeout Detection

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

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

IBM's November OA is asking you to track heartbeat events and flag services that go silent. You're given timestamps and service IDs, and you need to spot which services exceed a timeout threshold at least once. It's a design problem dressed up as a data processing task. The trap is overthinking the state machine or trying to optimize prematurely. StealthCoder will catch the pattern if you blank on the exact algorithm.

The problem

Heartbeat events are recorded with a timestamp and a service identifier. A service times out if the gap between any two consecutive heartbeats for that service is strictly greater than a given threshold. Return all service identifiers that time out at least once, sorted lexicographically. svc1 has a 60-second gap between heartbeats at 20 and 80, and svc2 has a 55-second gap between 10 and 65. Both exceed the threshold.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is simple: iterate through the heartbeats in order, group them by service ID, then check consecutive timestamp gaps. If any gap is strictly greater than the threshold, add that service to your result and sort at the end. The common pitfall is forgetting to sort lexicographically or miscounting the gap (e.g., using >= instead of >). This is a hash-table-plus-iteration problem, not a complex design. Sort events by timestamp first if they aren't already ordered. Use a dictionary to track the last heartbeat for each service. When you see a new heartbeat, compute the gap and mark the service if it exceeds the threshold. StealthCoder acts as your backup if the exact sorting or grouping logic slips your mind under pressure.

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 Service Timeout Detection 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

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as binary tree inorder traversal. If you have time before the OA, drill that.

⏵ The honest play

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

IBM 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.

Service Timeout Detection FAQ

Do I need to handle out-of-order timestamps?+

The problem doesn't specify, but the example assumes they're in order. If they aren't, sort by timestamp first. It's a one-liner, and it's safer than guessing. The gap calculation depends on order.

What does 'strictly greater than' mean here?+

A gap of exactly 60 seconds does NOT timeout if the threshold is 60. It must be 61 or more. This is the exact wording trap. Check your comparison operator: use > not >=.

Can a service timeout multiple times?+

Yes, but you only return it once in the output. Use a set to avoid duplicates, then sort the final result lexicographically before returning.

How do I handle the first heartbeat for a service?+

There's no 'previous' heartbeat, so there's no gap. Start tracking from the second heartbeat for each service. Initialize your last-seen timestamp when you encounter the first event for that service.

Is this actually a design problem?+

It's labeled as one, but it's really a hash-table iteration with a single pass. The 'design' label might be testing whether you overthink or stay calm. Keep it simple.

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

OA at IBM?
Invisible during screen share
Get it