tezvyn:

Walk me through a CNN's layers for image classification

AI-drafted, machine-checkedSource: Wikipedia: Convolutional neural networkintermediate

Tests hierarchical feature extraction in CNNs. Answer: conv filters learn edges-to-objects with shared weights, pooling reduces dimensions and adds invariance, fully-connected layers classify.

WHAT THIS TESTS: This question probes whether you understand the architectural inductive biases that make CNNs effective for images, specifically local connectivity, parameter sharing, and hierarchical feature composition. Interviewers want to see that you can explain why each layer type exists rather than simply naming them.

A GOOD ANSWER COVERS: First, convolutional layers apply small learnable filters across the input image using shared weights, which detects local features such as edges, corners, and color blobs while preserving spatial relationships; this parameter sharing dramatically reduces the number of weights compared to a fully-connected network. Second, pooling layers, typically max pooling or average pooling, downsample the spatial dimensions of feature maps to reduce computational load, control overfitting, and introduce translation invariance so that small shifts in the input do not change the output. Third, after several conv-pool blocks, the final feature maps are flattened and fed into one or more fully-connected layers that learn non-linear combinations of the high-level features and output class scores or probabilities, often via a softmax activation. A strong candidate also notes that modern CNNs stack many conv-pool stages so that early layers capture low-level patterns and deeper layers capture complex objects.

COMMON WRONG ANSWERS: A red flag is describing convolution as just another matrix operation without mentioning that the same filter slides across the image and reuses parameters. Another mistake is claiming that pooling layers learn parameters; they do not, they perform fixed downsampling. Some candidates also forget to explain the transition from spatial feature maps to a flat vector before the fully-connected layers, or they conflate the number of filters with the spatial size of the feature map.

LIKELY FOLLOW-UPS: Expect the interviewer to ask how the number of filters affects model capacity, why we use small 3 by 3 filters instead of large ones, or what happens if you remove pooling entirely. They may also ask about modern replacements such as strided convolutions, global average pooling, or how batch normalization fits into the stack.

ONE CONCRETE EXAMPLE: In a classic VGG-style pipeline for a 224 by 224 RGB image, the first convolutional layer might use 64 filters of size 3 by 3 to produce a feature map of 224 by 224 by 64. A 2 by 2 max pooling layer halves height and width to 112 by 112 while keeping 64 channels. After three more conv-pool blocks the spatial dimensions shrink to 14 by 14 with 512 channels; this volume is flattened into a 100352-element vector and passed to fully-connected layers that output 1000 class probabilities.

Read the original → en.wikipedia.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.