8questions
BeginnerTypeScript
8 subjects
3 easy4 medium1 hard
Why should a new project turn on `strict`, and what does it actually change?
Start practising5 easy15 medium3 hard
// 23 of 23 questions · 23 subjects
Why is `def add(item, items=[])` a bug, and what is the idiomatic fix?
easyFunctionsMutability
mediumcollectionsheapq
What is wrong with `except Exception: pass`, and how should you catch errors instead?
mediumExceptionsEAFP
What does `if __name__ == "__main__":` protect against, and why do circular imports fail?
mediumImportsPackages
Why do all these lambdas return the same value?
mediumClosuresLate binding
How do you set up dependency management so that every machine installs the same versions?
mediumVirtual environmentsuv
Write a decorator that times a function, and explain why `functools.wraps` matters.
hardDecoratorsfunctools
Why does iterating over the same object a second time give nothing?
mediumIterator protocolGenerators
mediumre moduleValidation
Why do objects you put in a set disappear or duplicate after you define `__eq__`?
mediumClassesData model
When should you not use a list comprehension?
easyComprehensionsReadability
How do generators let you process a file far larger than memory?
mediumGeneratorsMemory
How would you write your own context manager, and what guarantees does it give?
mediumwith statementcontextlib
How do you choose between Django, Flask and FastAPI for a new web project?
mediumDjangoFastAPI
What makes a good docstring, and how do you turn docstrings into a documentation site?
easyDocstringsSphinx
Why should you always pass `encoding` to `open()`, and what else goes wrong with file handling?
mediumEncodingpathlib
Why does your `unittest.mock.patch` have no effect, and how do pytest fixtures help structure tests?
mediumpytestMocking
8questions
Beginner8 subjects
3 easy4 medium1 hard
Why should a new project turn on `strict`, and what does it actually change?
Start practising20questions
Beginner20 subjects
5 easy10 medium5 hard
The same JavaScript file runs in Chrome but crashes in Node with "document is not defined". What is the language, and what does the runtime add?
Start practising22questions
Beginner22 subjects
8 easy11 medium3 hard
What makes a coding agent different from autocomplete or a chat window, and what does that change about how you review its work?
Start practising