FastPrepTikRouter Delivers
Problems/TikRouter Delivers

TikRouter Delivers

TikTok logoTikTok● EasyOA

Updated Sep 2026

QuestionFunctionExamplesConstraints

Problem statement

Imagine you're in charge of TikTok's servers, where millions of videos, comments, and likes are constantly flowing between users.

TikTok needs to send these small packets of data across its network to keep users' feeds smooth and up-to-date. However, there's a catch! The TikTok delivery drone, which we'll call TikRouter, can only carry a limited amount of data on each trip between servers.

  • Each "like," comment, or part of a video clip is between 1.01 bytes and 3.00 bytes in size.
  • TikRouter is responsible for delivering these packets of interactions to TikTok's users but can carry only up to 3.00 bytes per trip.

As the network administrator in charge of TikRouter, your goal is to minimize the number of trips it makes. Each time TikRouter makes a trip, it grabs as many likes, comments, and video snippets as it can without exceeding the 3.00-byte limit. After each delivery, TikRouter returns for more until all packets are delivered.

Your challenge is to design an efficient algorithm that helps TikRouter determine the minimum number of trips required to deliver n packets of varying sizes.

Function

findMinimumTripsByTikRouter(packet_sizes: float[]) → int

Complete the function findMinimumTripsByTikRouter in the editor below.

findMinimumTripsByTikRouter has the following parameter(s):

  1. float packet_sizes[n]: size of the data packets (in bytes)

Returns int: the minimum number of trips required

Examples

Example 1

packet_sizes = [1.01, 1.99, 2.5]return = 2

TikRouter can deliver all the data packets in two trips: [1.01 + 1.99, 2.5].

Thus, the answer is 2.

Constraints

  • 🍉🍉

More TikTok interview questions

  • Center of the Largest Perfect X-ShapeOA · Seen Nov 2026
  • Count Subarrays Matching a Comparison PatternOA · Seen Nov 2026
  • Count Suffix Word PairsOA · Seen Nov 2026
  • Minimum Cost of Every K-Capable Model SetOA · Seen Nov 2026
  • Longest Substring Without Repeating CharactersPHONE SCREEN · Seen Oct 2026
  • Next Greater Indices and Maximum GapPHONE SCREEN · Seen Oct 2026
  • Count Subarrays with at Least K Equal-Fruit PairsOA · Seen Oct 2026
  • Shell Command Counts with History ReferencesOA · Seen Oct 2026
  • Product Minus Sum of DigitsOA · Seen Aug 2026
  • Count 2x2 Submatrices by Black CellsOA · Seen Aug 2026

Similar questions at other companies

  • Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Can Every Package Fit in a BoxIMC Trading · OAIMC Trading interview questions
  • Minimum Tunnel Crossing TimeArcesium · OAArcesium interview questions
  • PairsJP Morgan Chase · OAJP Morgan Chase interview questions
  • Get Maximum PairsAmazon · OA
  • Find Maximum GreatnessTwilio · OATwilio interview questions
  • Binge WatchingVanguard · OAVanguard interview questions
  • Maximum Easy Tasks After RearrangingIBM · OAIBM interview questions
  • Latest Arrival to Catch a BusAutodesk · OAAutodesk interview questions
  • Minimum Removals to Balance ArraySalesforce · OASalesforce interview questions

TikTok interview experiences

  • TikTok AI Infra Intern LLM Round 2: 1 Experience
  • TikTok AI Infra Intern DeepSpeed Round: 1 Experience
  • TikTok AI Infra Intern Kernel Round: 1 Experience
  • TikTok AI Infra Intern Interviews, 3 Rounds: 1 Experience
  • TikTok AI Infra Intern Interview Timeline: 1 Experience
  • TikTok AI Infra Intern Onsite Round 2: 1 Experience
All TikTok interview questionsSee TikTok hiring insights
Saved
class Solution {
    public int findMinimumTripsByTikRouter(float[] packet_sizes) {
      // write your code here
    }

}
Checking account…