Amazon SDE# interview - Low Level Design

Design a chain of pharmacy stores.

  1. If a medicine is not available in Area pharmacy centre, we check in Additional pharmacy centre.
  2. If it is not present there, we check in Main pharmacy centre.

My solution :
Use Chain of Responsibilty pattern. Create a chain of pharmacy stores. Each pharmacy store checks whether the medicine is present in it or not. If it is present, it returns the medicine. Else, it forwards the requests to the next centre in the chain.
I gave the above solution but I could not clear this round. It looked like the interviewer was looking for something else.

Comments (0)