Optiver Interview Question

Design an algorithm to sort UDP packets