MAQ Software interview question

Quick Sort and Simple for loop