Build a Minimal Full-Stack Application for Monetary Transactions
Objective
Implement a minimal full-stack web application that supports basic monetary transactions and account balances.
Requirements
Backend API
Expose a REST or GraphQL API (candidate's choice) with the following functionalities:
- Create new accounts.
- Create transactions (credit or debit) against an existing account.
- Retrieve details for accounts and their associated transactions.
Data Persistence
An in-memory store or a lightweight database solution is acceptable.
Frontend
A simple web page that allows users to:
- Create a new account.
- Submit either a credit or a debit transaction.
- View the current balance and a list of recent transactions for an account.
Validation and Rules
- All inputs must be validated (e.g., non-negative amounts with up to two decimal places, all required fields present).
- Debits that would result in a negative account balance must be rejected.
Tests
Include basic automated tests covering both successful operations (happy paths) and expected error conditions.
Developer Experience
Provide clear setup instructions and a concise README file.
Deliverables
- Complete source code for both the backend and frontend components.
- Automated tests and instructions on how to execute them.
- A README file detailing how to run the application, an API summary, and any key assumptions made during development.
Notes
- Prioritize correctness and clarity of implementation over extensive feature breadth.
- Precise handling of monetary values is crucial; avoid floating-point arithmetic errors.
- The user interface should be minimal; focus on core functionality rather than elaborate styling.
AI interview prep
Core dilemma
Ensuring transactional atomicity and correctness (especially preventing negative balances and handling concurrency) in a financial system, even at a small scale, while maintaining a clear, testable, and maintainable codebase.
3 tradeoffs and 2 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Build a Minimal Full-Stack Application for Monetary Transactions
Objective
Implement a minimal full-stack web application that supports basic monetary transactions and account balances.
Requirements
Backend API
Expose a REST or GraphQL API (candidate's choice) with the following functionalities:
- Create new accounts.
- Create transactions (credit or debit) against an existing account.
- Retrieve details for accounts and their associated transactions.
Data Persistence
An in-memory store or a lightweight database solution is acceptable.
Frontend
A simple web page that allows users to:
- Create a new account.
- Submit either a credit or a debit transaction.
- View the current balance and a list of recent transactions for an account.
Validation and Rules
- All inputs must be validated (e.g., non-negative amounts with up to two decimal places, all required fields present).
- Debits that would result in a negative account balance must be rejected.
Tests
Include basic automated tests covering both successful operations (happy paths) and expected error conditions.
Developer Experience
Provide clear setup instructions and a concise README file.
Deliverables
- Complete source code for both the backend and frontend components.
- Automated tests and instructions on how to execute them.
- A README file detailing how to run the application, an API summary, and any key assumptions made during development.
Notes
- Prioritize correctness and clarity of implementation over extensive feature breadth.
- Precise handling of monetary values is crucial; avoid floating-point arithmetic errors.
- The user interface should be minimal; focus on core functionality rather than elaborate styling.