Design an ad serving system with the following requirements: 1. Ad Query: Websites send queries to the system and receive ad IDs in response. The website then displays the corresponding advertisement. 2. Click Tracking: Websites send click events to the system when a user clicks on an ad, indicating which…