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

Find Highest Product Segment

Given an integer array nums, find the maximum product obtainable from any non-empty contiguous segment. A contiguous segment must contain adjacent ele...

Coding & Algorithms
1
0
26 people solved
Jan 7, 2026
Meta logo
Meta
Medium
Machine Learning Engineer Locked

Implement solutions to several coding tasks

This multipart prompt evaluates algorithmic problem-solving and data-structure design skills across several areas: finding a minimum in a rotated sort...

Coding & Algorithms
3
0
62 people solved
Jan 5, 2026
Apple logo
Apple
Medium
Machine Learning Engineer

Solve stock and banana problems

Solve both coding problems below. 1. Maximum single-transaction stock profit: Given an array prices where prices[i] is the stock price on day i, retur...

Coding & Algorithms
3
0
42 people solved
Dec 17, 2025
Apple logo
Apple
Medium
Machine Learning EngineerNew Grad

Write a generator for substring pattern matches

Problem Write a generator that scans a string and emits a value whenever a substring matches a given pattern. Input - A string s - A string pattern (n...

Coding & Algorithms
6
0
125 people solved
Dec 15, 2025
Apple logo
Apple
Medium
Machine Learning EngineerNew Grad

Implement TF-IDF scoring for documents

Problem Implement a simplified TF–IDF scorer. You are given: - A list of documents docs, where each document is a string. - A query string q. Tokeniza...

Coding & Algorithms
7
0
71 people solved
Dec 15, 2025
Tesla logo
Tesla
Easy
Machine Learning Engineer

Implement 2D convolution forward pass

Problem Implement the forward pass of a 2D convolution (conv2d) from scratch (no deep learning libraries). You are given: - Input tensor x with shape ...

Coding & Algorithms
27
0
222 people solved
Dec 15, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Implement weighted random city and sparse dot product

Question 1: Weighted random city picker You are given a mapping from city → population (all populations are positive integers). Implement a random gen...

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

Compute minimal time to finish dependent tasks

Coding: Task Scheduling With Prerequisites (Parallel Allowed) You have n tasks labeled 1..n. Each task takes exactly 1 unit of time to complete. Some ...

Coding & Algorithms
11
0
140 people solved
Dec 15, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Solve shipping capacity and expression insertion

Problem A: Minimum shipping capacity You are given an array weights where weights[i] is the weight of the i-th package. Packages must be shipped in or...

Coding & Algorithms
10
0
92 people solved
Dec 15, 2025
Meta logo
Meta
Easy
Machine Learning Engineer Locked

Solve two linked list/array tasks

This two-part question evaluates proficiency with fundamental data structures and algorithmic problem-solving—specifically linked list manipulation an...

Coding & Algorithms
3
0
62 people solved
Dec 14, 2025
Google logo
Google
Medium
Machine Learning Engineer

Solve meeting scheduling and robot cleaning tasks

You are given two independent coding problems. --- Problem 1: Prioritized Meeting Scheduling You are asked to schedule meetings in a single meeting ro...

Coding & Algorithms
10
1
128 people solved
Dec 8, 2025
Roblox logo
Roblox
Easy
Machine Learning Engineer

Extend counter to per-client rate limiting

You are extending the recent-requests counter to support per-client rate limiting. Each request now includes a clientId identifying the caller. You mu...

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

Implement integer division without using division

You are given two 32-bit signed integers dividend and divisor. Implement a function that divides dividend by divisor and returns the integer quotient,...

Coding & Algorithms
7
0
53 people solved
Dec 8, 2025
Google logo
Google
Hard
Machine Learning Engineer

Design data structure similar to LRU cache

You are asked to design and implement a data structure that behaves similarly to an LRU (Least Recently Used) cache, but with a small variation: - The...

Coding & Algorithms
5
1
57 people solved
Dec 8, 2025
Atlassian logo
Atlassian
Medium
Machine Learning Engineer

Compute moving average over last N stream

You are given an integer N and an unbounded stream of integers arriving one by one. After each new integer arrives, output the average of the last N i...

Coding & Algorithms
2
0
42 people solved
Nov 21, 2025
Deshaw logo
Deshaw
Medium
Machine Learning Engineer

Implement sqrt and parity-based array rearrangement

You are given two independent coding tasks. --- Task 1: Implement Square Root Without Math Library Implement a function that computes the square root ...

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

Design LFU cache with distributed extension

Problem You are asked to design and implement a data structure that behaves like an in-memory cache with a Least Frequently Used (LFU) eviction policy...

Coding & Algorithms
4
0
35 people solved
Nov 18, 2025
Apple logo
Apple
Medium
Machine Learning Engineer

Rotate a Matrix In Place

Given an n x n matrix of integers, rotate the matrix 90 degrees clockwise. Implement the function in Python. You may use a straightforward approach wi...

Coding & Algorithms
0
0
8 people solved
Nov 11, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Optimize repeated-value vectors and compute exclusive times

You are given two separate coding tasks from an interview. Task 1: Optimize storage for vectors with repeated values, then compute dot product You are...

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

Assign bookings to minimum tennis courts

This question evaluates interval scheduling and resource-allocation competencies, testing algorithmic and data-structure knowledge for handling time-i...

Coding & Algorithms
3
0
34 people solved
Oct 15, 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