Codilar Technologies interview question

Pattern based, array swap two adjacent elements.