PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates data manipulation and analytical skills in SQL and Python, focusing on time-based aggregation, deduplication and ranking of events, calculation of rolling averages, and computation of daily active user metrics.

  • Medium
  • Uber
  • Data Manipulation (SQL/Python)
  • Data Scientist

Analyze User Purchase Behavior in Online Marketplace Data

Company: Uber

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

user_events +----------+------------+---------------------+-------------+ | user_id | event_type | event_timestamp | product_id | +----------+------------+---------------------+-------------+ | 101 | view | 2024-01-02 10:00:00 | 55 | | 101 | purchase | 2024-01-02 10:05:00 | 55 | | 102 | purchase | 2024-01-03 09:30:00 | 77 | | 101 | purchase | 2024-02-01 12:00:00 | 88 | | 103 | view | 2024-02-02 08:00:00 | 23 | ##### Scenario Online marketplace wants to understand user purchase behavior stored in user_events table. ##### Question SQL: For each user, return the first product_id they purchased and the purchase timestamp. SQL: Count the number of distinct users who made at least two purchases on the same day. SQL: Find the top 3 products by total number of purchases. SQL: Calculate the 7-day rolling average of daily purchases overall. Pandas: Given the same data in DataFrame df, compute daily active users (unique user_id per date). ##### Hints Use window functions, GROUP BY, DISTINCT, rolling(), and groupby().

Quick Answer: This question evaluates data manipulation and analytical skills in SQL and Python, focusing on time-based aggregation, deduplication and ranking of events, calculation of rolling averages, and computation of daily active user metrics.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Transform DataFrame and compute diff-in-diff - Uber (easy)
  • Write SQL for active counts and YTD top driver - Uber (Medium)
  • Write SQL and Pandas for Uber Trips - Uber (Medium)
  • Compute ETA shift and conversion uplift - Uber (Medium)
  • Write SQL/Python for CTR analytics - Uber (Medium)