Getting Started:
- Run "docker-compose build" to initialise the container.
- Run "docker-compose up" to start the service in the container.
Unit Tests:
- Run pytest to execute the unit tests
- Tests were created using TDD to test the smallest units of code in terms of functionality and error handling.
Comments:
- I prefer to use meaningful names for classes, functions and variables instead of expansive comments. Always open for debate :).
Time Allocation:
- Investigate and read up on Nameko - 2 Hours
- Read up on TDD in python - 1 hour
- Read up on error handling in python - 1 hour
- Read up on Map-reduce in python - 30 minutes
- Read up on Docker - 1 hour
- Planning and design - 1 hour
- Function 1 - 1 hour
- Function 2 - 3 hours
- Function 3 - 1 hour
Challenges experienced
- Experienced issues transporting the huffman encoded bytes over the wire. I used base 64 encoding to overcome this. The function that decodes a huffman encoded string expects a base 64 encoded input to overcome the same issue.
Frameworks:
- I enjoyed using the Nameko framework. There's no boiler plate which makes it easy to concentrate on the logic. It makes setting up the microservices and distributed architecture simple. It also makes continuous integration and deployment easy. The different transport protocols(HTTP, RTC and event processing) makes it versatile. I will definately be using this framework going forward. The documentation is a bit high level however with google anything is possible.
Service:
- The service is called "learning_challenge_service"
- Functions available via RPC: square_odd_numbers_in_list, convert_string_list_to_encoded_dictionary and decode_string.