PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency in data cleaning, aggregation, and time-series manipulation within the Data Manipulation (SQL/Python) domain, focusing on filtering by group counts and calculating inter-event timing metrics.

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

Clean and Summarize User Purchase Data Efficiently

Company: PayPal

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

transactions +-----------+---------------------+-----------+--------+ | user_id | txn_timestamp | txn_value | txn_id | +-----------+---------------------+-----------+--------+ | 201 | 2023-09-01 09:00:00 | 15.50 | 1 | | 201 | 2023-09-01 09:05:00 | 17.00 | 2 | | 202 | 2023-09-01 10:00:00 | 20.00 | 3 | | 201 | 2023-09-02 11:00:00 | 5.00 | 4 | | 203 | 2023-09-02 11:05:00 | 22.00 | 5 | +-----------+---------------------+-----------+--------+ ##### Scenario You have a pandas DataFrame with user purchase history and need to clean and summarize it for analysts. ##### Question a) Implement a function that removes every user who has fewer than 100 transactions in any calendar month. b) Implement a second function that returns the average time between consecutive transactions, in seconds, for each remaining user. ##### Hints Group by user & month; use shift to compute timedeltas; convert Timedelta to seconds via .dt.total_seconds().

Quick Answer: This question evaluates proficiency in data cleaning, aggregation, and time-series manipulation within the Data Manipulation (SQL/Python) domain, focusing on filtering by group counts and calculating inter-event timing 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

  • Write SQL using HAVING and window functions - PayPal (easy)
  • Write SQL for top drivers and cancellation rates - PayPal (easy)
  • Compute top orders and cancellation rate - PayPal (easy)
  • Write SQL to flag Venmo ATO - PayPal (Medium)
  • Write conditional aggregation SQL queries - PayPal (Medium)