HSBC Interview Question

flow of a cursor programme