Publicis Sapient interview question

Sorting in array interface class object why we use