This question evaluates skills in detecting temporal recurrence patterns in transaction data, including time-series analysis, date arithmetic, grouping by merchant and currency, and tolerance handling for amounts and date jitter.
You are given a list of credit/debit card transactions. Each transaction has:
transaction_date
(YYYY-MM-DD)
merchant
(string)
amount
(decimal, positive)
currency
(string, e.g.,
USD
)
Many transactions are one-off (e.g., small public transit fares), while some are recurring subscriptions/bills (e.g., Netflix).
Identify recurring transactions and print a summary line per detected recurring pattern, in the form:
merchant, <amount> per <period>
Example output:
Netflix, $30 per month
GymCo, $12.99 per week
(merchant, currency)
as separate streams unless you explicitly design conversion).
Input (abridged):
Expected output includes something like:
Netflix, $30.00 per month
Explain your approach and the time/space complexity.