General question bank
AI Infra interview notes (1)
Real AI Infra interview questions covering inference optimization, operator optimization, and high-performance computing
Inference optimization Operator optimization High-performance computing
C++ basics
- How do pointers and references compare?
- Uses of
static; differences when it modifies member variables versus member functions; static global variables versus ordinary globals - Kinds and use of smart pointers; is
shared_ptrthread-safe? - Rvalue references and when to use them
- Roles of
std::moveandstd::forward, and how they differ - Why must a copy constructor take its argument by reference rather than by value?
newversusmalloc; hownewworks underneath- Overview of the C++ memory model
- Why can a constructor not be virtual? Why should a destructor usually be virtual?
- How polymorphism works and the underlying mechanism; where the vtable lives; template polymorphism and partial specialization
- How does
vectorgrow? Why is 2x common? - Lambda syntax and capture modes
- Lock types and when to use them
- When sharing memory across threads, when do you use condition variables versus mutexes? How do they differ?
- Four necessary conditions for deadlock and how to prevent it;
lock_guardversusunique_lock - How do you implement a thread-safe singleton?
- How do you force an object to be created only on the heap?
- C++ compilation pipeline; dynamic versus static libraries
- How does C++ call a function written in C?
- Process versus thread
- How do you detect big-endian versus little-endian storage (at least two ways)?
High-performance computing
- Overview of GPU architecture
- Global memory versus shared (local) memory on the GPU; how do you use shared memory well?
- How cache works and how to raise hit rate
- Temporal locality versus spatial locality
- Compute-bound versus memory-bound
- Common performance optimization ideas
- OpenCL execution flow
- Why reduce branches in OpenCL kernels? What are masks for?
- Main parameters of an OpenCL kernel
- Why is separable convolution often slow on GPU? Why is it memory-bound?
- Operator fusion; derive the formula for fusing conv + BN and why it works
- Common ways to implement convolution in inference frameworks
- Causes of bank conflicts and fixes
- Basics of the TVM compiler framework
Deep learning basics
- Batch Normalization: computation, role, train versus infer differences
- Depthwise versus Pointwise convolution
- Evolution of MobileNet v1/v2/v3; GhostNet design; SE module structure
- YOLO v1/v2/v3 versus SSD
- Where is global pooling usually placed in a network?
- Knowledge distillation: idea and pipeline
- Quantization taxonomy; INT8 details: symmetric versus asymmetric; QAT and inference details
- Dropout at train versus infer time
- Deconvolution versus dilated convolution
- GIoU loss: definition and role
- Softmax formula and why it is used for classification
- Improvements on NMS
Coding
- Implement convolution
- Implement a computation graph
- Implement Pooling
- Implement NMS
- Matrix multiply and vector sum in OpenCL