Design an API for logistics company - Asked in Uber Product Management Interview
Make it harder? State 1 entity with 4 end-points. List an entity with request and response body.
Let’s take a poll first!
API design & usability question is asked frequently in fintech companies (Stripe, Adyen, Razorpay), logistics companies (Uber, FedEx), and platform products.
The interviewer asked to list two entities with 4 endpoints of each. Btw, do you know what entities are?
Entities are like primary resources/building blocks. They are categories of information that the API manages and manipulates.
Entities in a logistics company can be shipments, warehouses, inventory, pricing, etc. Each entity represents a distinct aspect of the logistics operations that the API can handle.
Shipment entity
Shipment is a package or a group of items being transported from one location to another. It includes details such as sender, receiver, items, delivery address, current status, and tracking information.
You might be thinking that Product Managers are not responsible for designing APIs, right? It’s the engineers’ responsibility! But that's not true, bro!
Product Managers should provide the detailed API specifications to engineers since PMs are the owners of the product, understanding customer requirements. They should genuinely be concerned with designing APIs and this practise is followed rigorously in companies like Google, Stripe, Meta, Microsoft etc.
Action 1 - Fetch details of all shipments
Method - GET
Action 2 - Fetch details of a particular shipment
Method - GET
If you don’t understand HTTP methods like (GET, PUT, and POST) or what endpoints or JSON is, I would recommend you to check my cohort on Tech for Product Managers. (Start your 2024 with a learning resolution)
Action 3 - Track details of a particular shipment
Method - GET
Action 4 - Create a shipment
Method - POST
This is how the response body would look like -
The server will typically create and return the shipment_id and tracking_number.
On a side note, I am doing a 3-week cohort on Tech for Product Managers where I will help you to crack the technical round of PM interviews and become a better PM at the job; do check it. Tada!