Amazon Interview Question

Write an algorithm that calculates de median (and keep it constant) when random numbers are added.