Rating Level After Changes
Reported by candidates from TikTok's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
TikTok reported this one in August 2026, and it's the kind of OA question that looks too easy to be real. You get a starting rating, a list of changes, and you return a level string. It's a plain array pass with a threshold check at the end. The source even says O(n^2) fits, so brute force isn't your enemy here. Carelessness is. If you're taking this in the next day or two, expect to finish fast and spend the rest of the time checking boundaries. StealthCoder sits invisibly as a safety net if you blank on the setup, but you probably won't need it.
The problem
You are given an integer initial, representing a user's initial rating, and an integer array changes. Apply every value in changes to the rating in order. After all changes have been applied, return the level corresponding to the final rating: rating < 1000: "beginner" 1000 ≤ rating < 1500: "intermediate" 1500 ≤ rating < 2000: "advanced" 2000 ≤ rating: "pro" Function ratingLevelAfterChanges(initial: int, changes: int[]) → String Examples Example 1 initial = 1500 changes = [-100,-300,450,500,-500,-600] return = "beginner" The rating changes as follows: 1500 → 1400 → 1100 → 1550 → 2050 → 1550 → 950. Since 950 < 1000, the final level is "beginner". Constraints 1 ≤ initial ≤ 2500 Applying the values in changes never makes the rating less than 1 or greater than 2500. The visible source states that O(changes.length^2) time fits within the execution limit.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The trick is that there's no trick. Sum all the changes onto initial, then map the final number to a label. One loop, O(n) time, O(1) space. Since the source says O(n^2) is allowed, nobody's asking you to be clever about input size. The pitfalls are all boundary errors. 1000 is intermediate, not beginner. 1500 is advanced. 2000 is pro. Use the lower bound of each tier and check from the top down, or chain else-ifs on strict less-than. Don't classify mid-loop. Only the final rating counts, even if it dipped below 1000 along the way. Example 1 shows this: it passes through 2050 and still ends at 950, which is beginner. If you freeze on the live OA, StealthCoder can hand you the loop and the thresholds in seconds, but this is a two-minute write if you stay calm.
Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.
You can drill Rating Level After Changes 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. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass TikTok's OA.
TikTok reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Rating Level After Changes FAQ
How hard is the TikTok Rating Level After Changes question really?+
It's easy. You add up the changes and return a label based on the final number. The only way to fail is an off-by-one on a threshold or classifying too early. Write it, run the sample, and move on to the next question.
What's the trick to this problem?+
There isn't one. Start with initial, add every value in changes, then compare the result against 1000, 1500, and 2000. Check from highest tier to lowest, or use strict less-than comparisons in order, so boundary values land in the right bucket.
Do I need to worry about the rating going out of range?+
No. The constraints guarantee the rating never drops below 1 or goes above 2500 while applying changes. You don't need clamping logic or overflow handling. Just accumulate the sum and trust the input.
Why does the problem say O(n^2) is fine?+
It signals the question is meant to be simple and the input is small. A single pass is O(n) and easily fits. Don't waste time optimizing. Write the obvious loop, make sure it's correct, and spend leftover time testing edge cases.
How do I prepare for this in 48 hours?+
Practice simple simulation problems where you accumulate state and map it to an output. Focus on boundary conditions like exactly 1000, 1500, and 2000. Test those three values by hand before you submit, since that's where people lose points on easy questions.