PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency in SQL and Python data manipulation, covering window functions, join semantics (INNER, LEFT, RIGHT, FULL, CROSS), ranking functions, group and string aggregation, type casting, and building row-wise accumulations in Python, and it falls under the Data Manipulation (SQL/Python) category.

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

Explain Window Functions and Joins in SQL and Python

Company: PayPal

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

TABLE transactions | transaction_id | user_id | merchant | amount | currency | transaction_ts | | 1001 | 17 | Walmart | 45.80 | USD | 2023-07-12 14:02:08 | | 1002 | 22 | Target | 23.15 | USD | 2023-07-12 15:10:44 | | 1003 | 17 | Walmart | 120.99 | USD | 2023-07-13 09:21:11 | | 1004 | 30 | eBay | 65.00 | USD | 2023-07-13 10:05:33 | ##### Scenario SQL and Python data-manipulation screen using PayPal payment data. ##### Question Explain window functions and list common use cases. Describe INNER, LEFT, RIGHT, FULL and CROSS joins. Difference between RANK() and DENSE_RANK(). Write a query that aggregates GMV per merchant (basic GROUP BY). Return each user’s merchants as a comma-separated string, handling type casts between DECIMAL and STRING when needed. Using Python, iterate through a list of dictionaries representing rows and build a mapping of user_id ➜ total_amount. ##### Hints Show clean SQL, window-function syntax, GROUP_CONCAT/STRING_AGG usage, and Python dict accumulation.

Quick Answer: This question evaluates proficiency in SQL and Python data manipulation, covering window functions, join semantics (INNER, LEFT, RIGHT, FULL, CROSS), ranking functions, group and string aggregation, type casting, and building row-wise accumulations in Python, and it falls under the Data Manipulation (SQL/Python) category.

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)