Languages & Frameworks

Python

6 practice questions. Free questions open a full answer guide; the rest unlock with Pro.

  • What is Python's Global Interpreter Lock, and how does it shape the way you parallelize work in Python? Mid level
  • What's the difference between a list comprehension and a generator expression in Python, and when would you choose a generator?Go Pro Junior level
  • What's the difference between returning a list and returning a generator in Python, and when would you reach for a generator?Go Pro Mid level
  • What does Python's `with` statement (a context manager) do, and why use it instead of manually opening and closing a resource like a file or a lock?Go Pro Junior level
  • What's the difference between a list and a tuple in Python, and when would you reach for one over the other?Go Pro Intern level
  • In Python, what happens if you use a mutable object like a list as a default argument value, and how do you avoid the bug it causes?Go Pro Intern level
Want questions matched to your role? Paste a job title, job description, or CV for a personalized set, or go Pro to unlock the full bank.