К обычному разбору
Тренировка по собеседованиюТехническое собеседованиеNavio2025-08-06

Navio: Техническое собеседование

Идите сверху вниз: сначала попробуйте сами, затем откройте разбор. Если шаг с кодом, пишите решение прямо здесь и запускайте проверки на странице.

Шагов
5
Вопросов
5
Задач
0
1Вопрос7 мин

Dropout при обучении и выводе модели

Как dropout ведёт себя при обучении и при выводе модели? Зачем требуется масштабирование и что называют inverted dropout?

Ответьте без подсказки

Сначала проговорите ответ вслух или тезисами.

Запишите черновик

Формулы, план решения, риски и примеры.

Сравните с разбором

Откройте разбор только после своей попытки.

Короткий ответ

Во время обучения dropout случайно обнуляет часть активаций, а при выводе модели отключается. Масштабирование сохраняет одинаковое математическое ожидание величины активаций в обоих режимах.

Подробный разбор

Dropout — способ регуляризации, применяемый во время обучения. На каждом прямом проходе он независимо обнуляет долю p активаций. Благодаря этому модель не может постоянно опираться на один и тот же набор нейронов и ведёт себя как ансамбль множества подсетей.

При выводе модели dropout отключают: предсказания должны быть детерминированными и использовать всю сеть. Без масштабирования ожидаемая величина активаций различалась бы при обучении и при выводе. В распространённом варианте inverted dropout сохранённые активации во время обучения делят на 1 - p. Поэтому при выводе дополнительное умножение уже не требуется.

В другой конвенции активации при обучении не масштабируют, а при выводе умножают на 1 - p. На собеседовании важнее объяснить совпадение математических ожиданий, чем запомнить одну конкретную конвенцию.

Типичные ошибки

  • Говорить, что при обычном выводе модели dropout продолжает случайно отключать нейроны.
  • Забывать объяснить, зачем требуется масштабирование.
  • Путать вероятность отключения p с вероятностью сохранения 1 - p.

Как сказать на собеседовании

  • Сначала отдельно опишите поведение при обучении и при выводе модели.
  • Если спрашивают про PyTorch, назовите inverted dropout и коэффициент 1 / (1 - p).
2Вопрос10 мин

Вопрос по метрикам

A binary image classifier is trained with BCE loss. On validation, accuracy rises but BCE loss also rises. Can this happen and what are plausible causes?

Ответьте без подсказки

Сначала проговорите ответ вслух или тезисами.

Запишите черновик

Формулы, план решения, риски и примеры.

Сравните с разбором

Откройте разбор только после своей попытки.

Короткий ответ

Yes. Accuracy only checks the thresholded class, while BCE also penalizes confidence. A few confidently wrong examples can increase loss while more examples cross the threshold correctly.

Подробный разбор

This can happen because accuracy and BCE measure different things. Accuracy is threshold-based: after choosing a threshold such as 0.5, it only counts whether each prediction is on the correct side. BCE uses the predicted probability, so confidence matters.

Suppose more validation examples move from 0.49 to 0.51 for the correct class. Accuracy improves. At the same time, a small number of mislabeled, shifted or hard examples can receive very confident wrong probabilities, such as 0.999 for the wrong class. BCE on those examples can grow sharply and dominate the average loss.

Plausible causes include label noise, validation/train domain shift, overconfident miscalibration, or a distribution slice where the model becomes confidently wrong. A strong answer proposes inspecting the confusion matrix, per-slice loss, calibration curves and mislabeled examples.

Типичные ошибки

  • Assume validation loss and accuracy must always be monotonic together.
  • Ignore confidence and calibration.
  • Look only at the aggregate metric instead of per-slice failures.

Как сказать на собеседовании

  • Build a tiny counterexample with one confidently wrong sample.
  • Name both label noise and domain shift as practical explanations.
3Вопрос8 мин

Вопрос про production ML

In PyTorch DDP training, which common layer can behave badly across processes and how do teams usually handle it?

Ответьте без подсказки

Сначала проговорите ответ вслух или тезисами.

Запишите черновик

Формулы, план решения, риски и примеры.

Сравните с разбором

Откройте разбор только после своей попытки.

Короткий ответ

