I was given this problem in an interview. How would you have answered?
Design a data structure that offers the following operations in O(1) time:
Why don't we use epoch%arraysize to find random element. Finding array size is O(n) but amortized complexity will be O(1).