Data Engineer Interview Questions

Review this list of 154 data engineer interview questions and answers verified by hiring managers and candidates.
  • 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?'
    +11

    "public static int maxProfitGreedy(int[] stockPrices) { int maxProfit = 0; for(int i = 1; i todayPrice) { maxProfit += tomorrowPrice - todayPrice; } } return maxProfit; } "

    Laksitha R. - "public static int maxProfitGreedy(int[] stockPrices) { int maxProfit = 0; for(int i = 1; i todayPrice) { maxProfit += tomorrowPrice - todayPrice; } } return maxProfit; } "See full answer

    Data Engineer
    Data Structures & Algorithms
    +4 more
  • +17

    "WITH max_score AS ( SELECT test_id, employee_id, MAX(score) AS best_score FROM test_results GROUP BY testid, employeeid ) SELECT ms.employee_id, e.name, SUM(bestscore) AS totalscore FROM max_score as ms JOIN employees as e ON ms.employee_id = e.id GROUP BY ms.employee_id ORDER BY totalscore DESC, ms.employeeid `"

    Salome L. - "WITH max_score AS ( SELECT test_id, employee_id, MAX(score) AS best_score FROM test_results GROUP BY testid, employeeid ) SELECT ms.employee_id, e.name, SUM(bestscore) AS totalscore FROM max_score as ms JOIN employees as e ON ms.employee_id = e.id GROUP BY ms.employee_id ORDER BY totalscore DESC, ms.employeeid `"See full answer

    Data Engineer
    Coding
    +3 more
  • Data Engineer
    Data Modeling
  • Data Engineer
    Data Pipeline Design
  • Data Engineer
    Data Modeling
  • 🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.

  • Data Engineer
    Data Modeling
  • "It's a 2Sum question with duplicate array elements."

    Anzhe M. - "It's a 2Sum question with duplicate array elements."See full answer

    Data Engineer
    Coding
    +1 more
  • Data Engineer
    Data Structures & Algorithms
    +4 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

    Data Engineer
    Data Structures & Algorithms
    +4 more
  • TikTok logoAsked at TikTok 
    Video answer for 'Split an array into equal sum subarrays'
    Data Engineer
    Data Structures & Algorithms
    +1 more
  • Adobe logoAsked at Adobe 
    Video answer for 'Given an nxn grid of 1s and 0s, return the number of islands in the input.'
    +10

    " 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

    Data Engineer
    Data Structures & Algorithms
    +4 more
  • Adobe logoAsked at Adobe 
    Video answer for 'Find a triplet in an array with a given sum.'
    +9

    "from typing import List def three_sum(nums: List[int]) -> List[List[int]]: nums.sort() triplets = set() for i in range(len(nums) - 2): firstNum = nums[i] l = i + 1 r = len(nums) - 1 while l 0: r -= 1 elif potentialSum < 0: l += 1 "

    Anonymous Roadrunner - "from typing import List def three_sum(nums: List[int]) -> List[List[int]]: nums.sort() triplets = set() for i in range(len(nums) - 2): firstNum = nums[i] l = i + 1 r = len(nums) - 1 while l 0: r -= 1 elif potentialSum < 0: l += 1 "See full answer

    Data Engineer
    Data Structures & Algorithms
    +3 more
  • OpenAI logoAsked at OpenAI 
    Data Engineer
    Behavioral
    +5 more
  • Apple logoAsked at Apple 
    +10

    "I was able to answer this question and the follow-up questions as well"

    Anonymous Wasp - "I was able to answer this question and the follow-up questions as well"See full answer

    Data 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

    Data Engineer
    Data Structures & Algorithms
    +4 more
  • Data Engineer
    Data Pipeline Design
    +1 more
  • Capital One logoAsked at Capital One 
    Data Engineer
    Data Structures & Algorithms
    +2 more
  • Adobe logoAsked at Adobe 
    +39

    "#include // Naive method to find a pair in an array with a given sum void findPair(int nums[], int n, int target) { // consider each element except the last for (int i = 0; i < n - 1; i++) { // start from the i'th element until the last element for (int j = i + 1; j < n; j++) { // if the desired sum is found, print it if (nums[i] + nums[j] == target) { printf("Pair found (%d, %d)\n", nums[i], nums[j]); return; } } } // we reach here if the pair is not found printf("Pair not found"); } "

    Gundala tarun,cse2020 V. - "#include // Naive method to find a pair in an array with a given sum void findPair(int nums[], int n, int target) { // consider each element except the last for (int i = 0; i < n - 1; i++) { // start from the i'th element until the last element for (int j = i + 1; j < n; j++) { // if the desired sum is found, print it if (nums[i] + nums[j] == target) { printf("Pair found (%d, %d)\n", nums[i], nums[j]); return; } } } // we reach here if the pair is not found printf("Pair not found"); } "See full answer

    Data Engineer
    Data Structures & Algorithms
    +5 more
  • Adobe logoAsked at Adobe 
    +1

    "def calc(expr): ans = eval(expr) return ans your code goes debug your code below print(calc("1 + 1")) `"

    Sarvesh G. - "def calc(expr): ans = eval(expr) return ans your code goes debug your code below print(calc("1 + 1")) `"See full answer

    Data Engineer
    Data Structures & Algorithms
    +3 more
  • +8

    " with youngsuccrate as( select strftime('%m', postdate) AS postmonth, round(sum(issuccessfulpost)*1.0/count(issuccessfulpost),2)as yascrate from post where userid in (select userid from post_user where age between 0 and 18) group by post_month ), nonyoungsucc_rate as( select strftime('%m', postdate) AS postmonth, round(sum(issuccessfulpost)*1.0/count(issuccessfulpost),2)as nonyasc_rate from post where user_id in (select"

    Bhavna S. - " with youngsuccrate as( select strftime('%m', postdate) AS postmonth, round(sum(issuccessfulpost)*1.0/count(issuccessfulpost),2)as yascrate from post where userid in (select userid from post_user where age between 0 and 18) group by post_month ), nonyoungsucc_rate as( select strftime('%m', postdate) AS postmonth, round(sum(issuccessfulpost)*1.0/count(issuccessfulpost),2)as nonyasc_rate from post where user_id in (select"See full answer

    Data Engineer
    Coding
    +3 more
Showing 61-80 of 154