Design and implement a RESTful API (including data model and the backing implementation) for money transfers between accounts.
Explicit requirements:
-
You can use Java or Kotlin.
-
Keep it simple and to the point (e.g. no need to implement any authentication).
-
Assume the API is invoked by multiple systems and services on behalf of end users.
-
You can use frameworks/libraries if you like (except Spring), but don’t forget about requirement #2 and keep it simple and avoid heavy frameworks.
-
The datastore should run in-memory for the sake of this test.
-
The final result should be executable as a standalone program (should not require a pre-installed container/server).
-
Demonstrate with tests that the API works as expected.
Implicit requirements:
-
The code produced by you is expected to be of high quality.
-
There are no detailed requirements, use common sense.
-
Used UK bank accounts (sort code, account number)
-
Ignored validations of bank account number and sort code
-
Ignored the currency conversions
-
Kept it simple and just return 500 when payment fails. But the correct way is to return appropriate http status code based on the error
The app can be run on java 11 and below versions. Also, please note that there are warnings when the app starts up due to minor issue with version of jackson module being used. I choose to ignore the warnings for this test.
Build and run the project by using the below commands.
cd /<project_directory>
mvn clean package
cd target/
java -jar transfer-service-1.0-SNAPSHOT.jar
-
Out-of-the-box support for configuration, application metrics, logging and much more
-
Develops high-performance RESTful web services
-
Supports JSR 303: Bean Validation using Hibernate validator
-
Quick and easy to learn