Reported September 2026
Wells Fargohash table

Event Statistics Aggregator

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

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

The Wells Fargo Event Statistics Aggregator showed up in candidate reports in September 2026, and it looks scarier than it is. Strip the wording and it's a hash map with four running numbers per key, plus a formatting job at query time. No tricks with sorting algorithms or data structures beyond that. If you have an OA invite for this one, the work is in the details: six decimals, sorted names, empty-string outputs. StealthCoder sits invisibly on your screen as a safety net if you blank on the formatting, but the core idea is simple enough to hold in your head.

The problem

Process a finite sequence of operations for an event-statistics aggregator. Each event name keeps its count, sum, minimum, and maximum.
Every operation is a string array:
["add", name, value] records one decimal value for name and produces no output.
["count"] appends the total number of recorded events as a decimal integer string.
["avg"], ["min"], and ["max"] append one formatted dictionary string for that statistic.
A formatted dictionary lists event names in ascending lexicographic order as name:value pairs separated by one space. Every numeric value has exactly six digits after the decimal point. A statistic query before any event is recorded appends the empty string.
Return the query outputs in operation order.

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

Examples
Example 1
operations = [["count"],["avg"],["add","click","2"],["add","purchase","10"],["add","click","4"],["count"],["avg"],["min"],["max"]]
return = ["0","","3","click:3.000000 purchase:10.000000","click:2.000000 purchase:10.000000","click:4.000000 purchase:10.000000"]
The first two queries observe the empty aggregator. After three additions, click has values 2 and 4, while purchase has value 10.
Example 2
operations = [["add","view","-1.5"],["add","view","2.5"],["avg"],["min"],["max"]]
return = ["view:0.500000","view:-1.500000","view:2.500000"]
The two view values average to 0.5; their minimum and maximum remain -1.5 and 2.5.

Constraints
1 <= operations.length <= 2000.
Every operation is one of the documented forms.
Every event name is a non-empty string of lowercase English letters and underscores.
Every added value is a base-10 decimal string in [-10^6, 10^6] with at most three digits after the decimal point.

Reported by candidates. Source: FastPrep

Pattern and pitfall

What it really reduces to: a dictionary from event name to count, sum, min, and max. Every add updates those four fields in O(1). Every avg, min, or max query sorts the keys and builds a string. With at most 2000 operations, sorting on each query is fine, so don't over-engineer it. The pitfalls are all in the edges. Print exactly six digits after the decimal point, including negatives like -1.500000. An avg is sum divided by that name's count, not the global count. The count query returns the total across all names, as an integer string with no decimals. Any stat query on an empty aggregator appends an empty string, but count appends 0. Parse values as doubles, and watch that -0.000000 doesn't leak out. If you freeze on the formatting or the empty cases mid-assessment, StealthCoder is the hedge that reads the problem and hands you a working solution.

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 Event Statistics Aggregator 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 Wells Fargo's OA.

Wells Fargo 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.

Event Statistics Aggregator FAQ

How hard is the Wells Fargo Event Statistics Aggregator really?+

Easy to medium. There's no clever algorithm. It's a hash map holding count, sum, min, and max per event name, plus careful string formatting. Most failures come from missed edge cases like empty queries and decimal output, not from the logic itself.

What's the trick to solving it fast?+

Keep one record per event name with count, sum, min, max, and a global total counter. Update on add. On a stat query, sort the keys, format each value with exactly six decimals, and join with single spaces. Sorting per query is fine at 2000 operations.

What edge cases break most solutions?+

Stat queries before any add must return an empty string, while count returns 0. Avg must divide by the per-name count. Negative values need the sign kept with six decimals. Also watch for negative zero printing as -0.000000 after rounding, and for event names with underscores sorting correctly.

Do I need a sorted map or can I sort keys at query time?+

Sorting keys at query time works. With up to 2000 operations, even sorting on every query is cheap. A plain hash map plus a sort on the keys is simpler and less error-prone than maintaining an ordered structure.

How should I prepare for this in 48 hours?+

Write a small version yourself using a map of records and a format function. Test it on both examples, then on an empty-state query and a negative-average case. Practice getting six-decimal output right in your language of choice, since that's where points get lost.

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

OA at Wells Fargo?
Invisible during screen share
Get it