Practice Free
EasyFundamentals

Flagged High-Value Cross-Border Wire Transfers

Frequently Asked By:StripeCoinbaseBloomberg
Interactive In-Browser Workspace

Practice this problem on live schema tables in PostgreSQL 16 WASM with instant row verification and visual EXPLAIN plans.

Solve in Workbench

Problem Statement

Write a query to retrieve all cross-border wire transfers from `wire_transfers` where: - `amount_usd >= 10000.00` - `compliance_status = 'pending_review'` Return: 1. `transfer_id` 2. `sender_account_id` 3. `recipient_country` 4. `amount_usd` Order the results by `amount_usd` descending, then by `transfer_id` ascending.

Why Technical Interviewers Ask This

Anti-Money Laundering (AML) compliance mandates that all international wire transfers equal to or exceeding $10,000 destined for monitored jurisdictions or flagged with a status of 'pending_review' must be escalated for officer sign-off.

Common Pitfalls & Interview Traps

Forgetting required sorting and deterministic tie-breaking.
Not accounting for NULL or zero-value denominators during calculations.
Using inefficient quadratic subqueries instead of single-pass fundamentals constructs.

Canonical Modern SQL Solution

PostgreSQL 16 / ANSI SQL
SELECT 
        transfer_id,
        sender_account_id,
        recipient_country,
        amount_usd
      FROM wire_transfers
      WHERE amount_usd >= 10000.00
        AND compliance_status = 'pending_review'
      ORDER BY amount_usd DESC, transfer_id ASC;
Approach Breakdown
This query addresses the problem requirements by filtering and structuring data in Fundamentals. It meets the target criteria: High-value wire transfers pending compliance review sorted by amount descending.

Edge Cases to Verbally Clarify with Your Interviewer

The dataset contains zero matching records (must return valid empty result without crashing).
Multiple records tie on sorting criteria (must evaluate tie-breaking order deterministically).
Foreign keys or secondary attributes have NULL values.

Frequently Asked Follow-Up Questions

What makes this question a favorite among Stripe and Coinbase interviewers?

Interviewers use this problem to test whether candidates write defensive, scalable Fundamentals queries that run efficiently on multi-million row production databases without excessive memory usage.

How does the query optimizer execute this query?

Using single-pass table scans with index lookups or sort buffers. Running EXPLAIN (ANALYZE, BUFFERS) in the DB Exercises workbench visualizes the execution nodes and buffer hit cache.

More FAANG SQL Interview Questions

View all questions