External sort. Test task for interview