How would you implement a retry mechanism with exponential backoff?

Technical