Rubixe interview question

Which algo will be used for grouping data pattern?