Get Total Impact
Reported by candidates from TikTok's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
TikTok's 'Get Total Impact' showed up in November 2024 assessments and it's a graph traversal problem wrapped in a real-world metric. You've got nodes (users or content pieces) and edges (interactions or influence), and you need to calculate cumulative impact across a network. The trap is assuming a simple sum. It's not. StealthCoder will catch the traversal pattern if you blank on the approach during the live assessment.
Pattern and pitfall
This is a depth-first search or breadth-first search problem disguised as a business metric. The 'total impact' typically means you're summing values across all reachable nodes from a starting point, often with a multiplier or decay factor as you traverse levels. Common pitfall: candidates hardcode a flat summation instead of recognizing that impact compounds or attenuates by distance. You need to track visited nodes to avoid cycles, then accumulate the metric. If the graph is a tree, DFS is cleaner. If there are bidirectional edges, BFS often prevents stack overflow. StealthCoder will surface the exact traversal logic the moment you see the constraints.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill Get Total Impact 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 StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as number of islands. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass TikTok's OA.
TikTok 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.
Get Total Impact FAQ
Is this a simple array sum or actually a graph problem?+
It's graph traversal. The word 'impact' signals you're walking a network from one or more roots and aggregating values. You'll need an adjacency list and either DFS or BFS. Don't mistake it for math.
Do I need to handle cycles?+
Probably. Use a visited set to mark nodes you've already counted. If the input guarantees a DAG or tree, you can skip it, but assume you need cycle detection unless the problem explicitly says otherwise.
What if impact decays or multiplies by depth?+
Track the current depth or cumulative multiplier as you traverse. Pass it as a parameter in your DFS/BFS recursive or iterative call. This is where most candidates lose points.
How do I prep for this in 48 hours?+
Run through graph basics: adjacency list construction, DFS with memoization, cycle detection. Solve one LeetCode tree/graph sum problem. The pattern is stable; the metric just changes names.
Is this harder than a standard graph traversal?+
No, it's the same logic. The domain language (impact, influence, reach) is what throws candidates. Strip the flavor text and you've got a classic DFS/BFS accumulation.