Snap interview question

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