Reported March 2025
Chainalysisarray

Filter Team A Logs

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

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

The Chainalysis OA reported in March 2025 has a problem that looks too easy to be real: filter the logs where the team is exactly "Team A" and return their indices. It's a single pass over an array. The only way to lose points is to get cute about matching. Example 2 is the whole trap, since "team a" must not match. If you've got this invite and a free evening, read the edge cases once and you're done. If your brain stalls on the day, StealthCoder runs invisibly as a safety net during the live OA, but this one shouldn't need it.

The problem

Each index represents one log in a data stream, and teams[i] is that log's team.
Return the zero-based indices of every log whose team is exactly Team A, preserving stream order.

Function
filterTeamALogs(teams: String[]) → int[]

Examples
Example 1
teams = ["Team A","Team B","Team A"]
return = [0,2]
The first and third logs belong to Team A.
Example 2
teams = ["team a","Team B"]
return = []
Team matching is exact and case-sensitive.

Constraints
0 <= teams.length <= 100000.
Each team name is a non-empty ASCII string.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The pattern is a plain linear scan. Loop through teams, compare each entry to the literal "Team A" with exact, case-sensitive equality, and push the index into a result list when it matches. That's O(n) time and O(k) space for k matches, which handles 100000 entries easily. The pitfalls are all about matching. Don't lowercase the strings, don't trim whitespace, don't use contains or startsWith, because "Team AB" or "team a" must fail. Empty input should return an empty array, not null. In Java, use equals, never ==, or you'll get random failures on string identity. Keep indices zero-based and in stream order, which a forward loop gives you for free. Write it, run the two examples, add an empty array test, and submit. If the live OA throws a variant and you freeze, StealthCoder is the hedge that reads the screen and hands you a clean solution without the proctor seeing it.

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 Filter Team A Logs 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 Chainalysis's OA.

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

Filter Team A Logs FAQ

How hard is the Chainalysis Filter Team A Logs question really?+

It's easy. One loop, one equality check, one result list. The difficulty is only in reading carefully. Exact, case-sensitive matching is the single detail that separates a passing answer from a failing one, so slow down on that and nothing else.

What's the trick in Filter Team A Logs?+

There isn't a clever one. The catch is exact matching. "team a" doesn't match "Team A", and neither would extra spaces or a longer name that merely contains it. Use strict string equality and don't normalize the input in any way.

What edge cases should I test before submitting?+

Test an empty array, which should return an empty array. Test a case where nothing matches, like lowercase "team a". Test where every entry matches, and a single-element input. Also confirm indices are zero-based and come back in original order.

Will performance matter with 100000 logs?+

Not really. A single O(n) pass is far more than fast enough for 100000 entries. Avoid anything quadratic, like repeatedly searching the array from the start or inserting at the front of a list, and you're fine.

How do I prepare for this OA in 48 hours?+

Don't over-prepare for this one problem. Practice writing array filtering in your language, check how string equality works in it, and run through empty-input handling. Spend the rest of your time on harder problems, since the OA likely has more than this one.

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

OA at Chainalysis?
Invisible during screen share
Get it