linkedin Skip to Main Content
Just announced: We now support interviewing in spreadsheets!
Back to blog

Code Challenge: Python Random List

Coding Challenges

In this tiny interview, the generate_random_list function works as expected, but it’s very slow on large test cases. Can you figure out what’s wrong and fix it without changing its statistical distribution?

Your task for this code challenge is to improve the generate_random_list function in the sandbox below to run faster than 100ms for both tests.

More resources

We have made available these extra resources to improve your Python coding skills:

Want to conduct interviews on this platform?

Check out CoderPad : pick any interview question or create your own, then invite your candidate to a shared live-coding session on an IDE like this one. You even get 2 free interviews per month forever using this registration link!