Machine Learning Engineer Interview Questions
Practice the exact questions companies are asking right now.
Explain KV cache in Transformer inference
Question In Transformer-based language model inference, what is a key-value (KV) cache? Explain: - What gets cached (tensors, shapes at a high level) ...
Design a RAG system with evaluation
Scenario You are asked to design a Retrieval-Augmented Generation (RAG) system that answers user questions using a private corpus (e.g., internal docs...
Design a fraud detection system
Scenario You are designing an end-to-end fraud detection system for an online platform (e.g., e-commerce marketplace, payments, account signup, or ad ...
Compute time to infect all cells
You are given an n × m grid representing people in a city. - Each cell is either infected (1) or healthy (0). - Two cells are neighbors if they share ...
Design Jira bug-to-team classification system
Problem Design a system that automatically classifies incoming Jira bug tickets into the most appropriate owning team, and produces a report for custo...
Design a scalable chatbot platform
Problem Design a production chatbot platform that can answer user questions and hold multi-turn conversations for a product/company. Assume the chatbo...
How would you build an image classifier with dirty data?
Scenario You are asked to build an image classification model (single-label, multi-class) for a product team. The image dataset is known to be dirty (...
Implement an LRU Cache
Problem Design and implement an LRU (Least Recently Used) Cache that supports the following operations in O(1) average time: - get(key): - Return th...
Find shortest path in a maze grid
Maze shortest path You are given a 2D grid maze of size m x n where: - 0 represents an open cell - 1 represents a wall (cannot pass) You are also give...
Design an ads ranking system with calibration
ML System Design: Ads Ranking (e-commerce) Design an online ads ranking (ad “re-ranking”) system for an e-commerce app. The system receives a request ...
Design O(1) cache and moving average
Problem You are asked two coding questions: 1) O(1) cache data structure Design a data structure that supports the following operations in O(1) averag...
Design a real-time home feed ranker
Scenario Design a real-time home feed (e.g., social or content platform) that is responsive to user engagement. Users open the app and see a ranked li...
Implement K-means clustering from scratch
Task Implement K-means clustering from scratch (no ML libraries). You are given a dataset of points: - Input: an array X of shape (n, d) (n points, ea...
Explain leakage, missing data, and common losses
Answer the following traditional ML questions: 1. Data leakage - What is data leakage? - Give 2–3 common examples. - How do you prevent or fi...
Design a search query autocomplete system
Question Design a search autocomplete system that suggests completions as the user types. Requirements - Sub-100ms latency per keystroke. - Suggestion...
Find two numbers summing to target without hashmap
Problem Given an integer array nums (length n) and an integer target, return the indices (i, j) such that: - i != j - nums[i] + nums[j] == target You ...
Debug transformer and train classifier
Debug and Fix a Transformer Text Classifier, Then Train and Evaluate It Context You inherit a small codebase for a transformer-based text classifier. ...
Solve OA tasks on string, grid path, subarrays
You are given three independent coding tasks. Task 1: Reverse the middle if ends are vowels Given a string s (ASCII letters), if both the first and la...
Implement 2D convolution forward pass
Problem Implement the forward pass of a 2D convolution (conv2d) from scratch (no deep learning libraries). You are given: - Input tensor x with shape ...
Deep copy a linked list with random pointers
Problem You are given the head of a linked list where each node has: - val: integer value - next: pointer to the next node (or null) - random: pointer...