Duco interview question

I was asked to code a debounce function