Databricks Interview Question

Write the code to find the median of an array in expected constant time. Now do it assuming the array is distributed across many machines.