Skip to content
tezvyn:

Top 30 Easy AI & ML Interview Questions and Answers for Freshers

30 easy multiple-choice AI & ML interview questions, the ones an interviewer opens with: definitions, everyday syntax, and the quick checks that you have really used it. They come from 30 bites in the AI & ML library, the gentlest slice of the 546 AI & ML interview questions in the library. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.

Artificial intelligence, machine learning, and data science

30 questions. Pick an answer, or open “Show the answer” to read it.

Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.

  1. Question 1 of 30

    Why does replacing sigmoid with ReLU in a deep network reduce vanishing gradients?

    Show the answer

    Answer: c · ReLU has a derivative of 1 for positive inputs, so it does not shrink gradients there

    ReLU's unit derivative in its active region avoids the sub-one multiplications that cause sigmoid's gradients to vanish across depth. ReLU is unbounded above, does not normalize, and does not amplify gradients beyond one.

    Read the full bite: Vanishing Gradients and Why ReLU Helps

  2. Question 2 of 30

    Why is HSV often preferred over RGB for segmenting a colored object across a scene with mixed sunlight and shadow?

    Show the answer

    Answer: b · Hue stays relatively stable under lighting changes, so color separates from brightness

    HSV isolates hue from value, so a color keeps its hue under varying illumination, easing thresholding. Both spaces cover the same color gamut, so the capacity claim is false.

    Read the full bite: RGB versus HSV color spaces

  3. Question 3 of 30

    Which approach best demonstrates a sound framework for measuring e-commerce user engagement?

    Show the answer

    Answer: a · Use DAU/MAU, adoption, retention, and stickiness tied to conversion and churn

    The card defines a strong framework as linking DAU/MAU, adoption, retention, and stickiness to trial conversion and churn. Tracking total page views is a red-flag vanity metric because it is untied to those outcomes.

    Read the full bite: What metrics track e-commerce user engagement and how do you prioritize them?

  4. Question 4 of 30

    How should a healthy production ML lifecycle be structured from start to finish?

    Show the answer

    Answer: c · As an iterative loop starting with business problem framing and continuing through post-deployment monitoring

    The correct answer is B because the card describes the lifecycle as an end-to-end engineering process that begins with business goal definition and requires continuous monitoring and feedback loops after deployment. The most tempting distractor is D because treating packaging as the final step omits critical monitoring, retraining, and validation stages that keep a production model healthy.

    Read the full bite: Describe the key stages of a typical ML lifecycle

  5. Question 5 of 30

    Which property of one-hot vectors prevents a model from inferring that 'excellent' and 'outstanding' are similar?

    Show the answer

    Answer: a · They are mutually orthogonal, giving every pair zero cosine similarity

    One-hot vectors are orthogonal by design, so every pair has zero cosine similarity and shares no geometric structure, meaning the model receives no hint that excellent and outstanding are related. Distractor A mistakes a practical symptom (huge size) for the root representational limitation.

    Read the full bite: Explain word embeddings and why they beat one-hot encoding for large vocabularies

  6. Question 6 of 30

    A photography platform archives original images for future editing and serves compressed previews. Which strategy best preserves fidelity while optimizing delivery?

    Show the answer

    Answer: d · Store originals in a lossless format and serve previews as lossy JPEG to reduce bandwidth.

    Lossless storage preserves bit-exact originals for future editing and avoids generational degradation, while lossy JPEG cuts preview sizes for faster web delivery. Option C is tempting because PNG guarantees exact pixels, but serving previews losslessly wastes bandwidth without perceptible quality gains over a well-compressed lossy image.

    Read the full bite: What is the difference between lossy and lossless image compression?

  7. Question 7 of 30

    An e-commerce site sees search users convert at 5% and non-search users at 2%. What is the best next step to estimate the true incremental impact of search?

    Show the answer

    Answer: a · Match searchers to similar non-searchers using device, landing page, and prior sessions, then compare rates

    Matching on confounders like device and landing page isolates selection bias, which is why the example shows the true incremental lift drops to roughly 25% after propensity matching. Running a two-sample t-test on the raw rates assumes the groups are comparable and would incorrectly validate an inflated, non-causal difference.

    Read the full bite: How would you validate that search users are more likely to purchase?

  8. Question 8 of 30

    Which scenario would trigger an automated MLOps deployment but typically not a traditional DevOps pipeline?

    Show the answer

    Answer: b · Production monitoring detecting drift in input data distributions

    The card states that MLOps deployments add triggers like data drift detection, unlike DevOps pipelines that react to code commits, dependency patches, or infrastructure changes. The GPU driver update is a tempting distractor because a common misconception is that MLOps is simply DevOps plus GPUs.

    Read the full bite: What are the primary differences between traditional DevOps and MLOps?

  9. Question 9 of 30

    Which statement best describes how histogram equalization remaps grayscale intensities?

    Show the answer

    Answer: d · It applies the cumulative distribution function to redistribute intensities toward a uniform histogram.

    Histogram equalization uses the cumulative distribution function of the original histogram to remap intensities so the output approximates a uniform distribution, maximizing global contrast. The first option describes linear contrast stretching, which merely rescales the minimum and maximum values without considering the frequency of each intensity level.

    Read the full bite: Describe a grayscale histogram and its use in exposure and equalization

  10. Question 10 of 30

    Beyond modeling long-range dependencies, what key training advantage does self-attention have over an LSTM?

    Show the answer

    Answer: c · It can process all sequence positions in parallel rather than step by step

    Self-attention computes all token interactions simultaneously, enabling parallel training that sequential LSTMs cannot match. It actually needs added positional encodings and is quadratic, not cheaper, in sequence length.

    Read the full bite: Self-Attention versus Recurrent Architectures

  11. Question 11 of 30

    Why should batch product metadata and streaming click events typically use different physical storage formats?

    Show the answer

    Answer: c · Row-oriented formats minimize write overhead for high-velocity events, while columnar formats improve projection and compression for batch analytics

    Row-oriented formats minimize write overhead for streaming ingestion while columnar formats allow efficient projection and compression for batch training data. Choosing columnar for both is tempting but adds unnecessary write overhead to high-velocity events.

    Read the full bite: Design ingestion for clickstream and batch product metadata

  12. Question 12 of 30

    Which hypothesis pair best tests whether a green signup button increases registrations compared to blue?

    Show the answer

    Answer: b · H0: The registration conversion rate for green equals that for blue; H1: The registration conversion rate for green is strictly greater than that for blue.

    The correct answer frames H0 as no difference and H1 as a directional increase in the specific metric, matching the one-tailed nature of the business question. Option A is tempting because it uses 'no difference,' but it wrongly uses a two-tailed alternative that ignores the directional ask and wastes statistical power.

    Read the full bite: What are your null and alternative hypotheses for this A/B test?

  13. Question 13 of 30

    When implementing a box blur, why is it important to write results into a separate destination buffer rather than updating the source image in place?

    Show the answer

    Answer: c · It prevents already-blurred pixel values from being reused in later neighborhood averages

    Using a separate destination buffer guarantees that every neighborhood average reads only original pixel values, not values that have already been blurred and would distort subsequent averages. The overflow issue in option B is addressed by using a larger type for the accumulator during the sum, not by allocating a second image buffer.

    Read the full bite: How would you implement a simple box blur on a grayscale image?

  14. Question 14 of 30

    Why does ELT better support iterative ML experimentation than ETL?

    Show the answer

    Answer: d · It allows repeated transformations of raw data within the warehouse without re-extraction

    ELT loads raw data into the target warehouse first, so data scientists can run and revise transformations repeatedly without rebuilding external pipelines or re-extracting source data. Option C describes ETL, which transforms data on a secondary server before loading and requires pipeline changes for new logic.

    Read the full bite: ETL vs ELT: when to prefer each for ML?

  15. Question 15 of 30

    You run an experiment and obtain p = 0.03. Which statement correctly interprets this p-value?

    Show the answer

    Answer: c · If the null hypothesis were true, there is a 3% probability of observing data at least this extreme.

    A p-value assumes the null hypothesis is true and quantifies the probability of seeing data at least this extreme under that assumption; it does not measure the probability that the null is false, that the alternative is true, or that the result occurred by chance.

    Read the full bite: What is a p-value? Interpret p = 0.03 at alpha = 0.05.

  16. Question 16 of 30

    A grayscale image looks dull because most pixels are clustered between intensity 100 and 150. After histogram equalization, what has fundamentally changed about the pixel intensities?

    Show the answer

    Answer: c · A transfer function based on the cumulative intensity distribution was used as a lookup table to spread values across the full range.

    Histogram equalization computes the cumulative distribution function from the histogram, normalizes it to the maximum intensity, and uses it as a lookup table to remap pixels across the full range. Option A describes linear contrast stretching, which only scales the min and max values without considering the actual probability distribution of intensities.

    Read the full bite: What is an image histogram and how does histogram equalization improve contrast?

  17. Question 17 of 30

    Which upstream strategy best prevents a categorical encoder from crashing when new values appear in training data?

    Show the answer

    Answer: a · Enforce a locked schema that rejects batches with out-of-domain categories before encoding

    Enforcing a locked schema upstream acts as a hard gate that stops bad batches before they reach the encoder and forces explicit review for domain changes. Relying solely on an OOV bucket is wrong because the card treats it only as a last-resort safety net, not a primary data-quality strategy, and using it alone can mask upstream data bugs.

    Read the full bite: What data validation strategy prevents new categories from breaking your encoder?

  18. Question 18 of 30

    What fundamentally distinguishes BERT's masked language modeling from GPT's causal language modeling?

    Show the answer

    Answer: d · MLM predicts masked tokens using bidirectional context; CLM predicts the next token from left context only

    MLM reconstructs hidden tokens using context from both sides, suiting understanding, while CLM's left-only next-token prediction suits generation. Both are self-supervised, and it is CLM, not MLM, that generates autoregressively.

    Read the full bite: Causal versus Masked Language Modeling

  19. Question 19 of 30

    Why does the Harris detector consider a corner a more reliable tracking feature than a point along a straight edge?

    Show the answer

    Answer: a · A corner constrains position in two directions, while an edge point can slide along the edge

    At a corner, intensity changes in every shift direction, giving large eigenvalues and a precise 2D location. Along an edge only one direction constrains position, so the point slides (the aperture problem).

    Read the full bite: Harris corner detector and corner stability

  20. Question 20 of 30

    A pandas DataFrame has 5% missing values in customer_age, completely at random. When is dropna the better choice over fillna?

    Show the answer

    Answer: c · When generating a quick aggregate report and the remaining 95% of data is sufficient

    The card states that dropna is safe for a quick aggregate report when data is missing completely at random and the remaining sample is still large enough. Option A describes the opposite scenario: when age is predictive, dropping rows discards valuable labeled outcomes and reduces model performance, so imputation is preferred instead.

    Read the full bite: Describe strategies for handling missing values in pandas DataFrames

  21. Question 21 of 30

    What must a few-shot classification prompt include that a zero-shot prompt must not?

    Show the answer

    Answer: d · Two to four labeled demonstrations showing feedback mapped to categories

    Few-shot prompts rely on in-context learning through explicit input-output demonstrations, which zero-shot prompts omit by definition. Task instructions, output formats, and category labels are components present in both approaches, so selecting them confuses auxiliary structure with the defining presence of labeled examples.

    Read the full bite: How would you construct zero-shot and few-shot prompts for feedback classification?

  22. Question 22 of 30

    How does the Canny edge detector relate to the Sobel operator in a typical pipeline?

    Show the answer

    Answer: a · Canny uses Sobel-style gradients, then adds non-maximum suppression and hysteresis thresholding

    Canny is a multi-stage pipeline that computes gradients (as Sobel does), thins them with non-maximum suppression, and links them with double-threshold hysteresis. Sobel alone gives thick, noisy edges.

    Read the full bite: Image gradients, Sobel, and Canny

  23. Question 23 of 30

    A model degrades in production because separate batch and streaming pipelines produce slightly different values for the same feature. What does a feature store primarily solve here?

    Show the answer

    Answer: b · It ensures identical transformation logic is used for both training and real-time serving

    A feature store prevents training-serving skew by governing the same transformations and definitions across batch and real-time contexts. Describing it as merely a cache or database misses its core consistency and governance role.

    Read the full bite: What problems does a Feature Store solve in ML systems?

  24. Question 24 of 30

    For a DataFrame with a string index, which call raises an error and why?

    Show the answer

    Answer: d · df.iloc['x'], because iloc requires integer positions not labels

    iloc is strictly positional and rejects a string label, raising a TypeError. df.loc['x'] and df.iloc[0] both work correctly on a string-indexed frame.

    Read the full bite: Pandas loc versus iloc indexing

  25. Question 25 of 30

    How does Chain-of-Thought prompting change the way a model solves a multi-step problem compared with standard prompting?

    Show the answer

    Answer: a · It makes the model output intermediate reasoning steps that become additional context for the final answer.

    CoT prompting works by inducing the model to generate intermediate reasoning steps as tokens, creating additional context that the model attends to when producing the final answer. Distractor A is wrong because it anthropomorphizes the model as performing deeper internal thinking, whereas the actual mechanism is simply conditioning the final prediction on an explicit externalized reasoning trace.

    Read the full bite: Explain Chain-of-Thought prompting, its reasoning mechanism, and ideal use cases

  26. Question 26 of 30

    When converting a large list of flat dictionaries to a pandas DataFrame, which method minimizes Python-level overhead by leveraging vectorized C-backed construction?

    Show the answer

    Answer: c · Pass the list of dicts directly to pd.DataFrame so the constructor builds the block manager in one pass

    Passing the list directly to pd.DataFrame leverages a C-backed constructor that builds the block manager in a single vectorized pass. Option D is tempting but wrong because iteratively using pd.concat creates a new DataFrame each iteration, resulting in quadratic time complexity from repeated memory copies.

    Read the full bite: Most efficient way to convert list of dicts to pandas DataFrame

  27. Question 27 of 30

    When would you choose an online feature store over an offline store for a production system?

    Show the answer

    Answer: d · When you need millisecond-scale lookups for real-time inference on fresh data

    Online feature stores are optimized for millisecond-scale lookups and real-time serving, while offline stores handle batch training and large historical datasets. Treating the offline store as a slower interchangeable backup or using a single database ignores the latency and access-pattern trade-offs that make the architectures distinct.

    Read the full bite: Online vs offline feature store architecture and use cases

  28. Question 28 of 30

    Which statement best describes how supervised fine-tuning updates a pre-trained language model?

    Show the answer

    Answer: b · It updates existing weights by predicting the next token only on curated assistant completions, masking the prompt.

    Supervised fine-tuning updates existing weights by continuing next-token prediction on curated prompt-completion data, computing loss only on assistant tokens while masking prompts. The most tempting distractor is wrong because SFT deliberately uses curated demonstrations and a small learning rate, not raw internet text like pre-training.

    Read the full bite: Describe supervised fine-tuning for a pre-trained language model

  29. Question 29 of 30

    A team wants their LLM to reliably cite this week's internal sales figures. Why is fine-tuning the base model a poor primary tool for this requirement?

    Show the answer

    Answer: c · Fine-tuning mainly steers existing capabilities and is unreliable for injecting fresh, specific facts

    Fine-tuning adapts and steers learned behaviors rather than dependably storing new facts, so retrieval is better for fresh data. It does not cost more than pre-training, nor does it wipe out language ability.

    Read the full bite: Pre-training versus fine-tuning an LLM

  30. Question 30 of 30

    Knowing point p1 in the first image, why does the epipolar constraint reduce the search for its match p2 to a single line in the second image?

    Show the answer

    Answer: d · Because p1's 3D point lies along one viewing ray, which projects to a line in the second image

    The unknown depth of p1 means its 3D point spans a ray, and that ray projects to the epipolar line in the second image where p2 must lie. Identical intrinsics or rectification are not required for the constraint to hold.

    Read the full bite: Epipolar constraint for correspondence search

Could you explain these out loud?

That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon