REST vs GraphQL vs gRPC: how to choose
You've now met three styles of API. Interviewers rarely ask which one is best. They ask which one you'd use here, and why. The answer depends on who sits on each side of a line in your diagram, and most real systems use two or three of them at once.
Buses, taxis and freight trains
A city moves people and goods in different ways. A bus runs fixed routes that anyone can ride without arranging anything; the routes are public and the stops are shared. A taxi makes exactly the stops on your list in one trip, but the driver works out the route each time, and the company has to refuse passengers who want absurd detours. A freight train between two factories moves the most goods at the lowest cost per tonne, but only once both ends have laid track to the same gauge, and you can't hail one from the street.