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
LinkedIn logo
LinkedIn
Medium
Machine Learning Engineer

Find shortest word transformation with caching

Find shortest word transformation with caching You are given a start word and an end word of equal length, and a dictionary of valid words. In one mov...

Coding & Algorithms
10
0
95 people solved
Jul 16, 2025
LinkedIn logo
LinkedIn
Medium
Machine Learning Engineer

Compute total covered interval length

Compute total covered interval length Given a list of integer intervals [l, r) (half-open), compute the total length covered by at least one interval....

Coding & Algorithms
13
0
107 people solved
Jul 16, 2025
xAI logo
xAI
Hard
Machine Learning Engineer

Constant-Time Insert, Remove, and Uniform Random Sampling

A data-sampling service maintains a dynamically changing pool of integer example IDs. Examples are continuously added and retired, and the service mus...

Coding & Algorithms
0
0
4 people solved
May 30, 2025
Pinterest logo
Pinterest
Medium
Machine Learning Engineer Locked

Solve prefix, array, and string problems

This set of problems evaluates proficiency in string and array algorithm design—covering prefix search, subsequence matching, and maximal-area computa...

Coding & Algorithms
2
0
18 people solved
Apr 9, 2025
Glean logo
Glean
Medium
Machine Learning Engineer

Determine Reachability in Train Schedule

You are given a train schedule represented as a list of train routes. Each route is a list of station names, where the element at index t is the stati...

Coding & Algorithms
17
0
134 people solved
Feb 7, 2025
Amazon logo
Amazon
Medium
Machine Learning Engineer Locked

Implement Multi-Head Attention from Scratch in NumPy

This coding question tests a machine learning engineer's understanding of Transformer internals by requiring a from-scratch NumPy implementation of mu...

Coding & Algorithms
1
0
4 people solved
Jun 18, 2026
Amazon logo
Amazon
Medium
Machine Learning EngineerSenior+ Locked

Highest Average-Salary Team in an Org Chart

This question evaluates a candidate's ability to traverse tree-structured data and perform subtree aggregation, applying recursive or bottom-up DFS te...

Coding & Algorithms
0
0
4 people solved
Jun 14, 2026
Amazon logo
Amazon
Medium
Machine Learning EngineerSenior+ Locked

Merge Overlapping Time Ranges

This question evaluates a candidate's ability to work with interval merging, a core array and sorting problem in technical interviews. It tests unders...

Coding & Algorithms
0
0
5 people solved
Jun 14, 2026
Pinterest logo
Pinterest
Medium
Machine Learning Engineer Locked

Hierarchical Access Control for an Advertising Platform

This question tests practical application of graph traversal and access control system design using a directed acyclic group hierarchy. It evaluates a...

Coding & Algorithms
1
0
27 people solved
Jun 3, 2026
Amazon logo
Amazon
Medium
Machine Learning Engineer Locked

Determine if all courses can be completed

This question evaluates graph-theoretic dependency modeling and cycle-detection competency, measuring the ability to represent course prerequisites as...

Coding & Algorithms
2
0
16 people solved
May 30, 2026
Beaconfire logo
Beaconfire
Easy
Machine Learning Engineer Locked

Check Whether a String Is Built by Repetition

This question evaluates string manipulation and pattern recognition skills, focusing on detection of repeated substring patterns, string periodicity, ...

Coding & Algorithms
1
0
9 people solved
May 21, 2026
Pinterest logo
Pinterest
Medium
Machine Learning Engineer Locked

Implement a Sparse Matrix Class

This question evaluates the ability to design and implement efficient sparse data structures and perform matrix operations, testing knowledge of spars...

Coding & Algorithms
1
0
15 people solved
May 11, 2026
Ziprecruiter logo
Ziprecruiter
Easy
Machine Learning Engineer Locked

Find Neighboring Records by Identifier

This question evaluates understanding of ordered data traversal and efficient lookup design, assessing competency with data structures, indexing and r...

Coding & Algorithms
1
0
14 people solved
May 6, 2026
Snapchat logo
Snapchat
Medium
Machine Learning EngineerSenior+

Solve Decimal Coin Change

Given a list of coin denominations represented as decimal values and a target amount represented as a decimal value, return the minimum number of coin...

Coding & Algorithms
1
0
14 people solved
Apr 28, 2026
Hackerrank logo
Hackerrank
Medium
Machine Learning Engineer

Count Good Subsequences With Equal Character Frequencies

A subsequence is formed by deleting zero or more characters from a string without changing the order of the remaining characters. A non-empty subseque...

Coding & Algorithms
1
0
14 people solved
Apr 23, 2026
Netflix logo
Netflix
Medium
Machine Learning Engineer

Implement Streaming Word Counter

Implement a class that records word frequencies from a stream of text. The class should support the following operations: 1. add_text(text: str) -> No...

Coding & Algorithms
0
0
5 people solved
Apr 22, 2026
Uber logo
Uber
Medium
Machine Learning EngineerSenior+

Find a Black-Box Convex Function Minimum

You are given access to a black-box function F(x): each call returns the function value at a real number x. You are also given a search interval [a, b...

Coding & Algorithms
0
0
9 people solved
Apr 19, 2026
Uber logo
Uber
Medium
Machine Learning Engineer

Implement a Referral Revenue Tracker

Implement an in-memory revenue tracking system for customers in a referral network. Each customer has their own direct revenue. A customer may also ha...

Coding & Algorithms
7
0
77 people solved
Apr 19, 2026
Microsoft logo
Microsoft
Medium
Machine Learning Engineer

Implement K-Means and Detect Divisible Subarrays

Solve both coding tasks. Part A: Implement K-Means Clustering Implement K-means clustering for a set of points. Given: - points: a list of n points, w...

Coding & Algorithms
1
0
16 people solved
Apr 18, 2026
Databricks logo
Databricks
Medium
Machine Learning EngineerSenior+

Design In-Memory QPS Counter

Implement an in-memory traffic counter. You need to support two operations for each logical key, such as an endpoint, customer, or service name: - rec...

Coding & Algorithms
12
0
93 people solved
Apr 18, 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