Interswitch Interview Question

Basically how to query data in R