Your question is Troubleshooting API Issues Step by Step. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
What are APIs and how would you fix different types of API issues, step by step?
Implement diagnose_api_issues(records, timeout_ms). Each record is a dictionary containing status, latency_ms, auth_valid, and body_valid. Return one dictionary per record with an issue category and an ordered list of remediation steps. Apply rules in this order: authentication, rate limiting, server failure, client failure, invalid response, timeout, then success. Each record must produce exactly one result.
def diagnose_api_issues(records, timeout_ms):