Data Scientist Interview Questions

Review this list of 278 data scientist interview questions and answers verified by hiring managers and candidates.
  • Apple logoAsked at Apple 
    +9

    "we can use two pointer + set like maintain i,j and also insert jth character to set like while set size is equal to our window j-i+1 then maximize our answer and increase jth pointer till last index"

    Kishor J. - "we can use two pointer + set like maintain i,j and also insert jth character to set like while set size is equal to our window j-i+1 then maximize our answer and increase jth pointer till last index"See full answer

    Data Scientist
    Data Structures & Algorithms
    +4 more
  • Microsoft logoAsked at Microsoft 

    "In the Transformer architecture, the decoder differs from the encoder primarily in its additional mechanisms designed to handle autoregressive sequence generation. Here's a breakdown of the key differences: Self-Attention Mechanism: Encoder: The encoder has a standard self-attention mechanism that allows each token to attend to all other tokens in the input sequence. Decoder: The decoder has two types of self-attention. The first is the same as in the encoder, but the second is mas"

    Ranj A. - "In the Transformer architecture, the decoder differs from the encoder primarily in its additional mechanisms designed to handle autoregressive sequence generation. Here's a breakdown of the key differences: Self-Attention Mechanism: Encoder: The encoder has a standard self-attention mechanism that allows each token to attend to all other tokens in the input sequence. Decoder: The decoder has two types of self-attention. The first is the same as in the encoder, but the second is mas"See full answer

    Data Scientist
    Statistics & Experimentation
  • "there's no audio the last ~10 minutes from the interviewer so we can't get a sense of the feedback from the interviewer. I did think it took the interviewee a little too long to figure out the issue itself and could have benefited from taking some time to think and gather thoughts before jumping into drivers of the issue."

    Sabi M. - "there's no audio the last ~10 minutes from the interviewer so we can't get a sense of the feedback from the interviewer. I did think it took the interviewee a little too long to figure out the issue itself and could have benefited from taking some time to think and gather thoughts before jumping into drivers of the issue."See full answer

    Data Scientist
    Analytical
    +1 more
  • +16

    "SELECT u.user_id, u.user_name, u.email, ROUND(AVG(CASE WHEN b.status = 'Unmatched' THEN 1.0 ELSE 0 END), 2) AS avgunmatchedbookings FROM users u LEFT JOIN bookings b ON u.userid = b.userid GROUP BY u.user_id, u.user_name, u.email; `"

    Akshay D. - "SELECT u.user_id, u.user_name, u.email, ROUND(AVG(CASE WHEN b.status = 'Unmatched' THEN 1.0 ELSE 0 END), 2) AS avgunmatchedbookings FROM users u LEFT JOIN bookings b ON u.userid = b.userid GROUP BY u.user_id, u.user_name, u.email; `"See full answer

    Data Scientist
    Coding
    +1 more
  • Adobe logoAsked at Adobe 
    +20

    "#inplace reversal without inbuilt functions def reverseString(s): chars = list(s) l, r = 0, len(s)-1 while l < r: chars[l],chars[r] = chars[r],chars[l] l += 1 r -= 1 reversed = "".join(chars) return reversed "

    Anonymous Possum - "#inplace reversal without inbuilt functions def reverseString(s): chars = list(s) l, r = 0, len(s)-1 while l < r: chars[l],chars[r] = chars[r],chars[l] l += 1 r -= 1 reversed = "".join(chars) return reversed "See full answer

    Data Scientist
    Data Structures & Algorithms
    +4 more
  • 🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.

  • +9

    "Required output in the solution not the one requested from the question. only customerid, firstname, last_name and years were required. Please this needs to be very clear. Otherwise my answer is with totalorderyear as ( SELECT o.customer_id, c.first_name, c.last_name, EXTRACT(YEAR FROM o.orderdate) AS orderyear, COUNT(o.orderid) AS totalorders FROM orders o LEFT JOIN customers c ON c.customerid = o.customerid GROUP BY o.customerid, c.firstname, c.last"

    Gloriose H. - "Required output in the solution not the one requested from the question. only customerid, firstname, last_name and years were required. Please this needs to be very clear. Otherwise my answer is with totalorderyear as ( SELECT o.customer_id, c.first_name, c.last_name, EXTRACT(YEAR FROM o.orderdate) AS orderyear, COUNT(o.orderid) AS totalorders FROM orders o LEFT JOIN customers c ON c.customerid = o.customerid GROUP BY o.customerid, c.firstname, c.last"See full answer

    Data Scientist
    Coding
    +1 more
  • TikTok logoAsked at TikTok 
    Video answer for 'Define success for TikTok.'
    +2

    "Mission: Tiktok's mission is to inspire creativity and Joy. Any business wants to make sure that they are serving the value to their customers: For TikTok customers are: Viewers 2. Content Creators 3. Advertisers So few metrics we could measure are: Time spent/day Total no of videos created/day engagement rate = users who interacted in one of the meaningful action on Tiktok / total users at a day level either likes, share, watched vide for at least 5 mins, created video "

    Nikita B. - "Mission: Tiktok's mission is to inspire creativity and Joy. Any business wants to make sure that they are serving the value to their customers: For TikTok customers are: Viewers 2. Content Creators 3. Advertisers So few metrics we could measure are: Time spent/day Total no of videos created/day engagement rate = users who interacted in one of the meaningful action on Tiktok / total users at a day level either likes, share, watched vide for at least 5 mins, created video "See full answer

    Data Scientist
    Analytical
    +1 more
  • OpenAI logoAsked at OpenAI 

    "Clarifying questions and Assumptions ChatGPT search means the search function inside the chat app? OR ChatGPT search Chrome extension? Assumption: Search inside the chat app. Is there any location restriction in this analysis? Assumption: USA only. Is there any user segment restriction in this analysis? Assumption: All user segments. Are we assuming the ChatGPT search already exists or going back in time before the ChatGPT search existed? Assumption: Go back in time"

    Darpan D. - "Clarifying questions and Assumptions ChatGPT search means the search function inside the chat app? OR ChatGPT search Chrome extension? Assumption: Search inside the chat app. Is there any location restriction in this analysis? Assumption: USA only. Is there any user segment restriction in this analysis? Assumption: All user segments. Are we assuming the ChatGPT search already exists or going back in time before the ChatGPT search existed? Assumption: Go back in time"See full answer

    Data Scientist
    Analytical
    +1 more
  • Video answer for 'E-commerce (1 of 5)'
    +14

    "SELECT SUM(orderquantity) AS totalunitsorderedyesterday FROM orders WHERE order_date = DATE('now', '-1 DAY') `"

    Akshay D. - "SELECT SUM(orderquantity) AS totalunitsorderedyesterday FROM orders WHERE order_date = DATE('now', '-1 DAY') `"See full answer

    Data Scientist
    Coding
    +1 more
  • +11

    "WITH RECURSIVE RecursiveHierarchy AS ( SELECT Emp_ID, First_Name, Middle_Name, Last_Name, country, Manager_ID, 1 AS Level FROM tbl_Employee WHERE Emp_ID = 2 UNION ALL SELECT e.Emp_ID, e.First_Name, e.Middle_Name, e.Last_Name, e.Country, e.Manager_ID, rh.Level + 1 FROM tbl_Employee e INNER JOIN RecursiveHierarchy rh ON e.EmpID = rh.ManagerID WHERE rh.Level < 4 ) , SalariesInUSD AS ( SELECT rh.Level, `rh.FirstName || ' ' || rh.MiddleN"

    G B. - "WITH RECURSIVE RecursiveHierarchy AS ( SELECT Emp_ID, First_Name, Middle_Name, Last_Name, country, Manager_ID, 1 AS Level FROM tbl_Employee WHERE Emp_ID = 2 UNION ALL SELECT e.Emp_ID, e.First_Name, e.Middle_Name, e.Last_Name, e.Country, e.Manager_ID, rh.Level + 1 FROM tbl_Employee e INNER JOIN RecursiveHierarchy rh ON e.EmpID = rh.ManagerID WHERE rh.Level < 4 ) , SalariesInUSD AS ( SELECT rh.Level, `rh.FirstName || ' ' || rh.MiddleN"See full answer

    Data Scientist
    Coding
    +1 more
  • Google logoAsked at Google 
    Data Scientist
    Analytical
    +1 more
  • Data Scientist
    Statistics & Experimentation
  • Amazon logoAsked at Amazon 
    +4

    "Any cycle would cause the prerequisite to be greater than the course. This passes all the tests: function canFinish(_numCourses, prerequisites) { for (const [a, b] of prerequisites) { if (b > a) return false } return true } `"

    Jeremy D. - "Any cycle would cause the prerequisite to be greater than the course. This passes all the tests: function canFinish(_numCourses, prerequisites) { for (const [a, b] of prerequisites) { if (b > a) return false } return true } `"See full answer

    Data Scientist
    Data Structures & Algorithms
    +4 more
  • "P(A) = 0.6 P(B) = 0.4 P(D|A) = 0.05 P(D|B) = 0.03 Question asks to solve for P(A|D) P(A|D) = (P(D|A) x P(A))/P(D) = (0.05 x 0.6)/(P(D|A) x P(A) + P(D|B) x P(B)) = (0.05 x 0.6)/(0.05 x 0.6+0.03 x 0.4) = 30/42 = 5/7 = 0.714 Notice above that P(D) = P(D|A) x P(A) + P(D|B) x P (B)"

    Saurabh K. - "P(A) = 0.6 P(B) = 0.4 P(D|A) = 0.05 P(D|B) = 0.03 Question asks to solve for P(A|D) P(A|D) = (P(D|A) x P(A))/P(D) = (0.05 x 0.6)/(P(D|A) x P(A) + P(D|B) x P(B)) = (0.05 x 0.6)/(0.05 x 0.6+0.03 x 0.4) = 30/42 = 5/7 = 0.714 Notice above that P(D) = P(D|A) x P(A) + P(D|B) x P (B)"See full answer

    Data Scientist
    Statistics & Experimentation
  • Apple logoAsked at Apple 
    +15

    "function isValid(s) { const stack = []; for (let i=0; i < s.length; i++) { const char = s.charAt(i); if (['(', '{', '['].includes(char)) { stack.push(char); } else { const top = stack.pop(); if ((char === ')' && top !== '(') || (char === '}' && top !== '{') || (char === ']' && top !== '[')) { return false; } } } return stack.length === 0"

    Tiago R. - "function isValid(s) { const stack = []; for (let i=0; i < s.length; i++) { const char = s.charAt(i); if (['(', '{', '['].includes(char)) { stack.push(char); } else { const top = stack.pop(); if ((char === ')' && top !== '(') || (char === '}' && top !== '{') || (char === ']' && top !== '[')) { return false; } } } return stack.length === 0"See full answer

    Data Scientist
    Data Structures & Algorithms
    +4 more
  • Visa logoAsked at Visa 

    "There are couple of reasons for it - Kind of role : Its a product manager role loaded with analytical work, So working with data in stringent regulatory guideline make it more exciting and thrilling. Location & industry is like - Cherry on the cake, Bangalore weather and BFI is at its all time peak as people spending behavior is changing continuously, it will be interesting to see big giants like visa are managing it."

    Nidhi S. - "There are couple of reasons for it - Kind of role : Its a product manager role loaded with analytical work, So working with data in stringent regulatory guideline make it more exciting and thrilling. Location & industry is like - Cherry on the cake, Bangalore weather and BFI is at its all time peak as people spending behavior is changing continuously, it will be interesting to see big giants like visa are managing it."See full answer

    Data Scientist
    Behavioral
    +4 more
  • +17

    "select name, stock from products p left join transactions t on p.id = t.product_id order by date desc limit 1"

    Daniel C. - "select name, stock from products p left join transactions t on p.id = t.product_id order by date desc limit 1"See full answer

    Data Scientist
    Coding
    +1 more
  • "I would use A/B testing to see if the new feature would be incrementally beneficial. To begin the testing, we should define what's the goal of this testing. Let's say the new feature would increase the average number of trade by X. Then randomly assign the clients to two groups, control and test group. Control group doesn't see the new feature and the test group see the new feature. We could also stratified sampling if we want to make sure cover different customer segmentation. During this desig"

    Jiin S. - "I would use A/B testing to see if the new feature would be incrementally beneficial. To begin the testing, we should define what's the goal of this testing. Let's say the new feature would increase the average number of trade by X. Then randomly assign the clients to two groups, control and test group. Control group doesn't see the new feature and the test group see the new feature. We could also stratified sampling if we want to make sure cover different customer segmentation. During this desig"See full answer

    Data Scientist
    Statistics & Experimentation
  • Adobe logoAsked at Adobe 
    Video answer for 'Find the median of two sorted arrays.'
    Data Scientist
    Data Structures & Algorithms
    +4 more
Showing 61-80 of 278