Design and implement a REST based service discovery system. The system should support REST based registration and lookup. This is meant for service discovery in cloud environment. There could be multiple instances of services that need to register itself so that they can be discovered by other applications . Application will query by specifying service name and expect an IP address in return. Service discovery server should round robin between multiple IP addresses registered against a given domain/service name. e.g there are two instances of service running at IP address IP1 and IP2. Both of these instances register themselves as service "Service-1". When an application lookups for "Service-1" then it gets either IP1 or IP2 (round robin). Note that instance only knows about itself and can only register its own IP address against a service name. Bonus: Set TTL for registrations.
Time: 2hrs.
Deliverables are working code (should compile and run).
Automated tests are expected.
Implementation can be in Java/C#/NodeJS/GoLang.