simplesurance-go-challenge
This is my solution on the test you assigned to me. The code contains:
- main.go file: the entry point of the application.
- counter package: for the Counter model.
- stress-test folder: contains a test case of 5 simultaneous calls to the endpoint.
This task took me between 2-3 hours.
I want to deliver the best solution, I began with:\
- An in-memory persist solution: It was very straight forward.
- I tried to enhance that by adding a simplified version of a semaphore.
- Although I thought about implementing a FIFO queue, but It's almost the same as what I implemented with more code (adding enqueue & dequeue methods).
I hope you find my suggested solution to be satisfactory.
Eagerly awaiting your feedback.
Thank you!