Deep Engineering

Interview preparation

Python

15 lessons in this track

  1. 1DecoratorsExpressions top-down, application bottom-upClearer after: Closures · *args and **kwargs45 MIN
  2. 2DescriptorsOne precedence rule that property, methods and slots all grow out ofClearer after: Decorators35 MIN
  3. 3Iterators and generatorsOne method apart, and one silent bug40 MIN
  4. 4Context managersTwo methods, one returned truth, and one silent data lossClearer after: Exceptions and finally40 MIN
  5. 5Exceptions and finallyThe one word that stops a function from failing30 MIN
  6. 6lambdaThe same thing as def except for two — and the famous loop bug is neither of them20 MIN
  7. 7async/awaitThe call runs nothing — and three bugs that never crash follow from thatClearer after: Iterators and generators · Exceptions and finally · Context managers40 MIN
  8. 8*args and **kwargsTwo stars with different prices — and one of them makes unknown names acceptable25 MIN
  9. 9List vs tupleThe 16 bytes you only get from one comparison out of three, and the two operations where there is no differenceClearer after: is versus ==40 MIN
  10. 10ComprehensionsThe scope boundary runs inside the square brackets, not around themClearer after: Iterators and generators · Closures35 MIN
  11. 11Closures capture the variable, not the value — and the scope chain walks past the class bodyClearer after: lambda35 MIN
  12. 12CopyingAssignment copies nothing, copy copies one level, deepcopy copies the whole graphClearer after: is versus == · List vs tuple25 MIN
  13. 13is versus ==One asks about identity, the other calls a method — and half the famous surprises are about neither25 MIN
  14. 14MetaclassesThe six steps of class creation, which show what a metaclass is for and what no longer needs oneClearer after: Descriptors · Decorators25 MIN
  15. 15Default argumentsMutable default arguments: the value lives in a field of the function, and every call shares it25 MIN

Final check: the Python track

Fifteen questions across the whole track — one per lesson. Not a recap, but the places where the mechanism gives an answer nobody expects.

Final check1 / 15

Two decorators with arguments sit one above the other. In what order does the code run?