Implement stream random sampling in Python | LinkedIn Interview Question