Whenever you're ready, walk me through how you'd approach this.
What are the time complexities of common sorting algorithms such as bubble sort, insertion sort, merge sort, quicksort, and heapsort? Also explain their typical space usage and when one is preferred over another.