Python Interview Guide

Useful Functions

  • itertools - chain, permutation, combinations, product
  • functools - lru_cache
  • collections - deque, defaultdict, OrderedDict, Counter
  • heap - heapify

Tricks

  • float(“inf”) - largest floating point number
  • inbuilt iter function iterates through the list and forgets the previous elements when used in conditionals