Welcome to the Python screen.
The question is on your right: Parse API JSON Response. Read through the requirements first.
Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?
Implement a function parse_api_response(status_code, payload) that processes an API response for a mobile client. The input is an integer HTTP-like status_code and a JSON string payload. If status_code is not 200, return an empty list. Otherwise, parse the JSON and return a list of model dictionaries from the rides array. Each returned model must contain only id, driver_name, and eta_minutes. Skip any ride object missing one of those fields or having invalid types.
rides, or may contain malformed ride objectsdef parse_api_response(status_code, payload):