HackTheRounds Interview Experiences
TikTok New Grad SDE OA Interview Experience (2026) - CodeSignal Drone Delivery, Text Justify, Mountain Pair Gap, Battery Rotation
TikTok NG SDE 70 minute CodeSignal OA walkthrough: drone station greedy delivery, newspaper text justification, position gap minimum height diff, cyclic battery
By Anonymous ยท 2026-03-20
Background
Cleared the TikTok NG SWE CodeSignal OA last week and the invite for the next round landed two days later, so I am writing this while the question set is still intact in my head. I am a final-year CS undergrad at a US school, had referred into TikTok through a friend on the ads-team infra group, and had prepped specifically against the 2025 CodeSignal bank because that is what TikTok was using through most of last year. The 2026 version is effectively the same bank with two fresh problems mixed in. If you have done a TikTok or Uber OA in the past eight months, the four problems in this set will feel like homework.
Timeline
- Referral submitted: early March
- Recruiter confirmation: 3 days later
- OA link: 7 days after confirmation, 7-day window
- OA attempted: day 3 of the window
- Result and next-round invite: 2 business days after submission
- Total to next round: under 3 weeks
OA Format (70 min, CodeSignal)
Four problems, 70 minutes. Difficulty leans easy, the fourth problem is the only one that pushes toward medium. I finished in roughly 25 minutes with all four passing the visible examples, then spent the remaining 45 minutes stress-testing edge cases and found one off-by-one in my second problem that would have cost me hidden tests.
CodeSignal here behaves as usual: you can run custom stdin, you can run against the visible examples, the hidden test pass count is revealed after time expires. Python was my language.
Problem 1: Drone-Assisted Package Delivery
Problem: You need to move a package from position 0 to a target position on a line. Along the way there are charging stations at known positions. The rule is: walk to the nearest charging station ahead of you, dispatch a drone from there that carries the package toward the target by up to 10 units, then walk to where the drone dropped the package and repeat. Return the total walking distance you cover.
The cleanest approach is a straight simulation. Sort the stations ascending. Maintain a current position and a running walk total. Repeatedly: binary search for the first station at or ahead of the current position, add the distance from current to that station to the walk total, advance current to the station plus 10. Terminate when current reaches or passes the target, or when there are no stations ahead, in which case you walk the remainder to the target.
The subtlety that tripped me initially is the "carry as far as possible" rule on the last hop: if the remaining distance after reaching a station is less than the drone's max range, the drone goes straight to target rather than overshooting to s + 10 . Re-read the statement carefully before coding the final-leg branch.
Practice it: This question is coming soon to HackTheRounds. Problem 2: Newspaper Layout Justification
Problem: You are g
This question is coming soon to HackTheRounds. iven a list of paragraphs (each a list of words), a list of alignment modes for each paragraph ( "LEFT" or "RIGHT" ), and a max line width. Lay out the text, wrapping greedily (fit as many words per line as possible, pad with spaces to the alignment side), then enclose the entire output in a border of characters. Return the resulting lines as a string array.
Two-pointer greedy line packing. For each paragraph, walk the words accumulating into the current line until adding the next word plus one separator would exceed width , close the line, pad with spaces according to the alignment mode, and start a new line. After all paragraphs are laid out, wrap the output with a top border, per-line bookends, and a bottom border.
The off-by-one I caught during stress testing: when a single word is exactly width characters long, it becomes its own line with zero padding. Hidden tests never triggered the overflow path in my draw.
Practice it: This question is coming soon to HackTheRounds. Problem 3: Most Similar Mountain Pair With Position Gap
Prob
This question is coming soon to HackTheRounds. lem: Given an array heights and an integer viewingGap , find the minimum possible absolute height difference between two mountains whose index positions differ by at least viewingGap . Return that minimum difference.
Brute force is O(n^2) and works for small inputs, but the problem's constraint bumps n up to roughly 10^5 , so brute force is out. The clean approach is a sorted structure indexed by height. Walk i from viewingGap to n-1 . At each step, insert heights[i - viewingGap] into the sorted structure (this is now eligible because it is at least viewingGap positions behind the current index). Then use the structure's predecessor and successor query to find the height closest to heights[i] . Update the running minimum difference.
In Python I used SortedList from sortedcontainers . Bisect-based insertion and neighbor lookup are O(log n) each, so total O(n log n) . The CodeSignal environment has sortedcontainers preinstalled.
The trap I almost fell into: inserting the element before querying would make the element eligible to pair with itself. Always query before inserting, or insert and then exclude the current index during the query. I went with the "insert after query" ordering, which is cleaner.
Practice it: This question is coming soon to HackTheRounds. Problem 4: Phone Battery Rotation Simulation
Problem: A pho
This question is coming soon to HackTheRounds. ne must run continuously for t minutes. You have n backup batteries. Battery i provides capacity[i] minutes of runtime, then needs recharge[i] minutes before it can be used again. Batteries are used in cyclic index order, meaning when the current battery dies you must switch to battery i+1 mod n if it is available, otherwise wait. If all batteries are recharging at some point, return -1. Otherwise, return the number of batteries that fully discharge during the t minutes.
Straight simulation. Track a per-battery next-ready-time (initialized to 0), a current-time cursor, and a current-battery-index cursor advanced in cyclic order. At each step, advance the clock to the current battery's ready-time if it is not yet ready, use it for up to capacity[i] minutes or until the time budget ends, and if it fully discharges increment the used counter and schedule its recharge. Runtime is O(t / min capacity) worst case.
The edge case that matters: if you reach t mid-discharge, that last battery does not count as fully used. The example specifically tests this.
Practice it: This question is coming soon to HackTheRounds. Result
Passed. The next-round invitation came two business
This question is coming soon to HackTheRounds. days later and I have a technical screen scheduled for the following week. I will edit this post once the follow-up round is done.
Tips
- The 2026 bank is a superset of the 2025 bank plus two fresh problems. If you did a 2025 TikTok or Uber OA, the 2026 set is 60 percent free. Focus prep on the two new archetypes: drone-delivery greedy and battery-rotation simulation.
- Have `sortedcontainers` muscle memory if you use Python. Problem 3 is the standard "efficient predecessor/successor over a growing set" pattern. Without `SortedList` you are writing a Fenwick tree under time pressure. Know `add`, `bisect_left`, `bisect_right` cold.
- Budget 45 of 70 minutes for the first pass and 25 for stress testing. I caught a Problem 2 bug only because I used the remaining time on empty-input, single-word, overflow-width cases. The visible examples are not representative of the hidden set.
- Simulation problems reward slow, explicit state-machine setup. Before writing code for Problems 1 and 4, walk the first three example steps on paper. Ten up-front minutes saves twenty debugging.
- Re-read ambiguous phrasing before committing to a bound. Problem 1's "flies as far as possible" means straight to target on the final hop, not capped at +10. Misreading that cost me five minutes.
- The TikTok bank rotates slowly. Get a friend's recent draw. The same four problems appear across friends' drafts spanning several weeks. If you have a TikTok-interviewing friend, compare notes.
Four AC in 25 minutes is a strong pass on this bank. If you are not hitting that pace, you are under-practiced against the specific CodeSignal flavor, not under-talented.