Machine Learning Engineer Interview Questions

Review this list of 210 machine learning engineer interview questions and answers verified by hiring managers and candidates.
  • Microsoft logoAsked at Microsoft 
    Video answer for 'How do you select the value of 'k' in the k-means algorithm?'
    +1

    "Picking the value of 'k' can be little tricky. One simple approach would be to start with elbow method. Try different 'k' values and plot them on a graph like an experiment. When the graph starts to look like an elbow, that's a good 'k' to pick! Also keep in mind you may not always have clearly clustered data. The elbow may not be clear and sharp as you expect. Hope this helps."

    Praveen D. - "Picking the value of 'k' can be little tricky. One simple approach would be to start with elbow method. Try different 'k' values and plot them on a graph like an experiment. When the graph starts to look like an elbow, that's a good 'k' to pick! Also keep in mind you may not always have clearly clustered data. The elbow may not be clear and sharp as you expect. Hope this helps."See full answer

    Machine Learning Engineer
    Concept
    +1 more
  • Amazon logoAsked at Amazon 
    Video answer for 'Implement k-means clustering.'

    "i dont know"

    Dinesh K. - "i dont know"See full answer

    Machine Learning Engineer
    Coding
    +5 more
  • Goldman Sachs logoAsked at Goldman Sachs 
    +8

    "public static Integer[] findLargest(int[] input, int m) { if(input==null || input.length==0) return null; PriorityQueue minHeap=new PriorityQueue(); for(int i:input) { if(minHeap.size()(int)top){ minHeap.poll(); minHeap.add(i); } } } Integer[] res=minHeap.toArray(new Integer[0]); Arrays.sort(res); return res; }"

    Divya R. - "public static Integer[] findLargest(int[] input, int m) { if(input==null || input.length==0) return null; PriorityQueue minHeap=new PriorityQueue(); for(int i:input) { if(minHeap.size()(int)top){ minHeap.poll(); minHeap.add(i); } } } Integer[] res=minHeap.toArray(new Integer[0]); Arrays.sort(res); return res; }"See full answer

    Machine Learning Engineer
    Data Structures & Algorithms
    +2 more
  • Adobe logoAsked at Adobe 
    Video answer for 'Given the root of a binary tree of integers, return the maximum path sum.'

    "\# Definition for a binary tree node. class TreeNode: def init(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def maxPathSum(self, root: TreeNode) -> int: self.max_sum = float('-inf')"

    Jerry O. - "\# Definition for a binary tree node. class TreeNode: def init(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def maxPathSum(self, root: TreeNode) -> int: self.max_sum = float('-inf')"See full answer

    Machine Learning Engineer
    Data Structures & Algorithms
    +4 more
  • Meta (Facebook) logoAsked at Meta (Facebook) 
    Machine Learning Engineer
    System Design
  • 🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.

  • Adobe logoAsked at Adobe 
    Video answer for 'Product of Array Except Self'
    +40

    "If 0's aren't a concern, couldn't we just multiply all numbers. and then divide product by each number in the list ? if there's more than one zero, then we just return an array of 0s if there's one zero, then we just replace 0 with product and rest 0s. what am i missing?"

    Sachin R. - "If 0's aren't a concern, couldn't we just multiply all numbers. and then divide product by each number in the list ? if there's more than one zero, then we just return an array of 0s if there's one zero, then we just replace 0 with product and rest 0s. what am i missing?"See full answer

    Machine Learning Engineer
    Data Structures & Algorithms
    +3 more
  • Amazon logoAsked at Amazon 
    +5

    "A few months ago I joined a micro-services platform engineering team as their manager, at that time my team was struggling to deliver towards an upcoming production deadline for a customer facing product. Production date had been moved 5 times already and there were about 40% of product features which were remaining to be tested and signed off to move to production . I was made responsible to deliver the release of this product within the deadline and turnaround the software delivery throughput."

    Shuchi A. - "A few months ago I joined a micro-services platform engineering team as their manager, at that time my team was struggling to deliver towards an upcoming production deadline for a customer facing product. Production date had been moved 5 times already and there were about 40% of product features which were remaining to be tested and signed off to move to production . I was made responsible to deliver the release of this product within the deadline and turnaround the software delivery throughput."See full answer

    Machine Learning Engineer
    Behavioral
    +2 more
  • Machine Learning Engineer
    System Design
  • OpenAI logoAsked at OpenAI 
    Machine Learning Engineer
    Behavioral
    +5 more
  • Airbnb logoAsked at Airbnb 
    Machine Learning Engineer
    Data Structures & Algorithms
    +4 more
  • Capital One logoAsked at Capital One 
    Machine Learning Engineer
    System Design
  • Pinterest logoAsked at Pinterest 
    Video answer for 'Implement a k-nearest neighbors algorithm.'
    +3

    "Even more faster and vectorized version, using np.linalg.norm - to avoid loop and np.argpartition to select lowest k. We dont need to sort whole array - we need to be sure that first k elements are lower than the rest. import numpy as np def knn(Xtrain, ytrain, X_new, k): distances = np.linalg.norm(Xtrain - Xnew, axis=1) k_indices = np.argpartition(distances, k)[:k] # O(N) selection instead of O(N log N) sort return int(np.sum(ytrain[kindices]) > k / 2.0) `"

    Dinar M. - "Even more faster and vectorized version, using np.linalg.norm - to avoid loop and np.argpartition to select lowest k. We dont need to sort whole array - we need to be sure that first k elements are lower than the rest. import numpy as np def knn(Xtrain, ytrain, X_new, k): distances = np.linalg.norm(Xtrain - Xnew, axis=1) k_indices = np.argpartition(distances, k)[:k] # O(N) selection instead of O(N log N) sort return int(np.sum(ytrain[kindices]) > k / 2.0) `"See full answer

    Machine Learning Engineer
    Coding
    +1 more
  • Adobe logoAsked at Adobe 
    Machine Learning Engineer
    Data Structures & Algorithms
    +4 more
  • Adobe logoAsked at Adobe 
    +7

    "function findPrimes(n) { if (n < 2) return []; const primes = []; for (let i=2; i <= n; i++) { const half = Math.floor(i/2); let isPrime = true; for (let prime of primes) { if (i % prime === 0) { isPrime = false; break; } } if (isPrime) { primes.push(i); } } return primes; } `"

    Tiago R. - "function findPrimes(n) { if (n < 2) return []; const primes = []; for (let i=2; i <= n; i++) { const half = Math.floor(i/2); let isPrime = true; for (let prime of primes) { if (i % prime === 0) { isPrime = false; break; } } if (isPrime) { primes.push(i); } } return primes; } `"See full answer

    Machine Learning Engineer
    Data Structures & Algorithms
    +4 more
  • Adobe logoAsked at Adobe 
    Video answer for 'Given an nxn grid of 1s and 0s, return the number of islands in the input.'
    +9

    " from typing import List def getnumberof_islands(binaryMatrix: List[List[int]]) -> int: if not binaryMatrix: return 0 rows = len(binaryMatrix) cols = len(binaryMatrix[0]) islands = 0 for r in range(rows): for c in range(cols): if binaryMatrixr == 1: islands += 1 dfs(binaryMatrix, r, c) return islands def dfs(grid, r, c): if ( r = len(grid) "

    Rick E. - " from typing import List def getnumberof_islands(binaryMatrix: List[List[int]]) -> int: if not binaryMatrix: return 0 rows = len(binaryMatrix) cols = len(binaryMatrix[0]) islands = 0 for r in range(rows): for c in range(cols): if binaryMatrixr == 1: islands += 1 dfs(binaryMatrix, r, c) return islands def dfs(grid, r, c): if ( r = len(grid) "See full answer

    Machine Learning Engineer
    Data Structures & Algorithms
    +4 more
  • Databricks logoAsked at Databricks 
    Video answer for 'What is your leadership style?'
    +7

    "My leadership style is flexible and adaptive, it varies depending on the team members and the needs of the company. My leadership goal is to empower the team and inspire and grow leaders. In order to achieve that, I combine transformational, democratic and coaching leadership styles. Usually when we are facing a new type of challenge, or at the early stage of a project, I like to adapt the transformational leadership which allows me to listen to all the suggestions from the team members and sta"

    onering2ruleall - "My leadership style is flexible and adaptive, it varies depending on the team members and the needs of the company. My leadership goal is to empower the team and inspire and grow leaders. In order to achieve that, I combine transformational, democratic and coaching leadership styles. Usually when we are facing a new type of challenge, or at the early stage of a project, I like to adapt the transformational leadership which allows me to listen to all the suggestions from the team members and sta"See full answer

    Machine Learning Engineer
    Behavioral
    +5 more
  • Adobe logoAsked at Adobe 
    Video answer for 'Find a triplet in an array with a given sum.'
    +5

    " import java.util.*; class Solution { // Time Complexity: O(n^2) // Space Complexity: O(n) public static List> threeSum(int[] nums) { // Ensure that the array is sorted first Arrays.sort(nums); // Create the results list to return List> results = new ArrayList(); // Iterate over the length of nums for (int i = 0; i < nums.length-2; i++) { // We will have the first number in"

    Victor O. - " import java.util.*; class Solution { // Time Complexity: O(n^2) // Space Complexity: O(n) public static List> threeSum(int[] nums) { // Ensure that the array is sorted first Arrays.sort(nums); // Create the results list to return List> results = new ArrayList(); // Iterate over the length of nums for (int i = 0; i < nums.length-2; i++) { // We will have the first number in"See full answer

    Machine Learning Engineer
    Data Structures & Algorithms
    +3 more
  • Adobe logoAsked at Adobe 
    Video answer for 'Given stock prices for the next n days, how can you maximize your profit by buying or selling one share per day?'
    +9

    "from typing import List def maxprofitgreedy(stock_prices: List[int]) -> int: l=0 # buying r=1 # selling max_profit=0 while rstock_prices[l]: profit=stockprices[r]-stockprices[l] maxprofit=max(maxprofit,profit) else: l=r r+=1 return max_profit debug your code below print(maxprofitgreedy([7, 1, 5, 3, 6, 4])) `"

    Prajwal M. - "from typing import List def maxprofitgreedy(stock_prices: List[int]) -> int: l=0 # buying r=1 # selling max_profit=0 while rstock_prices[l]: profit=stockprices[r]-stockprices[l] maxprofit=max(maxprofit,profit) else: l=r r+=1 return max_profit debug your code below print(maxprofitgreedy([7, 1, 5, 3, 6, 4])) `"See full answer

    Machine Learning Engineer
    Data Structures & Algorithms
    +4 more
  • "It might not be a good idea to predict stock prices only based on reddit comments. You could create a signal from reddit comments that can indicate "social media interest" and feed it into a ML system (along with other features) that predicts prices. Collecting good data to train the model and evaluating it correctly are going to be huge challenges."

    Satyajit G. - "It might not be a good idea to predict stock prices only based on reddit comments. You could create a signal from reddit comments that can indicate "social media interest" and feed it into a ML system (along with other features) that predicts prices. Collecting good data to train the model and evaluating it correctly are going to be huge challenges."See full answer

    Machine Learning Engineer
    System Design
  • Meta (Facebook) logoAsked at Meta (Facebook) 
    Machine Learning Engineer
    System Design
Showing 61-80 of 210