Just finished the TikTok 26NG OA on CodeSignal. Four questions, and the whole thing was done in around ten minutes.
This is not about showing off speed. The reason it felt fast is that TikTok’s OA question bank has a very recognizable pattern. The first two problems are usually simulation-style easy points, the third focuses on data structures, and the fourth is often a scheduling simulation problem. The style is highly similar to the CodeSignal sets used by HRT, Uber, and Capital One.
If you have practiced similar problems before, the experience is almost like rewriting familiar solutions. I summarized the four problems and the core approaches below for anyone preparing.
Problem 1: Drone Delivery Walking Distance
Starting from position 0, deliver a package to the target location. There are charging stations along the route. Each round, the drone flies to the nearest station ahead and can travel at most 10 units. If the drone cannot reach the destination, you have to walk to retrieve the package and continue the process. Calculate the total walking distance.
The key idea is greedy simulation:
- Sort all charging stations.
- Find the next available station ahead.
- Add only the walking distance to the answer.
- Update the current position after the drone flight.
- Continue until reaching the destination.
Remember that drone distance does not count toward the answer. Also handle the edge case where there are no charging stations — in that case, simply walk directly to the target.
Problem 2: Newspaper Text Alignment
Given paragraphs of words, an alignment mode (LEFT/RIGHT), and the maximum line width, format the text with a star border.
Use a two-pointer simulation:
- Keep adding words while they fit in the current line.
- When the next word exceeds the limit, start a new line.
- After generating each line, add spaces according to the alignment rule.
- Add the border characters at the end.
Most mistakes happen in formatting details:
- The border does not count toward the line width.
- The spaces between words must be calculated correctly.
- Final line formatting rules need extra attention.
It is worth testing multiple custom cases locally before submitting.
Problem 3: Most Similar Mountain Heights
You are given mountain heights. Only mountains with an index distance of at least viewingGap can be compared. Find the pair with the smallest height difference.
The brute-force solution is too slow for large inputs. The optimized approach is:
- Scan from left to right.
- Maintain previous eligible mountain heights in an ordered data structure.
- For the current height, check the closest previous values using predecessor and successor search.
- Update the minimum difference.
A balanced tree or sorted set works well. Another option is coordinate compression with a Fenwick Tree when needed.
Problem 4: Phone Backup Battery Scheduling
A phone needs to run for t minutes. Batteries are used in order. After a battery is exhausted, it must recharge before it can be used again. If all batteries are charging at the same time, return -1. Otherwise, return the number of batteries used.
This is a simulation with state tracking:
- Maintain the next available time for each battery.
- At every step, find a battery that can currently be used.
- Update its next available charging time.
- Continue until the required time is completed.
The most important edge case is the deadlock scenario where every battery is unavailable at the same moment.
Suggested Time Allocation
| Problem | Recommended Time |
|---|---|
| Drone Delivery | 5-8 minutes |
| Text Alignment | 8-12 minutes |
| Mountain Heights | 10-15 minutes |
| Battery Scheduling | 8-12 minutes |
Leave some extra time to check edge cases before submitting.
FAQ
Is TikTok 26NG OA the same as the internship OA?
The platform and overall style are very similar. Both usually use CodeSignal, with mostly Easy-Medium difficulty and significant overlap in question patterns.
Do I need a Fenwick Tree for the third problem?
Not necessarily. An ordered set with binary search is enough in many cases. The important part is avoiding an O(n²) brute-force solution.
Which other companies use similar CodeSignal OA styles?
Companies like HRT, Uber, Visa, and Capital One often have very similar 70-90 minute CodeSignal four-question formats. Practicing this style can cover multiple companies at once.
Final Thoughts
TikTok’s OA pattern is relatively stable. Once you are comfortable with simulation, formatting problems, range queries, and scheduling problems, the test becomes much more predictable.
The interesting part is that this question style is not limited to TikTok. The same CodeSignal patterns appear across multiple large tech companies.
We are InterviewShow. We have organized 130+ real CodeSignal OA questions covering the 70-minute four-question format. These core patterns and frequently tested topics are fully covered. If you are preparing for a specific company, feel free to reach out for a targeted practice list.
Good luck with your interviews!
Top comments (0)