My round for Warner music is on 21th Nov. They are provided the pre-read for coding using all AI Tools. There is pdf that they have provided.
Context
WMG distributes music to partners like Spotify via the concept of an Order, which represents an individual song. These Orders are delivered to partners in the form of Metadata (XML) and Assets (audio WAV, coverart TIFF, etc) files.
What You Need to Do
You will build an “Artifact Generation” client that ingests Orders from a queue, orchestrates the production of Metadata and Assets, along with their respective AssetDetails, and publishes the results for further processing. This happens via a series of JSON APIs, implemented in a testserver binary that you have been / will be provided. These APIs may not always reliable, and your client must handle failure correctly.
Generally speaking, for each Order, you will:
- take an Order from the queue
- queue Asset generation
- wait till it finishes, and then get Asset and AssetDetail data
- queue Metadata generation
- wait till it finishes, and then get Metadata data
- bundle all the data together and submit it as a ShippableOrder
Data Model
The relationship between Orders, Assets, AssetDetails and Metadata is as follows:
- An Order has 1:many Assets => An Asset belongs to a single Order
- An Order has 1 Metadata => A Metadata belongs to a single Order
- An Asset has 1 AssetDetail => An AssetDetail belongs to a single Asset
Orchestration Requirements
Specifically, there are some rules you must follow while processing each Order, as listed below:
- You must "take" an Order from the queue before doing anything else with it
- You must finish Asset generation before triggering any Metadata generation
- You must not trigger Metadata generation if Asset generation failed
- If Asset generation fails:
● You must submit a FailedOrder without Asset/AssetDetail or Metadata data
- If Metadata generation fails:
● You must submit a FailedOrder with Asset/AssetDetail data but without Metadata data
- If both Asset and Metadata generation succeed:
● You must submit a ShippableOrder with both the Asset/AssetDetail data and Metadata data
Tips
- There are no dependencies between Orders; the status/processing of one Order does not impact any other Order
- If you break the state machine by failing to follow the above orchestration rules, you cannot recover it
- If you submit an Order incorrectly (incorrect data/status), you cannot recover it