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

Implement an LRU cache

This question evaluates competency in designing efficient key-value caching mechanisms, enforcing capacity constraints and eviction policies while mai...

Coding & Algorithms
22
0
349 people solved
Feb 27, 2026
Google logo
Google
Hard
Machine Learning Engineer

Can you reach target with distance-threshold edges?

You are given a set of unordered 2D points points[], a start point and an end point (both are included in points), and a function: `text getDistance(p...

Coding & Algorithms
11
1
181 people solved
Feb 22, 2026
LinkedIn logo
LinkedIn
Medium
Machine Learning Engineer Locked

Implement K-Means and Explain Convergence

Implement K-means clustering in Python and explain convergence. Covers assignment and update steps, stopping criteria, empty clusters, objective funct...

Coding & Algorithms
6
0
45 people solved
May 3, 2025
LinkedIn logo
LinkedIn
Medium
Machine Learning Engineer

Generate uniform 0–6 from biased coin

You are given a function: - int getRandom01Biased() returns 0 with probability p and 1 with probability 1-p, where p is unknown and may be any value i...

Coding & Algorithms
14
0
109 people solved
Feb 18, 2026
Shopify logo
Shopify
Medium
Machine Learning Engineer

Simulate robot moves on a grid

You are given an m x n grid and a robot that starts at position (r, c) (0-indexed). You are also given a string commands consisting of characters 'U',...

Coding & Algorithms
10
0
120 people solved
Feb 18, 2026
Meta logo
Meta
Easy
Machine Learning Engineer Locked

Solve four OA string/array/matrix/graph tasks

This multi-part prompt evaluates proficiency in core programming competencies: string parsing and character classification, simulation/greedy processi...

Coding & Algorithms
10
0
77 people solved
Feb 12, 2026
Meta logo
Meta
Medium
Machine Learning Engineer Locked

Solve frequency and tree-completeness problems

These two problems evaluate competency in frequency counting and selection algorithms for identifying top-k elements and in binary tree structure anal...

Coding & Algorithms
4
0
58 people solved
Feb 12, 2026
Meta logo
Meta
Medium
Machine Learning Engineer Locked

Compute the next lexicographic permutation

This question evaluates understanding of permutations and lexicographic ordering, in-place array manipulation, and algorithmic reasoning about time an...

Coding & Algorithms
7
0
64 people solved
Feb 12, 2026
Tesla logo
Tesla
Hard
Machine Learning Engineer

Compute suffix sums over waypoints

Problem You are given a batch of 2D waypoint trajectories. - Input: points with shape [B, N, 2], where points[b][i] = (x, y) is the i-th waypoint for ...

Coding & Algorithms
4
0
73 people solved
Feb 12, 2026
Meta logo
Meta
Medium
Machine Learning Engineer Locked

Implement weighted random sampling with preprocessing

This question evaluates algorithm design and probabilistic reasoning for weighted random sampling, including data-structure preprocessing, time-space ...

Coding & Algorithms
7
0
90 people solved
Feb 12, 2026
Microsoft logo
Microsoft
Medium
Machine Learning Engineer Locked

Detect stop tokens during streaming inference

This question evaluates streaming sequence-detection and pattern-matching skills, including online buffer management and correct handling of overlappi...

Coding & Algorithms
3
0
59 people solved
Feb 11, 2026
Instacart logo
Instacart
Hard
Machine Learning Engineer Locked

Solve Two Sorted-Array Tasks

This question evaluates competency in array manipulation, handling of sorted data, search techniques and algorithmic complexity analysis, focusing on ...

Coding & Algorithms
4
0
61 people solved
Feb 10, 2026
Cognitiv logo
Cognitiv
Medium
Machine Learning Engineer

Maintain a Streaming Median

You are designing a component that receives integers one at a time and must return the current median after each update. Example: - After processing [...

Coding & Algorithms
4
0
33 people solved
Feb 9, 2026
Microsoft logo
Microsoft
Medium
Machine Learning EngineerIntern

Find pairs with the minimum absolute difference

Given an integer array (not necessarily sorted), find the minimum absolute difference between any two distinct elements. Return all pairs of values th...

Coding & Algorithms
4
0
73 people solved
Feb 9, 2026
Microsoft logo
Microsoft
Medium
Machine Learning Engineer Locked

Implement K-means clustering from scratch

This question evaluates competency in clustering algorithms, numerical computation, and practical algorithm implementation, focusing on core K-means c...

Coding & Algorithms
3
0
50 people solved
Feb 9, 2026
Meta logo
Meta
Medium
Machine Learning Engineer AI Locked

Maximize Unique Letters

This question evaluates proficiency in combinatorial optimization, bit manipulation, and state-compression techniques for selecting subsets under uniq...

Coding & Algorithms
2
0
35 people solved
Feb 8, 2026
Databricks logo
Databricks
Medium
Machine Learning EngineerSenior+ Locked

Delete a Character From Cover

This question evaluates proficiency in string manipulation, interval arithmetic, and data-structure updates with attention to index mapping and edge-c...

Coding & Algorithms
11
0
82 people solved
Feb 7, 2026
Shopify logo
Shopify
Medium
Machine Learning Engineer AI Locked

Implement a Capacity-Bounded Cache

This question evaluates a candidate's ability to design and implement an efficient capacity-bounded in-memory key-value cache, assessing understanding...

Coding & Algorithms
6
0
71 people solved
Feb 3, 2026
Google logo
Google
Hard
Machine Learning EngineerIntern Locked

Construct connected crop layout and safe paths

This question evaluates constructive grid design and graph-based pathfinding skills, specifically the ability to produce connected labeled regions tha...

Coding & Algorithms
5
1
93 people solved
Feb 3, 2026
OpenAI logo
OpenAI
Medium
Machine Learning Engineer Locked

Find the First Working Version

This question evaluates understanding of search algorithms, version normalization, and monotonic predicates, along with competency in parsing and orde...

Coding & Algorithms
3
0
20 people solved
Feb 1, 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