Cybage Software interview question

Write a code for to handle different taps