Machine Learning Engineer Coding & Algorithms Interview Questions

Practice 316 real Coding & Algorithms interview questions for Machine Learning Engineer roles. From companies including Meta, Amazon, OpenAI, TikTok, Pinterest.

316 Questions 72 Companies08.05.2026
Showing 20 results
Role
Meta logo
Meta
Medium
Machine Learning Engineer

Solve linked list, tree, and grid problems

Problem A — Find cycle entry in a singly linked list You are given the head of a singly linked list. The list may contain a cycle. - Return the node w...

Coding & Algorithms
15
0
107 people solved
Dec 15, 2025
Microsoft logo
Microsoft
Medium
Machine Learning Engineer Locked

Implement SFT Sample Packing

This question evaluates proficiency in preprocessing for autoregressive language models, including deterministic sequence packing, construction of los...

Coding & Algorithms
4
0
49 people solved
Apr 13, 2026
Zoox logo
Zoox
Medium
Machine Learning Engineer Locked

Compute Roller Coaster Scores

This question evaluates proficiency in string parsing, floating-point arithmetic, conditional logic, and designing extensible rule-based scoring syste...

Coding & Algorithms
7
0
99 people solved
May 2, 2026
OpenAI logo
OpenAI
Medium
Machine Learning Engineer Locked

Find Minimum Compatible Version

This question evaluates binary search, monotonic predicates, careful version ordering, and cost-aware optimization of expensive compatibility checks. ...

Coding & Algorithms
11
0
153 people solved
Mar 9, 2026
Snapchat logo
Snapchat
Medium
Machine Learning EngineerNew Grad Locked

Find K Nearest Points

This question evaluates proficiency with Euclidean distance metrics, selection algorithms, and efficient data structures for partial sorting, while re...

Coding & Algorithms
6
0
43 people solved
Feb 2, 2026
Capital One logo
Capital One
Medium
Machine Learning Engineer

Return all root-to-leaf tree paths

Given the root of a binary tree, return all root-to-leaf paths. - A leaf is a node with no children. - A path should be represented as a string with n...

Coding & Algorithms
11
0
83 people solved
Dec 15, 2025
Meta logo
Meta
Medium
Machine Learning EngineerIntern AI Locked

Implement Sparse Matrix Operations

This question evaluates proficiency in sparse linear algebra, efficient algorithms, and data-structure design for numerical and machine learning workl...

Coding & Algorithms
6
0
52 people solved
Feb 8, 2026
Spotify logo
Spotify
Medium
Machine Learning Engineer

Join Tables and Rank Users

You are given two analytics tables: - users(user_id, country, signup_date) - listening_events(event_id, user_id, played_at, minutes_played) Because th...

Coding & Algorithms
11
0
103 people solved
Mar 4, 2026
Meta logo
Meta
Medium
Machine Learning Engineer

Find target using robot movement API

You control a robot in an unknown 2D grid. The grid layout and boundaries are unknown, and you cannot access the map directly. Some cells are blocked ...

Coding & Algorithms
13
0
99 people solved
Oct 30, 2025
OpenAI logo
OpenAI
Hard
Machine Learning Engineer Locked

Schedule Incremental Labeling Tasks

This question evaluates skills in designing stateful incremental schedulers, fairness and load-balancing algorithms, deterministic tie-breaking, and e...

Coding & Algorithms
12
0
116 people solved
Apr 8, 2026
Anthropic logo
Anthropic
Medium
Machine Learning Engineer Locked

Convert Samples into Event Intervals

This question evaluates understanding of array and sequence processing, run-length encoding concepts, and interval representation for time-ordered tra...

Coding & Algorithms
15
0
94 people solved
Apr 7, 2026
Mercor logo
Mercor
Medium
Machine Learning Engineer Locked

Implement a Referral Network

This question evaluates skills in modeling and manipulating directed acyclic graphs, implementing graph-based ranking metrics (reachability and flow c...

Coding & Algorithms
3
0
38 people solved
May 2, 2026
Amazon logo
Amazon
Hard
Machine Learning EngineerNew Grad

Implement Optimal Bucket Batching

You are given an array lengths of K document lengths and an integer G representing the number of available GPUs. A batch is assigned to one GPU, and e...

Coding & Algorithms
2
0
34 people solved
Apr 27, 2026
OpenAI logo
OpenAI
Medium
Machine Learning Engineer

Design a Resumable Iterator with Checkpoint and Restore

Design a resumable iterator: an iterator that can serialize its current position into a compact, opaque checkpoint and later be reconstructed from tha...

Coding & Algorithms
2
0
17 people solved
Oct 18, 2025
LinkedIn logo
LinkedIn
Medium
Machine Learning Engineer Locked

Implement alert queries and spike detection

This question evaluates a candidate's skills in streaming data structures, time-windowed aggregation, in-memory analytics for high-throughput alert in...

Coding & Algorithms
7
0
88 people solved
Feb 11, 2026
Airbnb logo
Airbnb
Medium
Machine Learning Engineer Locked

Minimize exact layover bookings

This question evaluates algorithmic problem-solving and numeric precision handling, specifically the ability to model exact-duration sums and minimize...

Coding & Algorithms
10
1
75 people solved
Jan 5, 2026
Apple logo
Apple
Medium
Machine Learning Engineer Locked

Find Minimum Processing Rate

This question evaluates algorithmic problem-solving skills, discrete mathematics involving integer division and ceiling operations, and complexity ana...

Coding & Algorithms
1
0
14 people solved
May 17, 2026
Anthropic logo
Anthropic
Hard
Machine Learning EngineerSenior+ Locked

Implement a Simplified DNS Resolver

This question evaluates understanding of DNS semantics (name normalization, A and CNAME records, alias chains and cycle detection), robust error handl...

Coding & Algorithms
23
0
203 people solved
May 16, 2026
Capital One logo
Capital One
Easy
Machine Learning Engineer Locked

Solve OA tasks on string, grid path, subarrays

This multi-part question evaluates string manipulation, constrained grid-path optimization with sequential expression evaluation, and counting of pari...

Coding & Algorithms
14
0
179 people solved
Jan 21, 2026
Meta logo
Meta
Medium
Machine Learning Engineer

Solve Two String Problems

The interview included two coding questions: 1. Exactly one edit apart Given two strings s and t, determine whether they are exactly one edit apart...

Coding & Algorithms
4
0
48 people solved
Apr 12, 2026

Explore more Machine Learning Engineer Coding & Algorithms interview questions

Real questions from candidate reports, grouped by company, topic and role.

By company
Other categories for Machine Learning Engineer
Coding & Algorithms questions for other roles
Browse all