2dbi
Home/Palantir/SQL: Aggregate and Join Across Tables
PPalantir·DSASWE-2Decision / Coding (Decic)

SQL: Aggregate and Join Across Tables

Problem

Given orders(id, user_id, amount) and users(id, country), write SQL for total spend per country, then the top spender per country.

Example

SELECT country, SUM(amount) ... GROUP BY country

Constraints

  • Use window functions for the per-country top spender

Note

Palantir OAs mix a SQL task with the coding problem. Explain index/JOIN trade-offs and how it integrates with client data.

added 6 days ago
LeadersAccount