Superhuman interview question

leetcode: get Random object O(1)