Snap Interview Question

How to sort a list of object based on two attributes.