HNR Tech interview question

Why and How to Secure API Endpoint?