The Python interviewers expect: data model, comprehensions, generators, typing and the standard library.
Write an async function double_later(x) that does await asyncio.sleep(0) (a no-op await, just to make it a real coroutine
that yields control) and then returns x * 2. Then write
entryPoint(numbers) that runs double_later concurrently for every
What does defining a function with async def actually create? If you
write result = my_coro_func() but never await it, what happens (or
does not happen), and what does await do at the point it appears in
the code?
Write a class Point with __init__(self, x, y), a dunder method
__eq__ that treats two points as equal when their x and y match,
and a dunder method __add__ that returns a new Point whose
coordinates are the sums. Then write entryPoint(a, b), where a and
Write a dataclass Cart with one field, items, defaulting to an
empty list via field(default_factory=list), and a method
add(self, name, price) that appends (name, price) to items. Then
write entryPoint(order_batches), where order_batches is a list of
Write a class Version whose __init__ parses a string like
"1.4.2" into integer major, minor and patch attributes, and
that implements __eq__ and __lt__ by comparing the (major, minor, patch) tuples, plus a __str__ that rebuilds the original
Explain the difference between a class attribute and an instance attribute in Python. What goes wrong if a class attribute is a mutable object such as a list, and how do you avoid the problem?