Springer Nature Interview Question

Any sorting technique.