top of page

Hash-Bank

Project Overview Transaction Processing and Management System

This project implements a comprehensive banking simulation system that manages user accounts, processes financial transactions with temporal constraints, and provides sophisticated querying capabilities. The system handles real-world banking complexities including authentication, fraud detection, fee calculations with loyalty discounts, and multi-day transaction scheduling with precise timestamp ordering.

Technical Architecture

The system employs a priority queue-based transaction scheduler that processes pending transactions in chronological order, ensuring temporal consistency throughout the simulation. User authentication is handled through IP-based session management, where each user can maintain multiple simultaneous login sessions from different IP addresses. The architecture separates the command processing phase from the query phase using a delimiter ("$$$"), allowing all pending transactions to execute before analytical queries run.

Core System Components

User Management: Implements secure authentication with PIN verification and tracks registration timestamps for each account. The system validates that transactions can only execute after both sender and recipient have registered, preventing temporal paradoxes in the transaction history. Balance tracking accounts for both outgoing and incoming transactions with associated fee structures.
Transaction Processing: Uses a min-heap priority queue to efficiently schedule and execute transactions based on execution timestamps, with transaction ID as a tiebreaker for deterministic ordering. The system enforces a three-day maximum scheduling window, calculates dynamic fees (1% of transaction amount, clamped between $10-$450), and applies a 25% loyalty discount for customers registered over five years. Shared fee transactions split costs between sender and recipient, with special handling for odd-numbered fees to ensure cent-perfect accounting.
Query Engine: Provides four distinct analytical queries: list transactions within time ranges, calculate bank revenue over arbitrary intervals with human-readable duration formatting, generate comprehensive customer history reports showing the last 10 incoming and outgoing transactions, and produce daily transaction summaries. All queries operate on completed transactions only, maintaining clear separation between pending and executed states.ical constraints. The algorithm efficiently determines when an MST is impossible (when both Canadian and American vertices exist without any border vertices).

Performance & Design Considerations

The implementation uses efficient data structures including hash maps for O(1) user lookups, unordered sets for IP validation, and vectors for transaction history tracking. Timestamp manipulation is optimized by converting the "yy:mm:dd:hh:mm:ss" format into compact uint64_t integers for fast comparisons. The system includes comprehensive error handling for insufficient funds, fraudulent access attempts, invalid timestamps, and malformed commands, with optional verbose mode for detailed operational logging. Memory management carefully tracks all allocated transactions for proper cleanup on system termination.

Maeve Mullen

(312) 343 - 7550
mmaeve@umich.edu

bottom of page