Quinbay interview question

Reverse a LinkedIn list Query using group by 3 triangle puzzle