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
J.P. Morgan logo
J.P. Morgan
Medium
Machine Learning Engineer

Return Every Index Pair Whose Values Sum to a Target

Return Every Index Pair Whose Values Sum to a Target Problem Implement all_pairs_sum(nums, target). Given an unordered array of integers, return every...

Coding & Algorithms
5
0
43 people solved
Aug 5, 2026
Bytedance logo
Bytedance
Medium
Machine Learning Engineer

Reverse a Linked List in Groups of K

Implement reverse_k_group(values, k) for a singly linked list represented by the array values in traversal order. Reverse every consecutive group of e...

Coding & Algorithms
0
0
6 people solved
Jul 24, 2026
Rbcroyalbank logo
Rbcroyalbank
Medium
Machine Learning Engineer

Process Operations for an In-Memory Key-Value Store

Process Operations for an In-Memory Key-Value Store Implement an in-memory key-value store that supports adding or replacing a value, deleting a key, ...

Coding & Algorithms
1
0
17 people solved
Jul 6, 2026
Shopify logo
Shopify
Medium
Machine Learning Engineer

Implement an interactive CLI class with tests

Design and implement a command-line interactive application as a single class using OOP principles. The program should support commands: add <key> <va...

Coding & Algorithms
12
0
202 people solved
Aug 13, 2025
Shopify logo
Shopify
Easy
Machine Learning Engineer

Design a robot movement command system

Robot Movement (Pair Programming) You are given an empty starter repository (only a README). Implement a small, testable robot movement module that ca...

Coding & Algorithms
54
0
485 people solved
Dec 15, 2025
Apple logo
Apple
Medium
Machine Learning Engineer

Implement permutations and image retrieval

The coding portion included several short exercises for a vision-focused ML role: 1. Given an array of distinct integers, return all possible permutat...

Coding & Algorithms
18
0
182 people solved
Mar 1, 2026
Pinterest logo
Pinterest
Hard
Machine Learning Engineer

Implement a Stateful Search Autocomplete Session

Implement a Stateful Search Autocomplete Session Build an autocomplete engine from historical sentences and their usage counts. While a user types a s...

Coding & Algorithms
2
0
34 people solved
Jul 3, 2026
Cohere logo
Cohere
Medium
Machine Learning Engineer Locked

Implement Autoregressive Decoding Strategies

This question evaluates proficiency with autoregressive sequence generation, probabilistic sampling methods (greedy, top-k, top-p), softmax-based prob...

Coding & Algorithms
0
0
10 people solved
May 23, 2026
Coinbase logo
Coinbase
Hard
Machine Learning Engineer Locked

Implement local maxima, bagging, and k-means

This set of tasks evaluates algorithmic problem-solving and implementation skills across array processing (local maxima), ensemble methods (bagging cl...

Coding & Algorithms
19
0
131 people solved
Feb 1, 2026
LinkedIn logo
LinkedIn
Medium
Machine Learning Engineer

Sample uniformly from a circle’s area

How would you generate a point (x, y) uniformly at random from the area of a circle of radius R centered at the origin? - Explain why naive choices (e...

Coding & Algorithms
17
0
126 people solved
Feb 18, 2026
Airbnb logo
Airbnb
Medium
Machine Learning Engineer Locked

Minimum Canisters to Top Up an Exact Target

This question evaluates a candidate's grasp of dynamic programming, specifically the unbounded knapsack (coin change) pattern for finding the minimum ...

Coding & Algorithms
1
0
15 people solved
Jun 22, 2026
Pinterest logo
Pinterest
Medium
Machine Learning Engineer Locked

First Word Matching Each Prefix Query

This question evaluates a candidate's grasp of string data structures and efficient prefix-matching techniques, core competencies in coding and algori...

Coding & Algorithms
1
0
13 people solved
Jun 3, 2026
Jane Street logo
Jane Street
Medium
Machine Learning Engineer

Code Editor with Block Shrink and Expand (Code Folding)

Implement the core of a code editor (similar to VS Code) that supports code folding: collapsing ("shrink") and restoring ("expand") indentation-based ...

Coding & Algorithms
3
0
35 people solved
Apr 24, 2026
TikTok logo
TikTok
Hard
Machine Learning Engineer Locked

Implement local maxima, bagging, and k-means

This question evaluates skills in algorithm implementation and machine learning fundamentals—specifically streaming local maxima detection, bootstrap ...

Coding & Algorithms
6
0
81 people solved
Jan 22, 2026
Pinterest logo
Pinterest
Hard
Machine Learning Engineer

Solve a 9x9 Sudoku puzzle

Given a partially filled 9×9 Sudoku board, fill the empty cells so that the completed board is valid. A valid Sudoku satisfies: - Each row contains di...

Coding & Algorithms
18
1
139 people solved
Dec 13, 2025
Startups.Com logo
Startups.Com
Medium
Machine Learning Engineer

Implement common neural network layers in PyTorch

Implement the following neural-network building blocks from scratch in PyTorch (using only basic tensor ops such as matmul, sum, mean, var, exp, max, ...

Coding & Algorithms
4
0
73 people solved
Mar 10, 2026
Rogo logo
Rogo
Medium
Machine Learning Engineer

Infer the Smallest Valid Character Order from Sorted Password Hints

Infer the Smallest Valid Character Order from Sorted Password Hints You are given password hints already sorted according to an unknown alphabet. Infe...

Coding & Algorithms
0
0
2 people solved
Jun 24, 2026
Atlassian logo
Atlassian
Hard
Machine Learning Engineer Locked

Find a secret word using match feedback

This question evaluates algorithmic problem-solving, combinatorial reasoning, and information-theoretic search strategies for narrowing a secret from ...

Coding & Algorithms
6
0
84 people solved
Mar 1, 2026
OpenAI logo
OpenAI
Hard
Machine Learning Engineer Locked

Search Monster Battle Strategies

This question evaluates algorithmic problem-solving around deterministic simulation and state-space exploration, focusing on handling transient state ...

Coding & Algorithms
26
0
208 people solved
Apr 8, 2026
Coinbase logo
Coinbase
Medium
Machine Learning Engineer

Write SQL to rank top products per category

You are given two tables: products - product_id (int, primary key) - category (string) order_items - order_id (int) - product_id (int) - quantity (int...

Coding & Algorithms
10
1
117 people solved
Dec 4, 2025

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