The Bank Account Summary interview question is a SQL task. You are typically given a Users table and a Transactions table. You need to calculate the current balance for each user by adding all their incoming transfers and subtracting their outgoing transfers from their initial balance. This Bank Account Summary coding problem is a test of data consolidation across multiple transaction types.
Fintech companies and firms like Optum use this to test a candidate's ability to use UNION ALL or CASE statements to handle debits and credits. It evaluates your skill in joining tables and performing multi-step aggregations to reach a final balance.
This follows the Database interview pattern of "Consolidate and Aggregate."
User 1: Initial Balance 100. Trans 1: User 1 sends 30 to User 2. Trans 2: User 3 sends 50 to User 1.
Master the use of COALESCE and IFNULL when performing arithmetic on columns that might have missing data. Also, practice using UNION ALL to combine "sender" and "receiver" rows into a single list of changes before aggregating.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Active Businesses | Medium | Solve | |
| Active Users | Medium | Solve | |
| Activity Participants | Medium | Solve | |
| All People Report to the Given Manager | Medium | Solve | |
| All the Pairs With the Maximum Number of Common Followers | Medium | Solve |