Skip to main content

Data Analyst Coding Interview Questions

Review this list of 26 Coding Data Analyst interview questions and answers verified by hiring managers and candidates.
  • 7 answers
    +4

    "-- LTV = Sum of all purchases made by that user -- order the results by desc on LTV select u.user_id, sum(a.purchase_value) as LTV from user_sessions u join attribution a on u.sessionid = a.sessionid group by u.user_id order by sum(a.purchase_value) desc"

    Mohit C. - "-- LTV = Sum of all purchases made by that user -- order the results by desc on LTV select u.user_id, sum(a.purchase_value) as LTV from user_sessions u join attribution a on u.sessionid = a.sessionid group by u.user_id order by sum(a.purchase_value) desc"See full answer

    Data Analyst
    Coding
    +3 more
  • 8 answers
    +5

    "Schema is wrong - id from product is mapped to id from transactions, id from product should point to product_id in transcations table"

    Arshad P. - "Schema is wrong - id from product is mapped to id from transactions, id from product should point to product_id in transcations table"See full answer

    Data Analyst
    Coding
    +1 more
  • 9 answers
    +6

    "Hi, my solution gives the exact numerical values as the proposed solution, but it doesn't pass the tests. Am I missing something, or is this a bug? def findrevenueby_city(transactions: pd.DataFrame, users: pd.DataFrame, exchange_rate: pd.DataFrame) -> pd.DataFrame: gets user city for each user id userids = users[['id', 'usercity']] and merge on transactions transactions = transactions.merge(user_ids, how='left"

    Gabriel P. - "Hi, my solution gives the exact numerical values as the proposed solution, but it doesn't pass the tests. Am I missing something, or is this a bug? def findrevenueby_city(transactions: pd.DataFrame, users: pd.DataFrame, exchange_rate: pd.DataFrame) -> pd.DataFrame: gets user city for each user id userids = users[['id', 'usercity']] and merge on transactions transactions = transactions.merge(user_ids, how='left"See full answer

    Data Analyst
    Coding
    +1 more
  • 6 answers
    +3

    " SELECT * FROM( SELECT c.first_name, c.last_name, t.receipt_number, COUNT(*) OVER (PARTITION BY c.customerid) AS noof_offences FROM customers c JOIN transactions t ON c.customerid = t.customerid WHERE t.receipt_number LIKE '%999%' OR t.receipt_number LIKE '%1234%' OR t.receipt_number LIKE '%XYZ%' ) sub WHERE noofoffences > 1 ; `"

    Harshitha B. - " SELECT * FROM( SELECT c.first_name, c.last_name, t.receipt_number, COUNT(*) OVER (PARTITION BY c.customerid) AS noof_offences FROM customers c JOIN transactions t ON c.customerid = t.customerid WHERE t.receipt_number LIKE '%999%' OR t.receipt_number LIKE '%1234%' OR t.receipt_number LIKE '%XYZ%' ) sub WHERE noofoffences > 1 ; `"See full answer

    Data Analyst
    Coding
    +3 more
  • 4 answers

    " import pandas as pd import numpy as np def findoverstretchedemployees(departments: pd.DataFrame, employees: pd.DataFrame, projects: pd.DataFrame, employees_projects: pd.DataFrame) -> pd.DataFrame: Make a copy to avoid modifying original dataframe projects = projects.copy() Convert dates to datetime projects["startdate"] = pd.todatetime(projects["start_date""

    Diyorbek T. - " import pandas as pd import numpy as np def findoverstretchedemployees(departments: pd.DataFrame, employees: pd.DataFrame, projects: pd.DataFrame, employees_projects: pd.DataFrame) -> pd.DataFrame: Make a copy to avoid modifying original dataframe projects = projects.copy() Convert dates to datetime projects["startdate"] = pd.todatetime(projects["start_date""See full answer

    Data Analyst
    Coding
    +1 more
  • 🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.

  • Add answer
    Data Analyst
    Coding
    +1 more
Showing 21-26 of 26
Exponent

Get updates in your inbox with the latest tips, job listings, and more.

Follow Us

Products
Courses
Interview Questions
Interview Experiences
Popular articles
Guides
Coaching
For Partners
Company
Exponent © 2026
Terms of Service | Privacy