Reported September 2026
NinjaTraderhash table

Server Log Summary and Minute Anomalies

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

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

The NinjaTrader OA reported in September 2026 hands you a pile of messy log rows and asks for a formatted report. Four fields per row, skip anything malformed, then count levels, average latency, count status codes, and flag anomalous minutes. It's a hash-table counting problem wearing a string-formatting costume. Nothing here is algorithmically hard, but the output spec is picky and one wrong decimal sinks you. If you blank on the details live, StealthCoder sits invisibly on your screen as a safety net. Know the shape before you open it.

The problem

Analyze decoded server-log candidates. Each valid row is [timestampMillis, level, latencyMillis, statusCode]. Skip any row whose field count is not four or whose timestamp, latency, or status is not an integer.
Return output lines in this order:
LEVEL name=count for present levels in lexicographic order.
AVG_LATENCY=x.xx over all valid rows.
STATUS code=count for present codes in numeric order.
For every minute bucket in numeric order whose percentage of status codes at least 500 is at least errorRatePercent or whose average latency is at least latencyThreshold: ANOMALY minute=m errorRate=x.xx avgLatency=y.yy.
Return an empty array when no row is valid.

Function
analyzeLogs(records: String[][], latencyThreshold: int, errorRatePercent: int) → String[]

Examples
Example 1
records = [["0","INFO","100","200"],["30000","ERROR","300","500"]]
latencyThreshold = 250
errorRatePercent = 50
return = ["LEVEL ERROR=1","LEVEL INFO=1","AVG_LATENCY=200.00","STATUS 200=1","STATUS 500=1","ANOMALY minute=0 errorRate=50.00 avgLatency=200.00"]
The minute reaches the error-rate threshold exactly.
Example 2
records = [["bad","INFO","10","200"],["1","INFO"]]
latencyThreshold = 100
errorRatePercent = 50
return = []
Both rows are malformed and skipped.

Constraints
0 <= records.length <= 10^5.
Valid timestamps and latencies are nonnegative; status codes are positive.
Thresholds are nonnegative.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is a single pass. Validate each row: exactly four fields, and timestamp, latency, and status all parse as integers. Then update four things: a level count map, a running latency sum and count, a status count map, and a per-minute bucket keyed by timestamp divided by 60000. Each bucket tracks total rows, rows with status at least 500, and latency sum. Sort level keys lexicographically and status keys numerically, then walk buckets in numeric order. The pitfalls are all in the edges. Use integer math or a careful comparison for the threshold, since example 1 hits the error rate exactly at 50 and must count. Format with two decimals everywhere. Use a long for sums at 10^5 rows. Return an empty array, not a report of zeros, when nothing is valid. If you freeze on the formatting or the bucket logic during the live OA, StealthCoder can hand you a working solution.

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 Server Log Summary and Minute Anomalies 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
⏵ The honest play

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

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

Server Log Summary and Minute Anomalies FAQ

How hard is the NinjaTrader log summary problem really?+

Easy to medium. The algorithm is one pass with hash maps. The difficulty is the strict output format, the validation rules, and the threshold comparisons. Most failures come from formatting and edge cases, not from the logic itself.

What's the core trick?+

Bucket by minute using timestamp divided by 60000 with integer division. Keep per-bucket counts of total rows, rows with status 500 or higher, and latency sum. Then compute error rate and average latency per bucket and compare against the thresholds with greater-than-or-equal.

How do I validate rows correctly?+

Check the field count equals four first, then try parsing timestamp, latency, and status as integers. If any parse fails, skip the whole row. Don't partially count it. Also don't let a skipped row touch the level counts or the averages.

What edge cases should I test before submitting?+

Test an empty records array, all-malformed input, and a minute sitting exactly on the error-rate threshold, as in example 1. Also test rows with only some fields valid, and check that status codes sort numerically, so 200 comes before 500 and 99 before 200.

How do I prepare in 48 hours?+

Write this one end to end from scratch. Practice parsing safely, using sorted maps or sorting keys, and printing two-decimal floats in your language. Then do two or three other counting and grouping problems. Pattern recall matters more than volume here.

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

OA at NinjaTrader?
Invisible during screen share
Get it