Computer Vision Engineer interview questions
100 real questions with model answers and explanations for Senior Computer Vision Engineer candidates.
See a Computer Vision Engineer resume example →Practice with flashcards
Spaced repetition · Hunter Pass
Questions
A residual block learns a correction to its input, which gives gradients a short identity path through a deep network.
- If the residual branch initially contributes little, the block behaves close to identity instead of forcing every layer to relearn the full representation.
- During backpropagation, the skip path carries a gradient term that does not pass through every weight layer, reducing degradation in very deep models.
- Addition requires compatible spatial and channel dimensions, so a strided or 1 by 1 projection is used when the block changes shape.
- This improves optimization, but it does not by itself prevent overfitting or guarantee that arbitrary extra depth helps.
Why interviewers ask this: The interviewer is checking whether you can explain the optimization mechanism and the shape contract rather than merely naming ResNet.
It splits spatial filtering from channel mixing, replacing one dense convolution with a depthwise convolution and a 1 by 1 pointwise convolution.
- A standard K by K convolution costs roughly K squared times input channels times output channels per pixel.
- The separated form costs K squared times input channels plus input channels times output channels, which is much smaller when channel counts are high.
- The reduced arithmetic and parameters suit MobileNet-style edge models, but low theoretical FLOPs may not yield low latency if the device kernels or memory access are inefficient.
- Separating the operations constrains cross-channel interaction, so accuracy can fall unless width, expansion blocks, or training are adjusted.
Why interviewers ask this: A strong answer derives the saving and distinguishes operation count from measured device latency.
An FPN combines semantically strong coarse features with spatially precise fine features to produce useful maps at several resolutions.
- A top-down path upsamples deeper maps while lateral 1 by 1 convolutions align channels from the backbone.
- Elementwise fusion gives high-resolution levels stronger semantics than using early backbone features alone.
- Detector heads assign small objects to fine levels and large objects to coarse levels, limiting the scale range each head must handle.
- Detectron2 and MMDetection expose pyramid levels and assignment rules, which must match image resize policy and expected object sizes.
Why interviewers ask this: The interviewer wants the fusion mechanism and its connection to scale-specific detection, not just the phrase multi-scale features.
U-Net skip connections restore localization detail by passing encoder features directly to decoder stages at the same resolution.
- Downsampling builds context but discards precise edges and small structures that upsampling alone cannot reconstruct reliably.
- Concatenation lets the decoder combine low-level geometry with deep semantic features, unlike residual addition whose main purpose is optimization.
- Encoder and decoder shapes must align, so padding, cropping, and input divisibility need explicit handling in PyTorch.
- Excessively strong shallow features can encourage texture shortcuts, so augmentation and decoder design still matter.
Why interviewers ask this: The interviewer is evaluating whether you distinguish localization skips from residual optimization paths and can manage their tensor shapes.
A dilated convolution spaces kernel samples apart, enlarging the receptive field without adding pooling or proportionally more parameters.
- DeepLab keeps a smaller output stride and uses atrous spatial pyramid pooling with several dilation rates to capture different context scales.
- Large rates can create gridding artifacts because neighboring outputs sample disjoint input patterns.
- Output stride, dilation, and crop size must be coordinated, since a rate useful on a large feature map may be ineffective on a small one.
- The approach improves dense localization but costs more memory than aggressively downsampled backbones.
Why interviewers ask this: A strong answer connects dilation to receptive field, output stride, multi-scale context, and the gridding tradeoff.
I choose from the measured accuracy and latency envelope: one-stage models predict densely in one pass, while two-stage models refine a selected set of proposals.
- YOLO-style one-stage detectors usually offer simpler, faster inference for real-time streams and edge deployment.
- Faster R-CNN can spend more computation on proposal features and often remains attractive for small objects or high-accuracy offline inspection.
- The boundary is not absolute because backbone, image size, TensorRT support, and batching can outweigh the architectural category.
- I benchmark end-to-end preprocessing, postprocessing, memory, and target-class AP rather than compare headline model FLOPs.
Why interviewers ask this: The interviewer checks whether you can make a deployment decision from workload evidence instead of repeating a simplistic speed-versus-accuracy rule.
Anchor-free detectors predict objects from points or centers instead of scoring a predefined set of boxes at every location.
- Anchor-based models require scales, aspect ratios, and positive IoU thresholds that can mismatch unusual object geometry.
- Anchor-free heads commonly predict class heatmaps plus distances to box sides, reducing anchor hyperparameters and output volume.
- They still need a label assignment rule, such as center sampling or dynamic matching, so they are not free of design choices.
- MMDetection ablations should keep backbone, schedule, resize, and NMS fixed before attributing a gain to the head type.
Why interviewers ask this: A strong answer explains that anchor-free removes box priors but not assignment or postprocessing decisions.
Faster R-CNN uses a shared backbone, a region proposal network, and a per-proposal head for classification and box refinement.
- The RPN scores anchors and regresses proposal offsets, then proposal NMS keeps a manageable candidate set.
- The original architecture used RoI Pooling; common modern FPN implementations use configurable RoI Align to sample fixed-size proposal features without coordinate quantization.
- Training combines RPN objectness and box losses with second-stage classification and regression losses using matched ground truth.
- At inference, refined boxes are decoded, low scores are removed, and class-wise NMS produces final detections.
Why interviewers ask this: The interviewer is checking whether you understand the complete proposal path and can distinguish the original RoI Pooling design from common modern RoI Align implementations.
Mask R-CNN adds a parallel per-instance mask head to Faster R-CNN and relies on accurately aligned RoI features.
- RoI Align samples floating-point coordinates rather than rounding proposal boundaries, which is important for pixel-level masks.
- The mask branch predicts a small binary mask per class or selected class independently of the box regression branch.
- Training uses a mask loss only for positive proposals, alongside the existing RPN, classification, and box losses.
- At inference, each predicted mask is resized into its detected box, so box errors still limit final mask quality.
Why interviewers ask this: A strong answer identifies RoI Align, parallel supervision, and the dependency of mask placement on box quality.
A modern YOLO detector uses a backbone, multi-scale feature fusion, and dense heads that jointly learn classes, localization, and often objectness.
- Training resizes and augments images, assigns ground-truth boxes to head locations, and balances classification and IoU-based box losses across pyramid levels.
- The raw head output must be decoded from grid-relative values into image coordinates with the exact stride and preprocessing convention used by that implementation.
- Inference applies confidence filtering and NMS after decoding, and those steps can dominate latency when candidate counts are large.
- Exporting to ONNX or TensorRT requires verifying letterbox reversal, coordinate order, score composition, and postprocessing against the PyTorch output.
Why interviewers ask this: The interviewer wants an end-to-end account that includes assignment, decoding, and deployment-sensitive postprocessing.
A ViT divides an image into fixed-size patches, projects each flattened patch into an embedding, adds positional information, and applies transformer blocks.
- For an H by W image and P by P patches, self-attention receives roughly HW divided by P squared tokens.
- Each token can attend globally to every other token, while a CNN builds its receptive field through stacked local kernels.
- Attention cost grows quadratically with token count, so halving patch size sharply increases memory and compute.
- Dense prediction models reshape or tap token features at several depths because a single class token is insufficient for localization.
Why interviewers ask this: A strong answer links patch size to token count, global interaction, and the quadratic cost relevant to vision workloads.
A CNN usually provides stronger locality and translation priors, while a ViT offers flexible global interaction but often needs stronger pretraining and deployment support.
- On a small labeled dataset, a pretrained CNN can be easier to fine-tune because its inductive bias reduces the amount of structure it must learn.
- A well-pretrained ViT can outperform it, especially at scale, but attention memory rises quickly with high-resolution inputs.
- GPU throughput does not guarantee camera-stream latency because batch size one, operator fusion, and TensorRT kernel availability matter.
- I compare target-device p50 and p99 latency, memory, and per-class quality after identical preprocessing rather than select by parameter count.
Why interviewers ask this: The interviewer evaluates whether you connect model family to data regime and actual inference behavior rather than broad benchmark claims.
I start with frozen DINOv2 features as a baseline, then fine-tune progressively if the target domain and task require adaptation.
- Self-supervised pretraining learns transferable visual structure from unlabeled images, which can reduce labeled-data needs for retrieval, classification, or dense tasks.
- A linear probe tests representation quality without allowing a large head to hide weak features.
- For a specialized domain such as thermal imagery, unfreezing later blocks with a lower learning rate can adapt semantics while limiting catastrophic forgetting.
- Input normalization, patch resolution, license constraints, and target-device cost must be checked before adopting the checkpoint.
Why interviewers ask this: A strong answer gives a staged transfer strategy and recognizes domain, preprocessing, and deployment constraints.
I train the student on ground truth while also matching informative outputs or features from a stronger frozen teacher.
- Temperature-scaled soft class probabilities expose similarities between classes that one-hot labels discard.
- Detection or segmentation distillation may match feature maps, logits, boxes, or masks, but spatial dimensions and foreground weighting must be aligned.
- The distillation weight and temperature are validation hyperparameters because an overconfident or domain-mismatched teacher can transfer errors.
- Success is measured on target hardware: a smaller student is useful only if TensorRT latency or memory improves at acceptable task quality.
Why interviewers ask this: The interviewer checks whether you can translate classification distillation into dense vision tasks and verify its deployment value.
Focal loss downweights easy, already-correct examples so numerous background locations do not dominate the classification gradient.
- It multiplies cross-entropy by a factor based on one minus the predicted probability of the true class, controlled by gamma.
- An alpha term can additionally rebalance positive and negative classes, but it serves a different purpose from the focusing term.
- Larger gamma concentrates learning on hard examples, yet noisy labels can then receive excessive weight.
- I inspect positive and negative loss contributions in PyTorch instead of assuming a conventional gamma suits every assignment strategy.
Why interviewers ask this: A strong answer explains both focal terms and the interaction between hard-example emphasis and label noise.
I use overlap-based loss when foreground pixels are sparse and pixelwise cross-entropy would be dominated by background.
- Dice optimizes a soft overlap ratio and gives the small foreground region more influence than its raw pixel count.
- Tversky weights false positives and false negatives separately, so I can penalize missed lesions more than extra mask area.
- The smoothing constant and treatment of empty masks affect gradients and must be explicit.
- Combining Dice or Tversky with cross-entropy often preserves stable pixelwise learning while improving region overlap.
Why interviewers ask this: The interviewer is checking whether you can select and implement an overlap loss based on asymmetric segmentation costs.
They extend overlap-based regression to provide useful geometry signals in cases where plain IoU is weak or zero.
- IoU directly optimizes overlap but has no gradient with respect to separation when predicted and target boxes do not intersect.
- GIoU adds a penalty from the smallest enclosing box, giving a signal to disjoint boxes but sometimes converging slowly.
- DIoU directly penalizes center distance, while CIoU also includes an aspect-ratio term.
- I validate the loss with the detector's box parameterization and assignment because a better standalone formula does not guarantee higher COCO mAP.
Why interviewers ask this: A strong answer identifies the geometric signal each loss adds and avoids claiming one variant is universally best.
Label assignment decides which predictions receive positive, negative, or ignored supervision, so it shapes the detector's gradient as much as the loss does.
- Fixed IoU thresholds are simple but can yield too few positives for small or unusual objects.
- Center sampling limits positives to plausible locations, while dynamic schemes use current classification and localization costs to select matches.
- One-to-one Hungarian matching, used by DETR-style models, assigns each object to one query and removes duplicate supervision.
- Assignment must be inspected per object size and class because unstable or excessive positives can overwhelm later NMS tuning.
Why interviewers ask this: The interviewer wants you to connect matching rules to gradient quality, object scale, and duplicate predictions.
I collect high-scoring false positives from realistic data and feed a controlled subset back into training as explicit negatives.
- For a detector, I run the current model over unlabeled or negative scenes and review crops such as reflections, logos, or background textures it confuses with the target.
- Sampling focuses on informative errors without letting millions of near-identical negatives dominate each batch.
- Deduplication and human verification are necessary because hidden true objects mislabeled as negatives damage recall.
- I keep a fixed challenge set to confirm mining improves the failure mode without reducing performance on ordinary positives.
Why interviewers ask this: A strong answer describes the data loop, safeguards against false negatives, and a separate evaluation set.
They resolve overlapping predictions differently: NMS suppresses boxes, Soft-NMS decays scores, and WBF combines coordinates.
- Greedy NMS keeps the highest-scoring box and removes lower-scoring boxes above an IoU threshold, which is fast but can drop nearby objects.
- Soft-NMS reduces overlapping scores instead of deleting them, preserving candidates in crowded scenes at additional postprocessing cost.
- WBF averages coordinates using confidence weights and is most useful for well-calibrated model ensembles, not as a drop-in replacement for every single detector.
- Thresholds are tuned per class and density using end-to-end metrics, and ONNX or TensorRT export must preserve the chosen semantics.
Why interviewers ask this: The interviewer checks whether you can choose duplicate handling based on scene density, calibration, and deployment support.
Locked questions
- 21
How would you calibrate confidence scores from an object detector?
calibration - 22
What exactly does COCO mAP from 0.50 to 0.95 measure?
coco-map - 23
Which metrics reveal segmentation quality that ordinary pixel IoU can miss?
segmentationmonitoring - 24
How do MOTA, IDF1, and HOTA evaluate different aspects of multi-object tracking?
llm-evaldecision-making - 25
How would you train on a long-tailed visual dataset without erasing head-class performance?
performance - 26
How do you detect and mitigate label noise in a computer vision dataset?
cv - 27
How would you design an active-learning loop for image annotation?
design - 28
What forms of weak supervision are useful for computer vision, and what are their limits?
cv - 29
How would you design and validate two-view triangulation for a sparse 3D reconstruction?
validationdesign - 30
How would you adapt a vision model to a new camera or environment with few labels?
- 31
What must be recorded to make a computer vision dataset version reproducible?
cvreproducibility - 32
How do camera intrinsic and extrinsic matrices map a 3D point to an image pixel?
- 33
How do common camera distortion models affect calibration and image rectification?
calibration - 34
When is a homography valid, and when will it fail to align two views?
homography - 35
What does the epipolar constraint tell you about matching points between two cameras?
epipolar-geometry - 36
How are stereo disparity and metric depth related?
stereo-depthmonitoring - 37
How would you estimate camera pose with PnP and validate the result?
camera-poseestimationvalidation - 38
How do you project a point cloud into a camera image safely?
- 39
What does optical flow estimate, and how do you choose between sparse and dense methods?
optical-flowestimation - 40
How does tracking-by-detection associate objects across frames?
tracking - 41
When would you use a temporal video model instead of frame-by-frame inference?
inference - 42
How does automatic mixed precision speed PyTorch training without corrupting gradients?
pytorch - 43
How does PyTorch DistributedDataParallel train one model across multiple GPUs?
distributedpytorch - 44
How do gradient accumulation and activation checkpointing solve different memory limits?
activationmemory - 45
What would you use instead of BatchNorm when vision training batches are very small?
batch - 46
How do EMA and SWA produce more stable model weights?
- 47
What operator and shape contracts must hold when exporting a current PyTorch vision model to ONNX?
serving-runtimespytorch - 48
How do TensorRT precision modes and optimization profiles affect a deployed vision model?
serving-runtimesdeploymentoptimization - 49
What lifetime and synchronization contract is needed when passing cv::cuda::GpuMat into asynchronous CUDA inference?
inferenceasync - 50
Where is the boundary between Docker packaging and Kubernetes GPU orchestration for a vision workload?
dockerkubernetesorchestration - 51
Your detector scores suspiciously well offline, and you discover frames from the same cameras in both training and validation. How would you correct the leakage?
leakagevalidation - 52
mAP drops sharply after a dataset merge, but visual predictions still look plausible. How would you investigate class-index mapping?
indexes - 53
Training accuracy is 97% but validation accuracy is 68% on images from another site. How would you separate overfitting from domain gap?
overfittingvalidation - 54
After adding random perspective augmentation, validation IoU falls and boxes appear misaligned. How would you debug it?
augmentationvalidation - 55
A rare defect class had 41% recall last week and now has 3% after retraining. What would you check?
retrainingdefects - 56
Mixed-precision training starts producing NaN loss after 8,000 steps. How would you isolate the failure?
training-efficiency - 57
A four-GPU DDP job using a custom IterableDataset hangs near epoch end after rank-local filtering leaves one rank a batch short. How would you fix it?
batchhardware - 58
GPU utilization is only 35% while training, and each step waits on the DataLoader. How would you remove the CPU bottleneck?
trackinghardware - 59
PyTorch reports CUDA out of memory even though nvidia-smi shows several gigabytes free. How would you diagnose allocator fragmentation?
memorypytorch - 60
The current PyTorch ONNX exporter fails on a custom vision operation. How would you make the graph portable?
serving-runtimespytorch - 61
The ONNX model runs but its detections differ from PyTorch on the same images. How would you find the numerical mismatch?
serving-runtimespytorch - 62
TensorRT 10 rejects a request because its image shape is outside the optimization profile. How would you resolve it?
serving-runtimesoptimization - 63
You need an INT8 TensorRT 10 detector. How would you choose representative data and decide whether PTQ is sufficient?
serving-runtimes - 64
Inference p50 is 22 ms but p99 is 310 ms. How would you investigate the tail?
inferencelatency - 65
A Triton video model keeps temporal state across frames from each camera. How would you serve many streams without mixing their state?
- 66
A Kubernetes inference pod stays Pending although one node appears to have a free GPU. What would you check?
inferencekuberneteshardware - 67
A CUDA inference pipeline spends more time copying images than running the network. How would you improve it?
inferenceci-cd - 68
A C++ OpenCV preprocessing function corrupts cropped images but works on full frames. How would you debug a non-contiguous stride issue?
opencv - 69
A forensic video pipeline must retain every frame, but inference slows during bursts. How would you design no-drop backpressure?
designinferencebackpressure - 70
Detections are matched to the wrong sensor events even though both streams look ordered. How would you diagnose timestamp mismatch?
- 71
A multi-object tracker has frequent ID switches when people cross. How would you compare ByteTrack and DeepSORT fixes?
- 72
An aerial detector localizes isolated vehicles but merges densely packed, rotated aircraft after postprocessing. How would you fix the regression?
- 73
Your detector finds people in a crowd before NMS, but many disappear afterward. How would you fix it?
- 74
Reprojection error grows over several weeks on a nominally fixed camera. How would you distinguish intrinsic drift from extrinsic movement?
iac - 75
A release changes lens correction, and straight lines near image edges bend again. How would you catch the regression?
- 76
Stereo depth is noisy on blank walls but accurate on textured objects. How would you measure confidence and address it?
- 77
A segmentation model misses cables and other thin structures after downsampling. How would you improve it?
segmentation - 78
Two annotators often disagree on object boundaries. How would you measure and use that disagreement?
conflict - 79
Your active-learning queue is almost entirely one common class. How would you rebalance it?
data-structures - 80
A detector trained mostly on synthetic images loses 25 mAP points on real cameras. How would you close the synthetic-to-real gap?
- 81
How would you detect production dataset drift for a vision model before accuracy labels arrive?
iac - 82
How would you shadow-evaluate a new detector in production without affecting users?
llm-evaldecision-making - 83
Design a canary and rollback plan for a new production vision model.
designdeployment-strategiesrollback - 84
What image-quality monitoring would you add for a fleet of production cameras?
monitoring - 85
Predicted class frequencies stay stable, but delayed labels show that errors doubled for one class at one site. How would you detect this concept drift earlier?
mlopsiac - 86
A safety-critical rare class may be failing, but labels arrive three weeks late. How would you alert responsibly?
alerting - 87
How would you compare two detectors on the same validation images and decide whether a small mAP gain is real?
validation - 88
A teammate cannot reproduce your training result even with the same Git commit. How would you find the difference?
debugginggit - 89
An Airflow retry duplicated part of a generated training dataset. How would you prevent recurrence?
resilienceairflow - 90
Training crashes intermittently while reading a WebDataset shard. How would you locate and handle corruption?
sharding - 91
A Ray training worker dies halfway through a distributed run. How would you make the job recover safely?
distributedray - 92
A CUDA application works on the host but fails inside Docker with a driver compatibility error. How would you debug it?
docker - 93
An SfM reconstruction develops points behind cameras and bundle adjustment diverges after a new image sequence is added. How would you debug it?
- 94
A multithreaded C++ preprocessor occasionally produces images with the wrong normalization. How would you find the race?
normalization - 95
Point-to-plane ICP reports low residuals in a corridor, but the estimated pose slides along the corridor and rotates on repeated planar scans. How would you handle the degeneracy?
estimation - 96
Your public inference API accepts uploaded images. How would you protect it from unsafe image decompression?
inferenceapi - 97
In code review, a teammate claims a new postprocessor improves accuracy by 12%, but the metric is unsupported. How would you respond?
code-reviewmonitoring - 98
A junior engineer's model suddenly predicts every image as one class, and you suspect a label bug. How would you mentor them through it?
mentoring - 99
A stakeholder asks for the model with the highest accuracy, but positives are only 0.5% of images. What would you recommend?
stakeholder-managementcommunication - 100
You have one week to improve a detector that misses small defects, has 140 ms p95 latency, and lacks reliable error slices. What would you fix first?
latencydefects