PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency in SQL joins, aggregations and window functions alongside Python data-manipulation skills to compute per-user totals, running cumulative amounts, and leaderboards of senders and receivers.

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

Analyze Transaction Flow and User Engagement Efficiently

Company: Robinhood

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

transactions +---------------+-------------+------------+--------+ | transaction_id| from_user_id| to_user_id | amount | +---------------+-------------+------------+--------+ | 1 | 101 | 202 | 50 | | 2 | 303 | 101 | -20 | | 3 | 101 | 404 | 30 | | 4 | 202 | 303 | 100 | | 5 | 404 | 101 | -60 | +---------------+-------------+------------+--------+ ​ users +---------+----------+ | user_id | name | +---------+----------+ | 101 | Alice | | 202 | Bob | | 303 | Carol | | 404 | Dave | +---------+----------+ ##### Scenario A peer-to-peer payments start-up wants quick insights from its transaction log and user directory to understand money flow and user engagement. ##### Question SQL – Using tables users(user_id, name) and transactions(transaction_id, from_user_id, to_user_id, amount), write a query that joins the two tables to return each user’s name, total_amount_sent and total_amount_received. SQL – Add a window function to the previous query to show, for every transaction, the running cumulative amount_sent per from_user_id ordered by transaction_id. Python – Given the same transactions dataframe, output two Series: the top 5 user_ids by number of sent transactions and the top 5 user_ids by number of received transactions (treat negative amounts as money flowing in the opposite direction). ##### Hints For SQL, think LEFT JOINs/Aggregate and SUM with PARTITION BY. For Python, normalise sender/receiver per row, then value_counts.

Quick Answer: This question evaluates proficiency in SQL joins, aggregations and window functions alongside Python data-manipulation skills to compute per-user totals, running cumulative amounts, and leaderboards of senders and receivers.

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 to localize trading drop contributors - Robinhood (Medium)
  • Write SQL and Python for transaction analytics - Robinhood (Medium)
  • Identify Transactions During 'Golden' Membership Period - Robinhood (Medium)
  • List Transactions During Active 'Gold' Membership Period - Robinhood (Medium)
  • Identify Top Users with Declined Transactions in SQL - Robinhood (Medium)