yoklainterview sim

Deep Learning ML Engineer Interview Questions

450 verified Deep Learning ML Engineer interview questions — solve with answers, learn from explanations, test yourself in a real simulation.

Try the real simulation →

Sample questions

Dl Architecture LayersDifficulty 1
A convolution layer holds 16 filters of size 3x3, uses stride 1 and padding 1, and receives a batch tensor shaped (1, 3, 32, 32) in NCHW order. What comes out?
  • a(1, 3, 32, 32), because a convolution rewrites the values in place but never changes how many channels come out.
  • b(1, 16, 30, 30), because a 3x3 window always trims one pixel off each border of the map it scans.
  • c(1, 16, 32, 32), since padding 1 offsets the 3x3 window and 16 filters set the channels.
  • d(1, 16, 16, 16), because every filter halves the spatial grid that it slides over.
Explanation:A 3x3 window at stride 1 shortens each spatial axis by two, and one pixel of padding on each side gives exactly that back, so height and width survive unchanged. The output channel count is decided only by how many filters the layer stores, and the batch axis is carried through untouched.
Dl Architecture LayersDifficulty 2
A 3x3 convolution maps 3 input channels to 16 output channels and keeps its bias term. How many learnable numbers does the layer store?
  • a432, because each of the 16 filters carries a 3x3 patch for all three input channels.
  • b448, since the sixteen 3x3x3 filters are stored alongside the layer's bias vector.
  • c160, because a single 3x3 kernel is learned once and then reused across the three input channels.
  • d480, because a separate bias is stored for every input-output channel pairing.
Explanation:One filter spans the full input depth, so it holds 333 = 27 weights; sixteen such filters give 432, and the bias vector stored beside them brings the layer to 448. Treating the kernel as a single 3x3 patch shared across the three input channels undercounts badly, because each filter learns its own patch for every channel it reads.
Dl Architecture LayersDifficulty 2
A 4x4 feature map holds a single non-zero response and is reduced by 2x2 max pooling at stride 2. The response is first moved from row 0 column 0 to row 1 column 1, and then from row 1 column 1 to row 1 column 2. What does the pooled 2x2 map do across the two moves?
  • aIt shifts by one output cell on each move, because a pooled map follows the response step for step.
  • bIt stays put on both moves, because a summary taken over a window cannot record where inside the frame the response sat.
  • cIt changes on the first move and stays put on the second, because a diagonal move crosses more windows than a sideways one.
  • dIt is unchanged by the first move and shifts by one cell on the second, because only the second move leaves the window.
Explanation:A 2x2 window at stride 2 covers rows 0 and 1 together with columns 0 and 1, so a response anywhere inside that block lands on the same single output cell. Moving to column 2 leaves the block for the neighbouring window, and the pooled map moves with it. That is the whole of the tolerance a pooling step buys: a shift smaller than a window is absorbed, a larger one is passed on.
Dl Architecture LayersDifficulty 2
In PyTorch 2.8 the layer nn.Conv2d(1, 1, kernel_size=3, dilation=2) with no padding is applied to a tensor of shape (1, 1, 32, 32). What spatial size comes out?
  • a28x28, because dilation stretches the 3x3 taps to cover a 5-wide span.
  • b30x30, because dilation changes which pixels are read but not how many windows fit.
  • c16x16, because a dilation of 2 samples every second position and halves the map.
  • d32x32, because the widened kernel is padded internally to keep the map intact.
Explanation:Dilation d turns a kernel of size k into an effective span of d(k-1) + 1, here 22 + 1 = 5, so the layer behaves like a 5x5 window for shape purposes and yields 32 - 4 = 28. The taps stay three in number, which is why the parameter count is unchanged even though the footprint grew.
Dl Architecture LayersDifficulty 2
A 2x2 max pooling layer with stride 2 and default settings receives a 7x7 feature map. A colleague reports that one row and one column of activations seem to vanish from the network. What is the output size, and why?
  • a4x4, because the pooling grid is rounded up so that no activation is left behind.
  • b3x3, because pooling always keeps the odd centre position and drops the two outer rings.
  • c3x3, since only three whole 2x2 windows fit and the leftover row and column are dropped.
  • d7x7, because pooling reduces the values inside each window without shrinking the grid.
Explanation:The default rule floors the division, so floor((7 - 2)/2) + 1 = 3 windows fit along each axis and the seventh row and column never form a complete window. Those activations are simply never read, which is why they appear to disappear; switching the layer to round up would add a partial window instead.
Dl Architecture LayersDifficulty 1
A block takes a (1, 512, 14, 14) activation and passes it through a convolution whose kernel is a single position wide and tall, producing 128 output channels. What shape leaves the block?
  • a(1, 128, 14, 14), because such a kernel touches one position at a time and only remixes channels.
  • b(1, 128, 12, 12), because even a kernel this narrow still consumes a border pixel on each of the four sides.
  • c(1, 512, 14, 14), because a kernel this small cannot alter the depth of the tensor.
  • d(1, 128, 1, 1), because the kernel collapses each map down to a single summary value.
Explanation:A kernel covering exactly one spatial position has nothing to slide over and no border to consume, so height and width pass through untouched. The output depth is set by how many filters the layer holds, which is the only axis this arrangement is able to change.

Test yourself against the 1500-question ML Engineer bank.

Start interview