RE Partners interview question

First tech interview: general discussion over frameworks, Java Core. City’s interview: hascode/equals, Java collection, concurrent modifucation, Java concurrency(race condition, volatile, join()), SOLID, live-coding task: given an array of integers, provide a method which discover a sequencies in the array and returns an array of string showing those ranges. Example: [5,6,7, 1,2, 42, 28] -> [„5-7”, „1-2”, „42”, „28”]