SQL interview questions · By company
Capital One SQL interview questions
For data analyst and senior associate data analyst roles: what candidates report, and how to practice for it.
SQLRep isn't affiliated with or endorsed by Capital One. This guide summarizes public candidate reports and prep guides (sources below, checked November 2026). The practice questions are original, written in the reported style; they aren't Capital One's actual questions. Processes change, so confirm details with your recruiter.
What candidates report about the process
- Candidates report a timed online assessment (often on CodeSignal), heavy on SQL and spreadsheet-style data work.
- It's followed by a recruiter screen and a final 'Power Day' with case, technical and behavioral interviews.
SQL topics that come up
- Top earners per department with ranking functions
- High-spending ('whale') cardholders from transaction data
- Bucketing accounts with CASE, and handling NULLs in financial data
Practice the reported patterns
Each one runs in real PostgreSQL in your browser, with feedback on what's wrong.
- Whale cardholders: 3x the medianFor Q1 2025 (January 1 to March 31 inclusive), compute each cardholder's net spend (purchases minus refunds), counting only cardholders with a Q1 transaction. Return the whales: name, q1_spend and times_median (q1_spend divided by the median of those cardholders' Q1 spend, rounded to 2). Sort by q1_spend descending, then name.Pattern: PERCENTILE_CONT · CTE · net totalsHardPro
- Top two total-pay levels per departmentFor current staff only (left_on is NULL), total_pay = base_salary + bonus, where a NULL bonus means no bonus. Return everyone holding one of the top 2 distinct total_pay amounts in their department, ties included: department, name, total_pay and pay_rank (1 or 2). Sort by department, pay_rank, then name.Pattern: DENSE_RANK · PARTITION BY · COALESCEMediumPro
- Credit utilization bucketsReturn card_id, holder, utilization_pct (100 * balance / credit_limit, rounded to 1 decimal; NULL when the limit is NULL or 0) and bucket: 'no limit' when utilization_pct is NULL, 'low' under 30, 'moderate' from 30 to under 70, 'high' from 70 to under 100, and 'over limit' at 100 or more. Sort by card_id.Pattern: CASE · NULLIF · NULL-safe ratiosEasyPro
- Top 3 earners per departmentReturn department, name, salary and salary_rank (DENSE_RANK by salary, highest first, within each department) for everyone with salary_rank <= 3. Sort by department, salary_rank, name.Pattern: Window functions · DENSE_RANK()MediumFree
- Whales and their share of revenueCounting only purchases that weren't refunded, rank players by net_spend (highest first, ties share a rank, as with RANK) and return the players ranked 1 to 3: spend_rank, username, net_spend and revenue_share_pct (net_spend as a % of every player's combined net revenue, rounded to 1 decimal). Sort by spend_rank, then username.Pattern: RANK with ties · SUM() OVER () before filteringMediumPro
- Purchases over 3x the customer's averageReturn customer_id, purchase_id, amount and customer_avg (the customer's average amount over all their purchases, including this one, ROUND(..., 2)) for every purchase in fin_purchases that is more than 3 times its customer's average. Sort by customer_id, purchase_id.Pattern: Window AVG · compare a row with its own groupMediumPro
- Loan delinquency bucketsPut each loan in fin_loans in a bucket by days_past_due: 'current' (0, or NULL because no payment is due yet), '1-30', '31-60', '61-90' and '91+' (each range includes both ends). Return bucket, loans (number of loans) and total_balance (sum of balance) for each bucket, sorted from 'current' through '1-30', '31-60', '61-90' to '91+'.Pattern: CASE buckets · NULL handling · custom sortEasyPro
- Card approval rate by merchantFor merchants with at least 5 authorization attempts in fin_card_auths, return merchant, attempts (all attempts) and approval_rate (the percentage of attempts with status 'approved', ROUND(..., 1)). Sort by approval_rate descending, then merchant.Pattern: Conditional COUNT · HAVING · minimum volumeEasyPro
- Duplicate card chargesReturn account_id, merchant, amount, txn_date and copies for every charge that appears more than once. Sort by txn_date.Pattern: GROUP BY · HAVING to find duplicatesMediumPro
Tip: The online assessment is timed: practice getting a correct first version quickly, then refining.
Sources
- Interview Query: Capital One data analyst guide
- Glassdoor: Capital One interview review
- DataLemur: Capital One SQL interview questions
Capital One is a trademark of its owner, used here only to identify the company the reports are about.