Pergunta de entrevista da empresa Apple

Insert a country name in Alphabetical order (not using in-build string functions)---> optimized solution and choose a data structure Swap even and odd bits What is priority inversion, and how do you solve it? Whats memory leak, segmentation fault?