Day 43 of 133

CNN basics: conv, pool, receptive field + DSA Heap

Compute output shapes. Receptive field of stacked 3×3 vs one 7×7.

DSA · NeetCode Heap / Priority Queue

  • Design TwitterDSA · Heap / Priority Queue

    Interview questions to prep

    1. Why is a heap the right structure? Could a balanced BST or sorted list work — why is heap better?
    2. Explain the heap-of-k pattern: keep size k, push new, pop if over k. What's the resulting complexity?
    3. What does the comparator look like, and how would you tweak it to flip min/max behaviour?
  • Find Median From Data StreamDSA · Heap / Priority Queue

    Interview questions to prep

    1. Walk through the two-heaps trick (max-heap left, min-heap right). What invariant ties them?
    2. What's the space cost over a long-running stream, and how would you bound it (windowed median)?

DL · CNN basics

  • Interview questions to prep

    1. Walk me through how a conv layer works step by step.
    2. Compute the output shape of a 3×3 conv with stride 2 and padding 1 on a 32×32 input.
    3. What is dilation and where would you use it?
  • Pooling, receptive fieldDeep LearningDistill

    Interview questions to prep

    1. What is the receptive field of a stack of 3 3×3 convs vs one 7×7 conv?
    2. Compare max pooling vs average pooling vs strided convolution — when does each fit?
    3. How would you implement a function that computes receptive field, jump, and start offset across conv/pool layers?
  • Interview questions to prep

    1. Why are CNNs called translation-equivariant rather than translation-invariant?
    2. Where does global pooling at the end of a CNN buy you (approximate) translation invariance?

References & further reading