a guest Sep 21st, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- Dear Candidate,
- We need your help finalising two of our services which is really important for us. The service is called Aggregator and it joins together information about orders from Order service, Offer Service, Product service and Image Service.
- It works as follows:
- - The Aggregator uses sellerId to retrieve OrderId, OfferId, and ProductId from the Order Service.
- - Then it uses the OfferId and ProductId to retrieve information from Offer service and Product service respectively
- - Then it uses the product title, from the Product Service, to retrieve a list of images from the ImageService.
- - The Aggregator uses the information retrieved from the Order Service, Offer Service, Product Service and Image Service and returns an EnrichedOrder.
- Image Service:
- - Unfortunately the team could not finish the Image Service in time :( We need your help to implement it. The specifications are as follows:
- There is an interface named ImageService defined for the service. You should implement the interface.
- There is a JSON file in the resources directory containing all the images necessary to initial load the ImageService. Your implementation should load such images from the file.
- Since you are a new team member, you should prove to us that your ImageService implementation is *correct*.
- Since the new ImageService is used in the AggregatorService, you should improve the existing unit tests and also integrate the ImageService without breaking the existing ones.
- - Every service can fail. The following guidelines for failures are :
- - If Order service fails, throw an exception, because we cannot fetch any data from Product or Offer service
- - If Order service succeeds and Offer Service succeeds but Product service fails, we return an EnrichedOrder with Info from Order service and Offer service; Product id is -1 and product title is null
- - If Order service succeeds and Product service succeeds but Offer service fails, we return EnrichedOrder with Info from Order service and Product service; Offer id is -1 and Offer condition is UNKNOWN
- - If Order service succeeds but Product service and Offer Service fails, we return an EnrichedOrder with info from Order service only; Offer id is -1 and Offer condition is UNKNOWN. Product id is -1 and product title is null
- - If Order service, Product service and Offer service all succeeds, we return an EnrichedOrder with info from Order service, Offer Service and Product service
- The team that was working on this service already wrote all the unit test for Aggregator service and implemented Order, Offer and Product services
- However, they haven't gotten around to implementing the Aggregator service itself, though. Can you please help them by implementing it?
- Important: your application should be self-contained, no installation required.
- - Make a REST API out of the aggregator and the other services
- - Make a consumer for the REST API
- - Introduce a new technology: database, indexing, front-end, etc
- - Containerize your application
- - Whatever you love
RAW Paste Data