Flag Accounts Exceeding Daily ATM Withdrawal Limit by Tier

Last updated: November 29, 2026

Quick Overview

Given an ATM withdrawals table and an accounts table that stores each account's tier, and a limits table mapping tier to a daily cash limit in EUR, return every account and calendar day where total withdrawals exceeded the limit, with the amount over.

Deutsche Bank
Data Manipulation (SQL/Python)
Data Engineer
Deutsche Bank
November 29, 2026
Data Engineer
Technical Screen
Data Manipulation (SQL/Python)
Easy

0

0

0 solved


Given an ATM withdrawals table and an accounts table that stores each account's tier, and a limits table mapping tier to a daily cash limit in EUR, return every account and calendar day where total withdrawals exceeded the limit, with the amount over.

Private Bank and Postbank retail data teams build daily controls feeds for operations and fraud teams. A technical screen for a data engineer uses a join plus aggregation like this to check SQL fluency, date handling and attention to currency and time zone details that matter in banking data.

What the Interviewer Expects
  • Join withdrawals to accounts and limits correctly
  • Aggregate per account per calendar day
  • Filter with HAVING rather than WHERE on the aggregate
  • Handle declined or reversed transactions
  • Mention the time zone used to define a day
Key Topics to Cover
GROUP BY and HAVING
Joins
Date truncation
Data quality
Banking controls
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you change the query to use a rolling 24-hour window instead of a calendar day?
  • Withdrawals abroad are stored in local currency: how do you convert them?
  • How would you make this run incrementally each night on a very large table?
  • How would you test that the control does not miss breaches?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

Assume:

  • atm_withdrawals(txn_id, account_id, txn_ts_utc, amount_eur, status) where status is APPROVED, DECLINED or REVERSED.
  • accounts(account_id, tier).
  • tier_limits(tier, daily_limit_eur). ...
Approach

Filter to approved withdrawals, convert the timestamp to local date, sum per account and date, join to the tier's limit, and keep groups whose total is over the limit. Using HAVING keeps the logic in ...


Submit Your Answer
Markdown supported

Related Questions