How Far Back It Can See

Easy data structure and algorithm practice puzzle.

Each layer of a convolutional network sees a little further than the one below it. A layer with kernel size k and dilation d adds (k - 1) * d to the reach. Given the kernel sizes and dilations of a stack of layers, return the receptive field: how many input positions one output can depend on. A single position already sees itself, so the count starts at 1. Doubling the dilation at every layer makes the reach grow exponentially.

Solve it three ways: snap the jigsaw pieces together, fill in the blanks, or type it from scratch against the tests. This one is free to play, with no account.

Every line of the solution comes with a note explaining why it is there, and a step by step replay shows the code running. At level 3, where you type it yourself, you can ask for an AI mock interview on this problem that ends with a hiring manager's scorecard.

Then grow it into a real project with the Software Engineer button: this puzzle becomes the Sample Growth Model, a pipeline you can run and download. See every Software Engineer project.

More Deep Learning puzzles

All 27 Deep Learning practice problems

Browse all 676 puzzles