In the following challenge, you will be required to test and implement a processor that aggregates data efficiently.
The current implementation generates millions of trips across 100 hotels and 10000 drivers. You are required to calculate the top-rated driver and top-rated hotel. You are also required to test for this.
The test requires you to implement processors/interface.go
and processors/processor.go
.
You are also required to test the functioning of the processor by implementing main_test.go
- Running main.go prints out the top rated driver and hotel. Calculate the average rating by referring to Rating fields of the Trip struct.
- Running main_test.go (
go test
) validates that the processor calculates the above correctly. - Memory usage should be below 128mb. Extra points awarded for less usage.
- Modifying other parts of the code is allowed but ensure the basics of the challenge remain the same.
After completing the implementation, push it to github and share the link