Pocket Gems interview question

Phone interview: Sort colored balls