Travelers Interview Question

how to sample data (any programming language)