CrackML by @ml.with.umang
Interview questions / GenAI & LLM
GenAI & LLM interview question

Explain BERT and its pretraining objectives.

Explain BERT and its pretraining objectives. Structure your response as you would in a top-tier ML/AI engineering interview.

mediumconceptEvidence 75/1001 source reportTikTok

The 60-second answer

Contrast encoder-only bidirectional attention with decoder-only causal attention and state the corresponding pretraining objectives. Explain why BERT naturally produces contextual representations while GPT naturally supports autoregressive generation.

Build the answer in this order

1
Define the mechanism

Contrast encoder-only bidirectional attention with decoder-only causal attention and state the corresponding pretraining objectives.

2
Explain the architecture

Explain why BERT naturally produces contextual representations while GPT naturally supports autoregressive generation.

3
Compare trade-offs

Compare fine-tuning/inference interfaces, masking, context direction, and common downstream use cases.

4
Close with serving + evaluation

Discuss evaluation and serving trade-offs rather than reducing the comparison to model size.

A useful interview mental model

This is the shape of a strong answer—not a script to memorize.

01Definition
02Mechanism
03Trade-offs
04Failure modes
05When to use

Senior-level signal

  • Tie architecture choice to latency, context length, output type, and whether the product needs generation or representation learning.
  • Mention that modern variants blur simple families, so objective and attention mask are more fundamental than model branding.

What the interviewer is really testing

Understanding beyond prompting: architecture, retrieval, evaluation, inference, safety, latency, cost, and failure recovery.

Likely follow-up questions

What assumption makes this approach work?
When would you choose the strongest alternative instead?
What production or data failure mode changes your answer?

Common weak-answer patterns

  • Reciting a definition without mechanism or assumptions.
  • Claiming one technique is always better without a data regime.
  • Stopping before failure modes, validation, or deployment implications.