MLStackMLSCCafé
 
 
Sign in with GoogleSign in with Google. Opens in new tab
Master Your ML & AIAI Interview
2103 Curated Machine Learning, Data Science, AI & LLMs Interview Questions
Answered To Get Your Next Six-Figure Job Offer
👨‍💻 Having Full-Stack & Coding Interview? Check  FullStack.Cafe - 3877 Full-Stack, Coding & System Design Questions and AnswersHaving Full-Stack & Coding Interview? Check 👨‍💻 FullStack.Cafe - 3877 Full-Stack, Coding & System Design Questions and Answers

Top 40 NumPy Interview Questions

Entry Junior Mid Senior Expert
Sign in with GoogleSign in with Google. Opens in new tab
Learning Progress:

NumPy Theoretical Questions

Q1:   

Why to use NumPy?

  
Add to PDF   Entry 
Q2:   

Explain what is ndarray in NumPy

  
Add to PDF   Junior 
Q3:   

Compute the min/max for each row for a NumPy 2D array

  
Add to PDF   Junior 
Q4:   

How would you convert a Pandas DataFrame into a NumPy array?

  
Add to PDF   Junior 
Q5:   

What is the difference between ndarray and array in NumPy?

  
Add to PDF   Junior 
Q6:   

Is there a difference between Numpy var() and Pandas var()?

  Related To: Pandas
 Add to PDF   Mid 
Q7:   

Explain what is Vectorization in NumPy

  
 Add to PDF   Mid 
Q8:   

What does einsum do in NumPy?

  
 Add to PDF   Mid 
Q9:   

What is the difference between Vectorisation vs Broadcasting in NumPy?

  
 Add to PDF   Mid 
Q10:   

What is broadcasting in connection to Linear Algebra?

  Related To: Linear Algebra
 Add to PDF   Mid 
Q11:   

What are the advantages of NumPy over regular Python lists?

  
 Add to PDF   Mid 
Q12:   

What are the differences between np.mean() vs np.average() in Python NumPy?

  
 Add to PDF   Mid 
Q13:   

What is the most efficient way to map a function over a NumPy array?

  
 Add to PDF   Mid 
Q14:   

What are the differences between NumPy arrays and matrices?

  
 Add to PDF   Mid 
Q15:   

What is the difference between flatten and ravel functions in NumPy?

  
 Add to PDF   Mid 
Q16:   

What is the purpose of meshgrid in Python/NumPy?

  Related To: Python
 Add to PDF   Mid 
Q17:   

What is the difference between contiguous and non-contiguous arrays?

  
 Add to PDF   Senior 
Q18:   

What is the difference between the following assignment methods?

  
 Add to PDF   Senior 
Q19:   

What are Strides in NumPy? How does it work?

  
 Add to PDF   Senior 
Q20:   

What's the difference between a View and a Shallow Copy of a NumPy array?

  
 Add to PDF   Senior 
Q21:   

How to normalize an array in NumPy to a Unit Vector?

  
 Add to PDF   Senior 
Q22:   

What are some main reason why NumPy is so fast?

  
 Add to PDF   Senior 
Q23:   

What is Fortran contiguous arrays?

  
 Add to PDF   Expert 

NumPy Practical Challenges

Q1:   

How to access the i-th column of a NumPy multidimensional array?

  
 Add to PDF   Junior 
Q2:   

How to find all occurrences of an Element in a list

  Related To: Python
 Add to PDF   Junior 
Q3:   

Calculate the Euclidean Distance between two points

  
 Add to PDF   Junior 
Q4:   

Convert array of indices to One-Hot encoded NumPy array

  
  Add to PDF   Mid 
Q5:   

How to convert an array of arrays into a flat 1D array?

  
  Add to PDF   Mid 
Q6:   

How to find all the local maxima (or peaks) in a 1D array?

  
  Add to PDF   Mid 
Q7:   

What's the easiest way to implement a moving average with NumPy?

  
  Add to PDF   Mid 
Q8:   

Extract all numbers between a given range from a NumPy array

  
  Add to PDF   Mid 
Q9:   

How to convert a numeric array to a categorical (text) array?

  
  Add to PDF   Mid 
Q10:   

Transpose matrix using einsum similar to np.transpose(arr)

  
  Add to PDF   Mid 
Q11:   

What is the difference between test[:,0] vs test[:,[0]]? When would you use one?

  
  Add to PDF   Mid 
Q12:   

How would you reverse a NumPy array?

  
  Add to PDF   Mid 
Q13:   

How would you get indices of N-max values in a NumPy array?

  
  Add to PDF   Mid 
Q14:   

Write the einsum equivalent of inner, outer, sum, and multiplication functions

  
  Add to PDF   Senior 
Q15:   

Consider an array Z = [1,2,3,4,5,6,7,8,9,10,11,12,13,14], how to generate an array R = [[1,2,3,4], [2,3,4,5], [3,4,5,6], ..., [11,12,13,14]]?

  
  Add to PDF   Senior 
Q16:   

Consider a one-dimensional array Z, build a two-dimensional array whose first row is (Z[0],Z[1],Z[2]) and each subsequent row is shifted by 1 (last row should be (Z[-3],Z[-2],Z[-1]))

  
  Add to PDF   Senior 
Q17:   

Sum over last two axis at once

  
  Add to PDF   Senior 
 

Prepare for AI developer and engineer interviews with 19 answered OpenClaw questions covering Gateway architecture, channels, agent workspaces, memory, MCP, model failover, multi-agent routing, security, sandboxing, approvals, and remote operations....

Prepare for AI agent developer interviews with 15 Model Context Protocol (MCP) questions covering tools, resources, prompts, JSON-RPC, transports, roots, sampling, security, and practical MCP server design....

Amazone runs the internet as we know it. Amazon Web Services (AWS) offers a comprehensive suite of machine learning (ML) services that cater to various needs and expertise levels. Follow along and learn the 23 most common AWS machine-learning intervi...

Azure Machine Learning (Azure ML) is a cloud-based service for creating and managing machine learning solutions. It’s designed to scale, distribute, and deploy machine learning models to the cloud. Follow along and learn the 23 most common Azure Mach...
Hadoop is an open-source big data processing framework. It leverages distributed computing to store and process large datasets in a fault-tolerant manner. According to recent reports, Apache Hadoop is one of the most sought-after big data skills with...
Apache Spark is a unified analytics engine for large-scale data processing. It is built to handle various use cases in big data analytics, including data processing, machine learning, and graph processing. Follow along and learn the 23 most common an...
Scala is a powerful language with functional programming capabilities that can be a good choice for data science, especially in big data and distributed computing scenarios. As an example, Apache Spark, a popular distributed data processing framework...
PyTorch popularity as a Deep Learning framework of choice is on the rise. As of December 2022, 62% of the academic papers were implemented in PyTorch whereas only 4% were for TensorFlow. Follow along and prepare effectively with these key 30 PyTorch ...
The use of Artificial Intelligence (AI) in machine learning and data science enabled advancements in areas such as natural language processing, computer vision, recommendation systems, fraud detection, predictive analytics, and personalized medicine....
Optimization algorithms are extensively used in training machine learning models. Data engineers employ algorithms like gradient descent, stochastic gradient descent, and variants (e.g., Adam, RMSprop) to optimize the model parameters and minimize th...