NumPy Interview Questions
35 interview questions in our bank cover NumPy, most of them Coding Questions. They average 3.1/5 difficulty — medium — and each one was reported by a candidate after a real interview. Companies known to ask about NumPy: Tesla, OpenAI, Datadog, Anthropic, Waymo, and 15 more.
Practice these on the problems board →Companies that ask about NumPy
Question mix
- Coding Questions22
- ML Fundamentals & Algorithms10
- Research & Paper Understanding1
- Deep Learning & Architectures1
- LLMs & Prompt Engineering1
Difficulty
- 2/5 — easy2
- 3/5 — medium27
- 4/5 — hard6
NumPy questions at Tesla
NumPy Conv2D Forward and Parameter Count
3/5This reported Tesla interview question challenges you to build a foundational Conv2D forward pass from scratch using only NumPy, bypassing standard deep-learning libraries. You will need to calculate output tensor dimensions, figure out parameter counts including bias terms, and optimize your code beyond slow nested loops through effective vectorization techniques. Master this essential tensor manipulation exercise to strengthen your grasp of convolutional neural network internals. The comprehensive problem statement and complete model solution require a subscription.
Coding QuestionsTeslaSpeed-Limit RL Reward from Trajectory Samples
3/5This reinforcement learning simulation task, reported from Tesla interviews, asks you to design a custom reward function that penalizes speed limit infractions using raw trajectory data sampled at high frequencies. You will reason about trajectory tensors, evaluate various penalty formulations based on duration and magnitude of violations, and adapt to dynamic speed limit changes over time. Get full access to the complete problem specification and reference code with a subscription.
Coding QuestionsTeslaBatched Trajectory Suffix Sum
3/5Evaluating tensor trajectories efficiently is a critical algorithmic task in autonomous driving development, as seen in AI foundation interviews at Tesla. This problem requires candidates to process multidimensional coordinate arrays and compute cumulative suffix metrics across sequential waypoints for multiple batches simultaneously. Success hinges on avoiding explicit looping constructs through clever vectorization and reverse accumulation techniques. To review the optimal tensor operation approach and complete reference code, unlock full access with a subscription.
Coding QuestionsTesla
NumPy questions at OpenAI
Implement Inference with Probability Using NumPy
3/5Read a tabular dataset off disk and estimate the probability of a target event using Bayesian reasoning rather than a library call. This OpenAI screening task is as much about engineering as statistics: the code has to load real files, run standalone, and come with its own tests at several data scales. You will decide how to handle unseen feature combinations, where smoothing belongs, and how to keep the estimate numerically sane on larger inputs. The complete problem and a reference solution require a paid subscription.
Coding QuestionsOpenAIImplement Masked Cross Entropy Loss with Label Smoothing
3/5Build a classification loss from scratch in NumPy, combining per-sample masking with label smoothing so that ignored rows contribute nothing and targets are softened away from one-hot. Reported in OpenAI interviews, this exercise checks whether you can turn a loss definition into stable vectorised code rather than recite it. You will handle log-sum-exp overflow, the smoothing term's effect on the target distribution, and the question of what to return when every sample is masked out. The full problem statement and a verified reference implementation are available to subscribers.
ML Fundamentals & AlgorithmsOpenAINumPy Puzzle: 1-NN Vectorization → Wx+b Network
3/5Master high-performance matrix operations and spatial classification techniques inspired by coding evaluations at OpenAI. This exercise challenges practitioners to implement distance-based prediction logic entirely through vectorized array manipulations, avoiding standard iteration loops, before translating the identical procedure into a neural network forward propagation framework. Learn how to leverage advanced mathematical libraries for optimal efficiency by accessing the full problem breakdown and expert solution.
Coding QuestionsOpenAI
NumPy questions at Datadog
Implement Binary Focal Loss
3/5This machine learning challenge, commonly asked in interviews at Datadog, focuses on implementing the Binary Focal Loss function to help models handle difficult classification tasks with class imbalance. You will practice handling probability clipping, mathematical transformations, and various reduction strategies to compute per-sample penalties accurately. To access the complete problem requirements, mathematical formulas, and the full model solution, a paid subscription is required.
ML Fundamentals & AlgorithmsDatadogImplement Grouped Query Attention Forward Pass
4/5In modern machine learning engineering interviews reported by Datadog, implementing core transformer mechanisms from scratch is a crucial test of tensor manipulation skills. This challenge focuses on building the forward computation for a specialized attention variant where multiple query projections share designated key and value heads to optimize memory and compute overhead. Candidates must efficiently manage high-dimensional tensor shapes and apply scaling equations without relying on high-level wrapper libraries. Discovering the optimal vectorization strategy and reviewing the complete production-ready solution requires a full subscription.
ML Fundamentals & AlgorithmsDatadog
NumPy questions at Anthropic
Debug / Fix an Extremely Randomized Trees (ExtraTrees) Implementation in NumPy
4/5Repair a NumPy-only implementation of a randomised decision-forest learner that either crashes, predicts wrongly, or fails to reproduce its own results. This Anthropic debugging round is about reading someone else's array code: the bugs hide in indexing, in split selection, and in how the random state is threaded through. You will get the unit tests passing without reaching for another library, and explain which defect caused which symptom. Subscribers can read the complete problem and the corrected implementation.
Coding QuestionsAnthropicIs the New Classifier Really Better Than the Baseline?
3/5A machine learning evaluation question: given test accuracies for a baseline and a new classifier over several training runs, decide whether the improvement is real, quantify how certain that is, and plan the follow-up experiment.
Research & Paper UnderstandingAnthropic
NumPy questions at Waymo
Hand-Write K-Means Clustering (NumPy)
3/5Practice implementing an unsupervised clustering algorithm entirely from scratch using only array manipulation libraries, avoiding high-level machine learning frameworks. As a staple of core machine learning interviews at Waymo, this task assesses your ability to translate mathematical definitions of distance and centroid updates into highly vectorized, efficient code without relying on slow iterative loops. You will focus on optimizing broadcasting operations to handle multi-dimensional data swiftly and accurately. Gain immediate access to the complete problem breakdown and optimal reference code by purchasing a subscription.
Coding QuestionsWaymoFix a Buggy Matrix Class
2/5A debugging question on a small matrix class with three defects: shared row storage, a wrong reduction, and a lossy conversion. It checks that each fix is verified with an input that exposes the bug.
Coding QuestionsWaymo
NumPy questions at Apple
K-Means Clustering from Scratch
3/5A machine learning coding question about grouping unlabelled points into k clusters. The learner writes a seeded, deterministic routine that returns the final cluster centres and the cluster of every point.
Coding QuestionsAppleImplement an Image Filter from Scratch
3/5This foundational coding interview question reported at Apple requires building a two-dimensional convolution operator completely from scratch using only standard library constructs. Candidates must implement custom zero-padding, kernel transformations, and nested iteration loops to support image processing primitives like blurring and edge detection without external scientific libraries. Mastering this task proves deep comprehension of spatial filtering mechanics. Unlock the complete specification and optimal Python implementation by subscribing.
Coding QuestionsApple
NumPy questions at Capital One
Linear Regression from Scratch
3/5A machine learning coding question on fitting a linear model to numeric data from first principles, using only the standard library. It contrasts a direct algebraic solution with a step-by-step optimisation, and checks the details of both.
Coding QuestionsCapital OneImplement Top-P (Nucleus) Sampling
3/5A coding question on decoding strategies for language models. It checks that you can turn raw token scores into a probability distribution without numerical overflow, choose a probability-mass cutoff with exact tie and rounding rules, and draw a reproducible sample from a seeded random source. A short discussion compares this method with keeping a fixed number of candidates.
LLMs & Prompt EngineeringCapital One
More NumPy questions
Multi-Head Attention from Scratch
3/5A machine learning coding question on building a core transformer layer with array operations only. It checks how you partition feature dimensions, handle masks and keep a normalisation numerically safe.
ML Fundamentals & AlgorithmsOracleImplement K-Means Clustering from Scratch
3/5A machine learning coding question on unsupervised clustering. You implement a from-scratch grouping routine given fixed starting centers, paying attention to tie-breaking, empty groups and a cap on iterations.
ML Fundamentals & AlgorithmsCoinbaseLinear Regression via Gradient Descent (MSE)
3/5A machine learning coding question on fitting a linear regression model from scratch in plain Python by minimising squared error. It checks the exact update rule, the stopping rule and edge cases, and ends with a short discussion of learning-rate choice and convergence problems.
Coding QuestionsDatabricksImplement k-means clustering from scratch
2/5A machine-learning coding exercise on the classic unsupervised grouping method: repeatedly assign each data point to its nearest centre and move every centre to the average of its group. The task fixes the start, the tie rule, the handling of groups that lose all members and the stopping condition, so results are exactly reproducible.
Coding QuestionsLyftStandardize Each Column of a 2D Tensor
3/5In this numerical computing challenge reported during Bridgewater interviews, programmers are asked to normalize a two-dimensional tensor column by column using statistical z-scores. The task requires calculating population standard deviations and means efficiently to handle large dataset matrices without performance bottlenecks. This exercise tests your familiarity with tensor manipulation libraries, vectorized operations, and numerical stability. Unlock the full problem details, mathematical guidelines, and a high-performance model solution by purchasing a subscription.
Coding QuestionsBridgewaterNumPy Top-p Sampling and Multi-Head Attention
3/5Implement foundational machine learning operations from scratch in this Scale AI interview question focusing on tensor manipulation and probabilistic sampling. Working within a notebook environment, you are expected to construct core architectural primitives and sampling strategies efficiently using numerical computing libraries. This problem assesses your fluency with vectorization, probability distributions, and fundamental transformer mechanics without relying on high-level framework abstractions. Discover the complete problem walkthrough and optimal solution by unlocking your subscription.
Coding QuestionsScale AICompute Euclidean Distance Between Two Tensors
3/5Sourced from XPeng, this machine learning fundamentals problem requires calculating pairwise Euclidean distances across high-dimensional batched tensor inputs without relying on standard slow iteration loops. You will need to leverage vectorization techniques and matrix operations to produce an output tensor of specified shape efficiently. This exercise evaluates your deep understanding of tensor manipulation and linear algebra operations in deep learning frameworks. The full problem statement and optimized code solution are available exclusively with a paid subscription.
ML Fundamentals & AlgorithmsXPengML Coding from Scratch: Regression, Markov, Facility Location
4/5During this Uber machine learning onsite interview, candidates must build core modeling primitives entirely from scratch using only NumPy. The evaluation focuses on mathematical derivation, optimization mechanics, and fluent coding without relying on high-level framework abstractions. Engineers are tested on fundamental concepts underlying regression and probability models. Unlock the complete technical walkthrough, derivation notes, and production-grade solution by purchasing a subscription.
Coding QuestionsUberNeural Network Basics
3/5This Reflection AI interview question asks you to build a small neural network classifier from first principles and to reason carefully about its numerical behaviour. It is the kind of round where the code is short and the discussion goes deep, so expect to justify each design choice rather than just produce a working model. Good preparation means being comfortable with the maths behind training, how errors flow backward through layers, and how to confirm that a hand-written implementation is correct. The full problem statement, a runnable test kit and a worked answer guide are available with a subscription.
ML Fundamentals & AlgorithmsReflection AIML Coding: 2-D Convolution, Decaying Attention, Training Loop
3/5Sharpen your deep learning implementation skills with this practical coding challenge featured in NVIDIA interview loops. You will write core neural network components from scratch, including a custom two-dimensional convolution in NumPy, a decayed attention mechanism, and a complete training loop utilizing standard machine learning frameworks. This exercise evaluates your fluency with tensor operations, gradient descent workflows, and fundamental deep learning mechanics. Gain access to the full problem breakdown and clean implementation code with an active subscription.
Coding QuestionsNVIDIAHand-Code Self-Attention and Cross-Entropy
4/5Conquer a rigorous machine learning coding challenge frequently seen in ByteDance interview processes by implementing core deep learning components from scratch. You will be tasked with writing scaled dot-product attention in NumPy and deriving the binary cross-entropy loss function mathematically, alongside oral questions on architectural layers. This exercise examines your mathematical rigor and ability to translate theoretical formulations into stable vector operations. Access the comprehensive problem breakdown and ideal reference implementation with a subscription.
Coding QuestionsByteDanceCompute EMA Indicators and Detect Crossovers in Pandas
3/5In this Squarepoint quantitative engineering interview problem, candidates must process financial time-series data using native library capabilities without resorting to standard iteration loops. The task involves calculating dual moving averages across different time horizons and pinpointing precise intersection moments where the indicators cross paths. Success relies on writing highly optimized, vectorized expressions that execute efficiently over large datasets. Unlock the complete evaluation guidelines, constraints, and an expert pandas implementation with a subscription.
Coding QuestionsSquarepointHand-Written K-Means
3/5Frequently asked during Microsoft screening rounds, this programming challenge requires candidates to build the unsupervised clustering algorithm completely from scratch using standard Python libraries or numerical computing frameworks. You will need to implement iterative centroid updates and cluster assignment logic while demonstrating a strong grasp of underlying operational complexities. Preparing for this exercise ensures you can articulate foundational machine learning concepts fluidly during live technical evaluations. Access the complete breakdown and verified implementation by purchasing a subscription.
Coding QuestionsMicrosoftDistributed Matrix Multiplication — DP and FSDP
4/5This advanced infrastructure coding assessment from xAI explores the principles of distributed model training by simulating device communication for matrix operations. Candidates must build both data-parallel and fully sharded strategies to handle heavy computational workloads across multiple nodes effectively. To unlock the full problem description, architectural insights, and the reference code, a subscription is required.
Coding QuestionsxAIFollow-up: Implement Gaussian Mixture Model (GMM) With EM
4/5This machine learning challenge, reported during a technical interview at Tubi, requires candidates to build and optimize a Gaussian Mixture Model from scratch using the Expectation-Maximization framework. Applicants need to initialize parameters effectively and iteratively update mixing coefficients, means, and covariance matrices to capture underlying data distributions. The assessment evaluates a deep understanding of probabilistic clustering and latent variable models. Access to the comprehensive problem description and optimal code solution requires a paid subscription.
ML Fundamentals & AlgorithmsTubiImplement Dense Layer with Numpy
3/5Understanding the mathematical mechanics behind neural network layers is essential for machine learning engineers, as explored in this interview question reported by Etsy. You are asked to manually construct a fully connected layer using NumPy, implementing both forward propagation and gradient backpropagation alongside a custom activation function. To explore the complete implementation guidelines and fully worked model solution, a paid subscription is required.
ML Fundamentals & AlgorithmsEtsyMulti-Head Self-Attention in NumPy (Batched)
3/5An ML coding exercise on building a batched sequence-mixing layer from four learned matrices. It checks tensor reshaping and numerical stability on large inputs.
Coding QuestionsTikTokImplement top-k sampling using NumPy
3/5This Cohere interview question tests your proficiency in numerical computing and probabilistic sampling techniques commonly used in modern language models. You are asked to implement a token selection mechanism that restricts generation choices to the highest-scoring candidates using pure array operations without heavy machine learning frameworks. The task evaluates your mastery of vector manipulation, probability normalization, and efficient indexing strategies. To access the complete problem statement, performance considerations, and clean model implementation, a subscription is needed.
ML Fundamentals & AlgorithmsCohereImplement Scaled Dot-Product Attention
3/5A machine learning coding question on computing the output of a single attention head from raw matrices in NumPy. It covers projecting inputs, scoring token pairs, masking some of them, and keeping the normalisation numerically safe.
Deep Learning & ArchitecturesGoogle
Studied alongside
NumPy interview FAQ
- How many NumPy interview questions are there?
- 35 reported questions, mostly Coding Questions.
- Which companies ask NumPy questions?
- Tesla (3), OpenAI (3), Datadog (2), Anthropic (2), Waymo (2), Apple (2), Capital One (2), Oracle (1).
- How hard are NumPy questions?
- They average 3.1 out of 5: 2 at 2/5, 27 at 3/5, 6 at 4/5.