CommScope Interview Question

Sorting write code for it and show