Jane Street Interview Question

One problem with cupcakes and one with 2 queues.