BatchNorm is the classic issue: each process sees only its local mini-batch, so statistics can diverge. Use SyncBatchNorm, larger effective batches, different normalization, or accept the approximation.

Подробный разбор

BatchNorm depends on batch statistics. In DDP, each process usually receives only a shard of the global batch, so ordinary BatchNorm computes mean and variance from the local shard. If the per-GPU batch is small or non-representative, the normalization can be noisy or inconsistent.

One common fix is synchronized batch normalization, such as PyTorch SyncBatchNorm, which synchronizes statistics across processes. Another path is to use normalization layers that do not depend on cross-sample batch statistics, such as LayerNorm or GroupNorm, depending on the architecture. Some teams also simply tolerate local BatchNorm when the per-device batch is large enough and metrics are stable.

The production answer should include the tradeoff: synchronization costs communication and can slow training, so it is not automatically the best choice.

Типичные ошибки

  • Assume DDP automatically makes BatchNorm global.
  • Forget the communication overhead of SyncBatchNorm.
  • Ignore per-device batch size.

Как сказать на собеседовании

  • Say exactly what statistic is local.
  • Mention LayerNorm or GroupNorm as practical alternatives.
4Вопрос12 мин

Вопрос про production ML

Explain at a high level how TensorRT or similar inference optimizers speed up neural networks, and why INT8 quantization usually needs calibration.

Ответьте без подсказки

Сначала проговорите ответ вслух или тезисами.

Запишите черновик

Формулы, план решения, риски и примеры.

Сравните с разбором

Откройте разбор только после своей попытки.

Короткий ответ

Optimizers compile a static graph for target hardware, fuse operators, choose kernels and reduce precision. INT8 needs calibration to map real activation ranges into 8-bit values without destroying accuracy.

Подробный разбор

ONNX is commonly used as an interchange format that describes a static computation graph and a set of operations. TensorRT can take such a graph and build an engine tuned for a specific NVIDIA GPU. The speedups come from operator fusion, kernel selection, memory-layout planning, constant folding, removing unnecessary work and using lower precision where safe.

FP16 quantization is often relatively straightforward because it keeps floating-point semantics with fewer bits. INT8 is more delicate: activations and weights must be mapped into a small integer range. Calibration uses representative data to estimate activation ranges or distributions and choose scales and zero points. Without this, outliers and poorly chosen ranges can destroy model quality.

A good production answer also mentions dynamic shapes and unsupported operators as common reasons conversions fail or become slower than expected.

Типичные ошибки

  • Treat ONNX and TensorRT as the same thing.
  • Say quantization only saves disk size.
  • Ignore representative calibration data.

Как сказать на собеседовании

  • Separate graph optimizations from numeric precision changes.
  • Call out validation after conversion as mandatory.
5Вопрос8 мин

Вопрос

If a YOLO-style detector was trained at one image resolution, what can happen if you run inference at a different resolution? When is it technically possible?

Ответьте без подсказки

Сначала проговорите ответ вслух или тезисами.

Запишите черновик

Формулы, план решения, риски и примеры.

Сравните с разбором

Откройте разбор только после своей попытки.

Короткий ответ

It is technically possible for fully convolutional detectors, but quality can change because feature scales, anchors and small-object visibility shift. Fully connected heads may require fixed input size.

Подробный разбор

Whether inference at a different resolution is technically possible depends on the architecture. A fully convolutional detector can usually accept different spatial dimensions, subject to stride divisibility and implementation constraints. If the model has fixed-size fully connected layers, those layers break unless they are replaced or adapted.

Even when the forward pass works, model quality can degrade. The detector learned feature scales, anchors, receptive-field behavior and preprocessing assumptions at the training resolution. Downscaling can hurt small objects; upscaling can change calibration and increase compute. In production, teams usually train and validate on the same resolution used for deployment or run explicit multi-scale training/evaluation.

For an automotive perception role, the stronger answer connects resolution choices to latency, hardware budget and safety-critical recall.

Типичные ошибки

  • Assume any CNN accepts any resolution with no metric change.
  • Forget stride and head constraints.
  • Discuss only speed and not detection quality.

Как сказать на собеседовании

  • Start with architecture compatibility.
  • Then discuss quality and deployment tradeoffs.