Capsule interview question

Sort an array of objects based on a few different fields