Skip to content
tezvyn:

🤖AI & ML

Artificial intelligence, machine learning, and data science

546 bites

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

Interview questions in AI & ML, page 27

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.

How do agents use tool-calling and what can go wrong?
advanced2 min read

How do agents use tool-calling and what can go wrong?

This tests your grasp of practical agentic architectures and their real-world trade-offs. A great answer distinguishes between predefined "workflows" and dynamic "agents," explains how an augmented LLM selects tools, and then details failure modes like framework obfuscation, debugging complexity, and the high latency/cost of multi-step processes. A red flag is vaguely describing agents without separating these patterns or ignoring the significant debugging and cost challenges.

advanced2 min read

Trade-offs between dense and sparse retrieval in RAG?

This question tests your grasp of information retrieval fundamentals and their practical trade-offs in a modern RAG system. A strong answer first defines dense (semantic) and sparse (keyword) retrieval, then contrasts their performance on different query types, and finally analyzes their operational costs (compute, storage, latency). A common red flag is declaring dense retrieval universally superior without acknowledging its weaknesses, particularly with keywords and identifiers.

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.

What is the KV cache and why does it matter for serving LLMs?
advanced3 min read

What is the KV cache and why does it matter for serving LLMs?

This question tests your understanding of performance bottlenecks in autoregressive LLM inference. A great answer first explains that the attention mechanism computes Key (K) and Value (V) tensors for all input tokens. Then, it highlights the redundancy of recomputing these for past tokens at each new generation step. The KV cache solves this by storing these tensors, drastically reducing latency. A red flag is vaguely calling it a 'cache' without connecting it to K/V tensors.

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.

advanced2 min read

Why are MoE models larger but cheaper to run?

This tests your understanding of sparse activation versus dense models. A great answer defines Mixture-of-Experts (MoE) as a system with a router and multiple expert sub-networks, explaining that only a fraction of the total parameters are activated for any given token, which drastically reduces computational cost (FLOPs) during inference. A red flag is describing MoE as a simple ensemble without mentioning the sparse routing mechanism that enables its efficiency.

advanced2 min read

When would you use LoRA vs full fine-tuning?

This tests your grasp of practical trade-offs in ML systems, specifically training cost versus model customization. A great answer explains that LoRA is a parameter-efficient method ideal for resource-constrained scenarios, reducing trainable parameters by 10,000x and GPU memory by 3x. Full fine-tuning is for high-budget projects requiring deep model changes. A red flag is vaguely saying LoRA is 'cheaper' without quantifying the resource savings or explaining the mechanism.

easy2 min read

What is the role of temperature in token sampling?

This tests your understanding of how to control the creativity and randomness of a language model's output. A great answer explains that temperature is a divisor applied to the model's logits before the softmax function. Low temperature makes the output more deterministic by sharpening the probability distribution, while high temperature increases randomness by flattening it. A common red flag is vaguely saying it 'controls randomness' without explaining the underlying softmax 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