Skip to content
tezvyn:

🤖AI & ML

Artificial intelligence, machine learning, and data science

298 bites

Test yourself: Top 30 intermediate AI & ML interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Intermediate interview questions in AI & ML, page 15

intermediate1 min read

How is IoU computed and why prefer mIoU?

IoU is intersection over union of predicted and true pixels; mIoU averages per class; pixel accuracy is dominated by background.

intermediate1 min read

Parquet versus CSV for analytical data lakes

Parquet stores by column enabling projection pushdown, compression, and predicate skipping; CSV is row-based, untyped, and slow to scan.

intermediate1 min read

Loss functions for imbalanced medical segmentation

Cross-entropy is swamped by background; Dice optimizes overlap directly; Focal down-weights easy pixels.

intermediate2 min read

Design a cost-aware ML training platform for heterogeneous hardware

Tests hardware abstraction and cost-aware cross-accelerator scheduling. Strong answers cover a device-agnostic spec, a performance predictor, a cost-per-step model, and bin-packing against spot prices. Red flag: ignoring per-step cost and migration overhead.

intermediate1 min read

Interactive versus static plots for EDA

Interactive libraries win for exploring dense, high-cardinality, or multi-dimensional data via zoom, hover, and filtering; static plots win for reproducible, publication output.

intermediate1 min read

Design real-time multi-object tracking for AV

Fast detector, Kalman motion model, Hungarian association on IoU plus appearance, track lifecycle for occlusions.

intermediate1 min read

Present a small but significant A/B test lift

Hypothesis, design and validity checks, result with effect size and interval, business impact of 0.5%, then a clear recommendation.

intermediate1 min read

Filter-based vs optimization-based SLAM

EKF folds past poses into one Gaussian; optimization keeps a sparse graph and re-linearizes; the latter wins on accuracy and loop closure.

intermediate1 min read

Explain an interaction effect to a non-statistician

Define interaction as it depends on, show separate slope lines per age group, give the business takeaway on targeting.

intermediate2 min read

What does N-way K-shot classification mean?

N is classes per episode, K is labeled examples per class in the support set, prediction is on a separate query set.

intermediate1 min read

Demographic Parity versus Equalized Odds in hiring

Demographic parity equalizes selection rates regardless of qualification; equalized odds equalizes true and false positive rates across groups, conditioning on the true label.

intermediate1 min read

Design an active learning loop for detection

Seed-train, score the pool by uncertainty plus diversity, batch to annotators, retrain, repeat.

intermediate2 min read

Explain prompt injection and how to defend against it

This question tests your understanding of LLM security vulnerabilities and how untrusted user input can manipulate model behavior. A strong answer defines prompt injection as hijacking the model's instructions, then outlines a layered defense including input sanitization, instruction-tuned models, and separating user input from system prompts. A common red flag is confusing it with traditional SQL injection or suggesting simple input filtering is a sufficient solution.

How does positional encoding work in transformers?
intermediate2 min read

How does positional encoding work in transformers?

This tests your understanding of why Transformers need explicit position data. A great answer explains that self-attention is permutation-invariant, meaning it sees inputs as an unordered set. Positional encodings—vectors derived from sine and cosine functions—are then added to the input embeddings to inject sequence order. A red flag is simply saying 'it adds position' without explaining why this is necessary or how it's done.

Encoder-Only vs. Decoder-Only vs. Encoder-Decoder Transformers?
intermediate2 min read

Encoder-Only vs. Decoder-Only vs. Encoder-Decoder Transformers?

This tests your ability to connect transformer architecture to specific NLP tasks. A great answer explains how each model's attention mechanism dictates its use: encoder-only (bidirectional attention) for understanding content, decoder-only (causal attention) for text generation, and encoder-decoder for sequence-to-sequence tasks like translation. The key red flag is failing to explain the *why* behind the task suitability—the attention mechanism.

intermediate2 min read

RAG vs. Fine-Tuning: Key Differences

This tests your understanding of how LLMs incorporate knowledge, specifically the trade-offs between embedding it in model weights versus retrieving it at runtime. A great answer defines RAG as runtime retrieval from an external source and fine-tuning as baking knowledge into model parameters, then contrasts their approaches to knowledge updates, cost, and providing citations. A red flag is stating one is always better, or failing to explain that they solve different problems and can be used tog

intermediate2 min read

What is the trade-off between top-k and top-p sampling?

This tests your practical knowledge of tuning LLM output for the creativity vs. coherence trade-off. A strong answer defines top-k (static token count) and top-p (dynamic probability mass), then explains that top-p's adaptive window is generally more robust than top-k's fixed window. A red flag is failing to contrast the static nature of top-k with the dynamic nature of top-p, which is the core of the trade-off.

Explain the concept of self-attention
intermediate2 min read

Explain the concept of self-attention

This tests your ability to explain the core mechanism of Transformers. A strong answer defines self-attention as a process for relating positions of a single sequence, explains the Query-Key-Value (QKV) model where a token's Query is compared to all Keys to generate weights, and describes how these weights create a weighted sum of Values. A red flag is vaguely describing 'importance' without mentioning the QKV mechanism.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles