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
Sealth logo
Sealth
Easy
Machine Learning Engineer Locked

Implement one-cluster k-means

This question evaluates understanding of clustering algorithms and optimization of within-cluster squared error for the special case k = 1, along with...

Coding & Algorithms
2
0
31 people solved
Apr 12, 2026
Meta logo
Meta
Medium
Machine Learning Engineer

Generate unique permutations with duplicates

Given an array of integers that may contain duplicates, generate all unique permutations. Ensure no duplicate permutations are returned even if some v...

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

Count decodings of a numeric string

Given a string s of digits representing an encoded message where '1' maps to 'A', ..., '26' maps to 'Z', and '0' cannot appear alone (it must be part ...

Coding & Algorithms
7
0
50 people solved
Sep 6, 2025
Anthropic logo
Anthropic
Medium
Machine Learning Engineer Locked

Convert State Stream to Events

This question evaluates a candidate's ability to process sequential categorical data by identifying and summarizing consecutive runs, reason about tim...

Coding & Algorithms
47
0
454 people solved
Apr 6, 2026
Medium
Machine Learning EngineerSenior+ Locked

Implement Linear Regression Training

This question evaluates understanding of linear regression, mean squared error loss, gradient computation, parameter updates, and proficiency with vec...

Coding & Algorithms
1
0
26 people solved
Mar 31, 2026
DoorDash logo
DoorDash
Medium
Machine Learning Engineer

Find closest value to a target in a BST

Problem Given the root of a binary search tree (BST) and a floating-point number target, return the value in the BST that is closest to target. If the...

Coding & Algorithms
8
0
87 people solved
Oct 17, 2025
Google logo
Google
Medium
Machine Learning Engineer

Implement a Web Crawler with BFS and DFS

Implement a simple web crawler in Python. You are given: - A starting URL. - A function get_links(url) -> list[str] that returns all outgoing links fr...

Coding & Algorithms
1
0
17 people solved
Dec 24, 2025
Google logo
Google
Medium
Machine Learning Engineer

Implement a Transformer Block with SwiGLU

Implement a Transformer-style neural network block in Python using either NumPy or PyTorch. Your implementation should include: 1. Multi-head self-att...

Coding & Algorithms
0
0
8 people solved
Dec 24, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Compute nested depth sum and grid distance

Problem A: Weighted sum of integers in a nested list You are given a nested list structure that may contain integers or other nested lists. Define the...

Coding & Algorithms
9
0
68 people solved
Dec 15, 2025
TikTok logo
TikTok
Hard
Machine Learning Engineer

Generate all safe queen placements on board

You are given an integer n representing the size of a chessboard (n × n). You need to place n queens on the board so that no two queens attack each ot...

Coding & Algorithms
4
0
42 people solved
Dec 8, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Detect cycles and order with DFS

You are given a directed graph of package dependencies represented as an adjacency list: Map<String, List<String>> deps where deps[p] lists packages t...

Coding & Algorithms
5
0
60 people solved
Sep 6, 2025
Uber logo
Uber
Easy
Machine Learning EngineerIntern

Analyze sales with groupby

You are given three pandas DataFrames representing a food delivery marketplace: - orders(order_id, product_id, quantity, unit_price, status) - product...

Coding & Algorithms
4
0
41 people solved
Mar 9, 2026
OpenAI logo
OpenAI
Medium
Machine Learning Engineer Locked

Infer Generic Return Types

This question evaluates understanding of type systems, generic unification, recursive data structures, substitution mechanics, and robust error handli...

Coding & Algorithms
13
0
108 people solved
Mar 9, 2026
Jane Street logo
Jane Street
Medium
Machine Learning EngineerIntern

Board Simulation: Bottom-Insert Pieces with Uniform Row and Column Detection

Board Simulation: Bottom-Insert Pieces with Uniform Row and Column Detection You must simulate a 2-D game board with R rows and C columns. Each cell i...

Coding & Algorithms
1
0
18 people solved
Aug 27, 2025
Reddit logo
Reddit
Hard
Machine Learning Engineer Locked

Solve palindrome and list tasks

This question evaluates proficiency in string algorithms and linked list manipulation, specifically techniques for constructing the shortest palindrom...

Coding & Algorithms
3
0
66 people solved
Mar 2, 2026
Google logo
Google
Hard
Machine Learning Engineer

Compute winning probability on 1D dice walk

You are on an infinite 1D number line starting at position 0. Repeatedly roll a fair die that returns an integer uniformly at random from 1 to K (incl...

Coding & Algorithms
17
1
166 people solved
Mar 2, 2026
Meta logo
Meta
Hard
Machine Learning EngineerSenior+ AI Locked

Build a Friend Recommender

This question evaluates proficiency in graph algorithms, recommendation system logic, input validation, metric design, and test-driven software implem...

Coding & Algorithms
3
0
46 people solved
Mar 1, 2026
Meta logo
Meta
Hard
Machine Learning EngineerSenior+ AI Locked

Find Words Containing Other Words

This question evaluates string-processing skills, knowledge of substring matching techniques and supporting data structures, and the ability to analyz...

Coding & Algorithms
1
0
30 people solved
Mar 1, 2026
Meta logo
Meta
Medium
Machine Learning Engineer Locked

Solve Merge Lists and Vertical Traversal

This question evaluates proficiency with merging sorted linked lists and performing vertical traversal of binary trees, focusing on algorithms, data s...

Coding & Algorithms
7
0
51 people solved
Feb 28, 2026
Meta logo
Meta
Easy
Machine Learning EngineerSenior+ Locked

Solve Tree Views, Columns, and Calculator

This multi-part question evaluates skills in binary tree traversal and view extraction, vertical column grouping and ordering of tree nodes, and parsi...

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