Panda Guru LogoPanda
Guru

TikTok AMS Grad Assessment 2025 Start-16-21 Nov (Generic)

Round 1

Questions:

Question

In the dynamic landscape of TikTok, creators are in a constant race to boost their videos' engagement by leveraging new features that enhance their content.

Each creator starts with a set of m videos, represented by initialReelImpacts, which indicates the baseline popularity of each reel. For the next n days, TikTok releases new trending features, represented by newReelImpacts, with each feature offering an additional boost to the creator's existing reels.

PROCESS FOR EACH DAY:

NOTE:

EXAMPLE INPUT:

m = 2 initialReelImpacts = [2, 3] n = 3 newReelImpacts = [4, 5, 1] k = 2

EXPLANATION:

OUTPUT: Total Impact Score = 13

FUNCTION DESCRIPTION: Complete the function getTotalImpact in the editor below.

PARAMETERS:

RETURNS: long: The total impact achieved by the creator after incorporating all elements from newReelImpacts.

EXAMPLE INPUT/OUTPUT: EXAMPLE 1: Input:

m = 2 initialReelImpacts = [2, 3] n = 3 newReelImpacts = [4, 5, 1] k = 2

Output:

13
Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 2

Questions:

Question

In ByteDance's vast network of data centers, millions of interconnected servers process content requests, handle user interactions, and deliver data to users globally. Each server is part of a dynamic task execution flow, represented by an array serverTasks, where each entry in the array indicates the next server in the chain that will handle a task.

PROBLEM DESCRIPTION: Optimizing the data pipeline requires careful management of these task handoffs. Once a task is picked up by server i, it triggers a dependency on server serverTasks[i], transferring the load there. However, this data transfer disables both servers i and serverTasks[i] from participating in any further task handoffs, as they are locked due to processing the current load.

Therefore, selecting the right servers and managing the chain reactions of these task handoffs is crucial for maximizing throughput.

Each server at index i points to the next server serverTasks[i], where the task is transferred. Once this transfer occurs, both the sending server and the receiving server become unavailable for subsequent tasks. Your challenge is to select servers in such a way that maximizes the overall throughput score. The throughput score is determined by the sum of the indices of the servers where tasks are successfully handed off.

TASK: Your task is to analyze this network of server-to-server task handoffs, navigate the dependencies, and determine the maximum possible throughput score that can be achieved by optimally choosing the task handoffs.

INPUT: Given the array serverTasks, calculate the maximum throughput score achievable by performing these operations in the most efficient way.

EXAMPLE INPUT:

n = 3 serverTasks = [0, 1, 2]

EXPLANATION:

OUTPUT:

3

FUNCTION DESCRIPTION: Complete the function calculateMaxProcessingThroughput.

FUNCTION SIGNATURE: calculateMaxProcessingThroughput(serverTasks)

PARAMETERS:

RETURNS: long: The maximum throughput score achievable.

CONSTRAINTS: 1 ≤ n ≤ 200000 0 ≤ serverTasks[i] < n

SAMPLE INPUT AND OUTPUT: SAMPLE INPUT 0:

3 serverTasks = [2, 1, 0]

SAMPLE OUTPUT 0:

3

SAMPLE INPUT 1:

4 serverTasks = [3, 0, 1, 2]

SAMPLE OUTPUT 1:

6

EXPLANATION FOR INPUT 1: The sequence [3, 0, 1, 2] allows for a total throughput score of 6.

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.