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
Amazon logo
Amazon
Medium
Machine Learning EngineerSenior+

Find shortest transformation steps in a word graph

You are given two strings begin and end of the same length, and a list words of distinct strings (also same length). You can transform one string into...

Coding & Algorithms
5
0
74 people solved
Dec 15, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

Determine if a string can be segmented

Given a string s and a list of strings wordDict, determine whether s can be segmented into a sequence of one or more dictionary words. - You may reuse...

Coding & Algorithms
4
0
51 people solved
Dec 15, 2025
Pinterest logo
Pinterest
Easy
Machine Learning Engineer

Implement string-based rounding without floats

Coding You are not allowed to parse the input into a built-in floating type (to avoid overflow and precision issues). Work directly on strings. 1) Imp...

Coding & Algorithms
12
0
109 people solved
Dec 15, 2025
Uber logo
Uber
Medium
Machine Learning Engineer

Choose K pickup locations minimizing L1 distance

Coding: K Shuttle Pickup Locations (L1) You are given the coordinates of N people on a 2D grid. You want to open K shuttle pickup locations (pickup po...

Coding & Algorithms
30
0
314 people solved
Dec 15, 2025
Roblox logo
Roblox
Easy
Machine Learning Engineer

Implement recent-requests counter

You are designing an in-memory component for a web service that needs to track how many requests ("hits") it has received in the last 5 minutes. Imple...

Coding & Algorithms
11
0
109 people solved
Dec 8, 2025
Amazon logo
Amazon
Medium
Machine Learning Engineer

Find shortest path in a grid with obstacles

You are given a 2D grid of size m x n representing a maze. Each cell in the grid is either empty (0) or blocked (1). You are also given two coordinate...

Coding & Algorithms
5
0
66 people solved
Dec 8, 2025
Walmart Labs logo
Walmart Labs
Easy
Machine Learning Engineer Locked

Find first non-repeating character

This question evaluates string manipulation, frequency-counting concepts, algorithmic complexity reasoning, and attention to edge-case handling in seq...

Coding & Algorithms
3
0
38 people solved
Dec 7, 2025
Meta logo
Meta
Medium
Machine Learning Engineer Locked

Find longest palindromic substring

This question evaluates knowledge of string algorithms and pattern recognition, focusing on identifying palindromic substrings and reasoning about tim...

Coding & Algorithms
6
0
66 people solved
Nov 28, 2025
Amazon logo
Amazon
Medium
Machine Learning Engineer

Find two numbers that sum to target

Given an integer array nums of length n and an integer target, return the indices (i, j) (0-based) of two distinct elements such that nums[i] + nums[j...

Coding & Algorithms
2
0
28 people solved
Nov 20, 2025
Tradedesk logo
Tradedesk
Medium
Machine Learning Engineer

Design a time-travel key-field store with TTL

Problem Implement an in-memory “database” that stores records by key and fields within each key. Each operation is given a timestamp (integer, non-dec...

Coding & Algorithms
5
0
91 people solved
Nov 19, 2025
Amazon logo
Amazon
Medium
Machine Learning Engineer

Implement decoder-only GPT-style transformer

Goal Implement a simplified decoder-only Transformer language model (similar in spirit to GPT) for next-token prediction. The implementation should be...

Coding & Algorithms
20
0
173 people solved
Nov 18, 2025
Amazon logo
Amazon
Medium
Machine Learning Engineer

Check if adding edge creates cycle in digraph

You work with a system that stores items and directed relationships between them (for example, item A points to item B). The relationships form a dire...

Coding & Algorithms
7
0
61 people solved
Oct 26, 2025
Atlassian logo
Atlassian
Medium
Machine Learning Engineer Locked

Compute moving and weighted averages from a stream

This question evaluates a candidate's understanding of streaming algorithms, sliding-window statistics, and resource-constrained data structure design...

Coding & Algorithms
3
0
36 people solved
Oct 15, 2025
Atlassian logo
Atlassian
Medium
Machine Learning Engineer Locked

Find LCA in a tree and extend to a DAG

This question evaluates proficiency in graph algorithms and data structures, focusing on lowest common ancestor computation in rooted trees and its ge...

Coding & Algorithms
2
0
34 people solved
Oct 11, 2025
Atlassian logo
Atlassian
Medium
Machine Learning Engineer Locked

Compute inverse-depth weighted sum of a nested list

This question evaluates competency in working with nested data structures and depth-based aggregation, measuring the ability to reason about hierarchi...

Coding & Algorithms
4
0
44 people solved
Oct 11, 2025
xAI logo
xAI
Medium
Machine Learning Engineer

Identify all bad nodes with group tests

You have N nodes. Each node is either good or bad (unknown to you). You can call a function test(S) on a subset of nodes S: - test(S) = True iff all n...

Coding & Algorithms
15
1
239 people solved
Sep 22, 2025
XPeng logo
XPeng
Medium
Machine Learning Engineer

Compute optimal matrix multiplication order

Given an array dims[0..n] where matrix i has dimensions dims[i-1] × dims[i] (for i = 1..n), compute the minimum number of scalar multiplications neede...

Coding & Algorithms
1
0
13 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Implement bounds, minimum, pathfinding, and moving average

Solve the following data-structures problems: ( 1) Given two sorted integer lists A and B, merge them into a single non-decreasing array. Then, for a ...

Coding & Algorithms
6
0
49 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Merge two sorted arrays in-place

You are given two nondecreasing arrays A and B, where A has enough trailing empty slots to hold all elements of B. Merge B into A in-place so that A r...

Coding & Algorithms
5
0
51 people solved
Sep 6, 2025
Snapchat logo
Snapchat
Medium
Machine Learning Engineer

Determine and print expression to reach target

You are given four numbers and a target T (e.g., 24). Using +, −, ×, ÷ and parentheses, and using each number exactly once, determine whether you can ...

Coding & Algorithms
4
0
43 people solved
Sep 6, 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