PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency in data manipulation and feature engineering with Python and pandas, specifically cleaning transactional logs and deriving user-level time-based metrics such as inter-event intervals.

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

Clean and Analyze User Transactions with Python Functions

Company: PayPal

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

transactions +---------+---------------------+---------+ | user_id | trans_ts | amount | +---------+---------------------+---------+ | 11 |2024-06-03 10:00:00 | 25.80 | | 11 |2024-06-03 10:05:00 | 10.50 | | 12 |2024-06-03 12:00:00 | 40.00 | | 11 |2024-06-04 09:00:00 | 15.00 | | 12 |2024-06-05 13:20:00 | 33.30 | +---------+---------------------+---------+ ##### Scenario Analyst must clean monthly transaction logs and derive user-level features for downstream modeling. ##### Question Implement a Python function that removes users with fewer than 100 transactions per calendar month. Implement another function that returns each user's average time between consecutive transactions in seconds. ##### Hints Use pandas groupby with size()/filter and shift() on sorted timestamps; convert Timedelta to .dt.total_seconds().

Quick Answer: This question evaluates proficiency in data manipulation and feature engineering with Python and pandas, specifically cleaning transactional logs and deriving user-level time-based metrics such as inter-event intervals.

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)