Python interview questions for data analysts

Implement small Python functions for analyst interview problems. Read the function signature and input/output examples, then open the exercise to run Python in a free browser workspace with hidden tests. Some questions ask you to repair a colleague’s function.

10 questions · Easy to hard · Python in your browser

Easy Python questions

Medium Python questions

Hard Python questions

How to practice for your interview

  1. Start with an easy question. Restate the inputs and output, then work through the example by hand.
  2. Move to medium questions for intervals, hash maps and moving windows. Describe a simple solution before improving its time or space cost.
  3. Try the remaining questions and functions to fix. Explain the invariant your loop or search maintains, then test its boundaries.

Check more than the sample

Test empty input when allowed, a single element, repeated values and an answer at either end. Passing the example is a start; the workspace also checks unseen cases.

More interview practice

All interview questions