Barclays interview question

Implement debounce and throtle with their usage