← TikTok Interview Insights

TikTok·Machine Learning Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Conceptual ML round at TikTok for an MLE role. Three questions, all theory-heavy, no coding. Felt more like a grad school oral exam than a typical tech screen.

Questions Asked (3)

Q1

Walk me through the main components of a Transformer block and explain what each one does.

Technical Trade-offsSystem Design
Author's notes

Knew this one cold.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start with a high-level overview of the Transformer block, then systematically describe each component (multi-head self-attention, feed-forward network, residual connections, layer normalization) and its function. Emphasize how these components work together to enable parallel processing and capture long-range dependencies, and briefly mention trade-offs like computational complexity.

Pro tip: Relate the components to real-world applications at TikTok, such as how self-attention helps model user interactions across videos, and discuss trade-offs like the quadratic complexity of attention and how techniques like sparse attention or linear approximations can mitigate it.

1. Overview of Transformer Block

Briefly state that a Transformer block is the fundamental building unit of the Transformer architecture, consisting of multi-head self-attention, feed-forward network, residual connections, and layer normalization.

2. Multi-Head Self-Attention

Explain that it computes attention scores between all positions in the input sequence, allowing the model to weigh the importance of different tokens. Mention that multiple heads capture diverse relationships.

3. Feed-Forward Network

Describe it as a position-wise fully connected network (typically two linear layers with a ReLU activation) that introduces non-linearity and transforms the attended representations.

4. Residual Connections and Layer Normalization

Explain that residual connections add the input to the output of each sub-layer to ease gradient flow, and layer normalization stabilizes training by normalizing activations across features.

5. Putting It Together and Trade-offs

Summarize how these components are stacked (often with pre- or post-norm) and discuss trade-offs such as computational complexity, memory usage, and parallelizability compared to RNNs.

Key Points to Mention

  • Multi-head self-attention mechanism and its role in capturing contextual relationships
  • Position-wise feed-forward network with non-linear activation
  • Residual connections for mitigating vanishing gradients
  • Layer normalization for training stability
  • Order of operations (pre-norm vs. post-norm) and its impact
  • Computational complexity O(n^2) for sequence length n and potential optimizations

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

What are the key architectural and pretraining differences between GPT and BERT, and when would you choose one over the other?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

This is where I probably lost some points.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by contrasting the architectural foundations: GPT's decoder-only, autoregressive design versus BERT's encoder-only, bidirectional design. Then explain how pretraining objectives (causal language modeling vs. masked language modeling) shape their capabilities, and finally map these differences to practical use cases like text generation versus understanding tasks.

Pro tip: Emphasize that the choice often depends on whether your task requires generation or understanding, but also mention hybrid approaches (e.g., using BERT for retrieval and GPT for generation) to show depth. At TikTok, where content understanding and generation both matter, this nuance is valuable.

1. Architectural Differences

Explain that GPT uses a decoder-only Transformer with causal (left-to-right) attention, while BERT uses an encoder-only Transformer with bidirectional attention. Mention that GPT is autoregressive, generating one token at a time, whereas BERT processes the entire input simultaneously.

2. Pretraining Objectives

Describe GPT's pretraining as causal language modeling (predict next token) and BERT's as masked language modeling (predict randomly masked tokens) plus next sentence prediction. Highlight how these objectives lead to different strengths: GPT excels at generation, BERT at understanding context.

3. Fine-tuning and Use Cases

Discuss how GPT is typically fine-tuned for generation tasks (e.g., summarization, dialogue) and BERT for discriminative tasks (e.g., classification, named entity recognition). Mention that BERT's bidirectional context helps with tasks requiring deep understanding, while GPT's sequential nature suits open-ended generation.

4. Trade-offs and Selection Criteria

Outline when to choose one over the other: BERT for tasks where full context is needed and generation is not required (e.g., sentiment analysis, question answering), GPT for tasks requiring coherent text generation or few-shot learning. Consider factors like latency, model size, and computational resources.

5. Real-world Examples and Hybrid Approaches

Provide examples: BERT for content moderation or search ranking, GPT for chatbots or content creation. Mention that in practice, hybrid systems (e.g., BERT for retrieval, GPT for response generation) are common, especially in large-scale applications like TikTok.

Key Points to Mention

  • Decoder-only vs. encoder-only architecture and attention mechanisms (causal vs. bidirectional).
  • Pretraining objectives: causal language modeling vs. masked language modeling.
  • Strengths: GPT for generation, BERT for understanding and classification.
  • Fine-tuning approaches: sequence generation vs. sequence labeling/classification.
  • Trade-offs: computational cost, inference speed, and suitability for few-shot learning.
  • Hybrid systems and practical considerations in industry (e.g., retrieval-augmented generation).

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Define precision and recall, then explain how adjusting a classification threshold shifts the tradeoff between them. Give examples of when you'd prioritize each.

Product Analytics & MetricsA/B Testing & Experimentation
Author's notes

Pretty standard.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining precision and recall with their formulas, then explain how the threshold controls the precision-recall tradeoff. Use a concrete example (e.g., TikTok content moderation) to illustrate when to prioritize each metric, and tie it back to business impact.

Pro tip: Mention that the choice of metric should be driven by the relative cost of false positives vs. false negatives, and that in practice you often tune the threshold to meet a specific precision or recall target rather than optimizing a single metric.

1. Define precision and recall

Precision = TP / (TP + FP), the fraction of positive predictions that are correct. Recall = TP / (TP + FN), the fraction of actual positives that are correctly identified.

2. Explain threshold effect

Lowering the threshold classifies more items as positive, typically increasing recall but decreasing precision. Raising the threshold does the opposite, increasing precision but decreasing recall.

3. Illustrate with an example

Use a TikTok-specific scenario, such as content moderation: high recall to catch all harmful content (even if some false positives), or high precision to avoid over-removing benign content.

4. Discuss prioritization based on costs

Prioritize recall when false negatives are costly (e.g., missing a violation), and precision when false positives are costly (e.g., wrongly banning a user). Mention that the optimal threshold depends on the business context.

5. Conclude with practical tuning

Summarize that the threshold is a tunable parameter to balance precision and recall, and that in practice you might use metrics like F1 or PR-AUC to evaluate overall performance.

Key Points to Mention

  • Precision and recall definitions with formulas
  • Confusion matrix and TP, FP, FN, TN
  • Threshold as a decision boundary
  • Tradeoff: increasing recall often decreases precision and vice versa
  • Examples: spam detection (precision), cancer screening (recall), content moderation (both)
  • Business context determines which metric to prioritize

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.