Skip to main content
T0 Big tech Baidu

Baidu AI Infra (2)

Real Baidu AI Infra interview questions covering operator optimization

Operator optimization

Round 1

Project deep dive

  1. Introduce resume projects and papers, with follow-ups on the technical points involved

High-performance computing

  1. How do you open an OpenMP parallel region? (pragma omp parallel related syntax)
  2. Inside a parallel region, does for(int i=0;i<100;i++){sum++;} match serial results? How do you keep consistency?
  3. GPU memory hierarchy: roles/scopes of Register File, L1 Cache, Shared Memory, L2 Cache, Global Memory

Computer architecture

  1. Cache mapping types and traits (set-associative, fully associative, direct-mapped)

C++ basics

  1. Smart-pointer types and when to use each
  2. C++ polymorphism concepts and implementation (override vs overload)
  3. Dynamic linking vs dynamic binding

Round 2

Project deep dive

  1. Deep discussion around resume and projects

C++ basics

  1. What is the underlying data structure of STL map?
  2. Difference between balanced BST (AVL) and red-black trees
  3. How unordered_map is implemented underneath
  4. Common ways to resolve hash collisions

Computer architecture

  1. Computer storage hierarchy (registers, Cache, main memory, secondary storage)
  2. Which programmer-visible register classes exist in a CPU? What does the program counter (PC) do?

Other

  1. What common OS commands do you use?

Round 3

C++ basics

  1. How do you run a function before main executes?
  2. How do you set a conditional breakpoint while debugging?
  3. How do you watch the call stack?
  4. How a program is segmented in memory (code, data, heap, stack, etc.)
  5. How STL deque is implemented underneath

Computer architecture

  1. Which is faster, registers or Cache? What tech implements Cache vs main memory? How do they compare?

CUDA programming

  1. CUDA memory categories (local memory, global memory, etc.)
  2. What a Kernel is; role of the __global__ keyword
  3. How do you get the maximum thread count a GPU allows?

Algorithms

  1. Greedy vs dynamic programming
  2. Common graph-search algorithms (BFS, DFS)