Compute the median of a given list. Optimize your code for long lists.
Write a function that takes a list of numbers and returns the median value. For even-length lists, return the average of the two middle elements. Optimize for large lists by considering in-place sorting vs. selection algorithms (e.g., quickselect for O(n) average). From 60-minute technical phone round.