Articles 🧠 Quiz β†—

Qualcomm β€” Programming Practice List (coding questions to drill)ΒΆ

Source: the actual coding questions asked in the 75 reports in qualcomm_camera_interview_experiences.md. I kept only programming/coding questions (write code, an algorithm, or predict/debug code) and dropped pure theory, HR/behavioral, networking/DBMS/cloud, ML-theory, and pen-and-paper puzzles (those live in 04_os.md, 06_ml_deeplearning.md, 08_logical_puzzles_aptitude.md, 11_behavioral_hr_projects.md). Near-duplicates are collapsed into one entry with variants noted.

How to use: You're rusty in C/C++, so the categories are ordered easy β†’ hard, and within each category, items are ordered easy β†’ hard. Start at the top of Part 1, do a few per category, and circle back. Part 2 is a 70-item C/C++ syntax/capability warm-up to do first or alongside if the language feels rusty (it overlaps Part 1 on purpose).

Legend: [E] easy Β· [M] medium Β· [H] hard. LC = closest LeetCode problem to practice on. β†’NN = the concept is explained in that prep file. Check off [ ] β†’ [x] as you go.

βœ… Solutions (clean, compile-verified C/C++ β€” try each yourself first, then check): Part 1 Β· A–C (C & memory) Β· Part 1 Β· D–G (arrays/strings/bits) Β· Part 1 Β· H–K (lists/trees) Β· Part 1 Β· L–O (recursion/C++/design) Β· Part 2 (warm-ups) Β· Part 3 (algorithms)


Part 1 β€” Categorized practice list (easy β†’ hard)ΒΆ

A. Warm-ups: numbers, bits-as-math & simple strings Β· start hereΒΆ

Pure syntax/logic reps to get your hands moving in C/C++. - [ ] Swap two numbers without a third variable — [E] (→01) - [ ] Check whether a number is even/odd, and largest of three — [E] - [ ] Reverse a string in place — [E] · LC344 (→01 E) - [ ] Reverse the digits of an integer / sum of digits / count digits — [E] - [ ] Multiply two numbers discussing many approaches (shift-add, repeated addition) — [E→M] (→08 E2) - [ ] Divide a number by 4 without the / operator (use >> 2) — [E] (→01, →09) - [ ] Convert a string to an integer (your own atoi) — [M] · LC8 - [ ] Validate a string is a palindrome — [E] · LC125 - [ ] Pattern printing in C (pyramids / number triangles) — [E] - [ ] Count occurrences of a word in a paragraph (e.g. count "is" in a sentence) — [E→M] - [ ] String compression: AABCCC → 2A1B3C (with the run-cap twist: 13 A's → 9A4A) — [M] - [ ] Replace every a with ab in a string (in place, mind the resize) — [M] - [ ] Decode an encoded string: "a10101b001c11" → "a21b1c3" (binary→decimal per token) — [M]

B. C pointers, memory & language β€” write it & predict it Β· the Qualcomm signature areaΒΆ

  • Predict the output of pointer/operator snippets (10 rapid-fire) β€” [M] (β†’01 G4)
  • Find the bug in int main(){char *p; while(i<50) p++; return p;} β€” [E] (β†’01 G4)
  • Predict output of malloc in a loop / MCQ compile-time vs run-time errors β€” [M] (β†’01)
  • Basic pointer declare/deref; types of pointers; void pointers usage β€” [E] (β†’01 A1/A3)
  • Pointer subtraction β€” what does q - p yield? β€” [E] (β†’01 A5)
  • Function pointers + callback functions (declare, call, use) β€” [M] (β†’01 A4)
  • Relationship between function pointers and inline β€” [M] (β†’01 G3)
  • Dangling pointer β€” show one and how to avoid it; what happens on null-pointer deref (stack/memory level) β€” [M] (β†’01 A2/D3)
  • Pass-by-value vs pass-by-reference β€” write code + explain memory (struct example) β€” [E] (β†’01)
  • struct vs union + struct padding: compute sizeof of given structs β€” [M] (β†’01 F3)
  • Define a data structure to store exactly 12 bits of data (bit-fields) β€” [M]
  • Check endianness β€” write C/C++ to detect big/little, and swap endianness β€” [M] (β†’01 F1)
  • Storage classes (static/extern/register/auto) β€” predict lifetime/scope/visibility from code β€” [M] (β†’01 B)
  • volatile β€” when/why; const placement β€” [M] (β†’01 B3)
  • Return a stream of bytes from a function (no dangling β€” heap or caller buffer) β€” [M] (β†’01 E5/A6)

C. Implement standard library / low-level routines Β· classic Qualcomm "write it yourself"ΒΆ

  • memcpy yourself β€” [M] (β†’01 E1)
  • memcpy handling overlap + memmove (copy direction) β€” [H] (β†’01 E1)
  • memcpy without a temporary array / covering all error scenarios β€” [M]
  • strcmp yourself β€” [E] (β†’01 E2)
  • strstr the optimal way (naive then KMP) β€” [H] (β†’01 E3)
  • sizeof operator yourself (macro, pointer-arithmetic trick) β€” [M] (β†’01 E4)
  • malloc/free strategy β€” describe how you'd implement them (free lists, headers) β€” [H] (β†’01 C2)

D. ArraysΒΆ

  • Rotate an array by k to the right β€” [E] Β· LC189
  • Merge two sorted arrays in-place (into nums1) β€” [M] Β· LC88
  • Find the missing number in an unsorted 1..n (optimal: XOR or sum) β€” [E] Β· LC268
  • First and last position of an element in a sorted array β€” [M] Β· LC34
  • Search in a sorted array of "infinite" size (exponential + binary search) β€” [M]
  • Count pairs whose sum is divisible by k β€” [M]
  • N meetings in one room (activity selection) β€” [M] Β· GfG
  • Minimum number of platforms for trains given arrival/departure β€” [M] Β· GfG
  • Sliding-window maximum (max in every window of size k) β€” [H] Β· LC239
  • Trapping rain water β€” [H] Β· LC42

E. Searching & sortingΒΆ

  • Binary search β€” implement + write pseudocode + complexity in all scenarios β€” [E] Β· LC704 (β†’03)
  • Merge sort β€” implement β€” [M] (β†’03)
  • Quick sort β€” how does the pivot choice impact complexity? β€” [M] (β†’03)
  • Sort a linked list β€” and discuss merge sort vs quick sort for lists β€” [H] Β· LC148

F. Strings (algorithmic)ΒΆ

  • Reverse the words in a sentence / reverse odd-positioned words β€” [M] Β· LC151
  • Longest substring without repeating characters β€” [M] Β· LC3
  • Longest palindromic substring β€” [M] Β· LC5
  • Count of palindromic substrings β€” [M] Β· LC647

G. Bit manipulationΒΆ

  • Count the number of set bits in a number β€” [E] Β· LC191 (β†’03)
  • Check power of two using only bitwise ops, O(1) (no pow/log2) β€” [E] Β· LC231
  • Flip the kth bit from the right β€” [E]
  • Reverse the bits of a number (and then count set bits) β€” [M] Β· LC190
  • Single Number (the one element appearing once) β€” [M] Β· LC136

H. Linked lists Β· the most-asked DSA family at QualcommΒΆ

  • Reverse a singly linked list β€” [E] Β· LC206 (β†’03)
  • Insert a node at beginning / kth position / into a sorted (dictionary-order) list β€” [E]
  • Find the middle of a linked list β€” [E] Β· LC876
  • Detect a loop (Floyd slow/fast) β€” single, circular, and doubly linked β€” [M] Β· LC141 (β†’03)
  • Find the length of the loop in a linked list β€” [M]
  • Detect and remove a loop β€” [M] Β· LC142
  • Nth node from the end (multiple approaches) β€” [M] Β· LC19
  • Delete a node given only a pointer to it (incl. circular list) β€” [M] Β· LC237
  • Pairwise swap nodes / swap nodes in pairs β€” [M] Β· LC24
  • Reverse a doubly linked list β€” [M]
  • Intersection point of two linked lists (brute force + O(n)) β€” [M] Β· LC160
  • Rotate: move the last node to the front (1..n β†’ n,1..n-1) β€” [M]
  • Merge two sorted linked lists β€” [M] Β· LC21
  • Convert a sorted linked list to a BST β€” [H] Β· LC109
  • Reverse nodes in k-group β€” [H] Β· LC25
  • Merge k sorted lists (whiteboard + complexity) β€” [H] Β· LC23

I. Stacks & queuesΒΆ

  • Implement a stack with all operations (array or list) β€” [E]
  • Implement a stack using queues (or queue using stacks) β€” [M] Β· LC225/232
  • Asteroid Collision (stack simulation) β€” [M] Β· LC735

J. Trees & BSTΒΆ

  • Find the maximum element in a binary tree β€” [E]
  • Left view of a binary tree β€” [M] Β· GfG
  • Create / insert into a BST (write create + insert) β€” [E]
  • Delete a node in a binary tree / BST β€” [M] Β· LC450
  • Check whether a binary tree is a BST β€” [M] Β· LC98
  • Minimum distance between two nodes of a binary tree (LCA + depths; call-stack analysis) β€” [M]
  • Fix a BST where two nodes were swapped β€” [H] Β· LC99
  • Binary Tree Maximum Path Sum β€” [H] Β· LC124
  • Count permutations of a preorder that form the same BST β€” [H]

K. HashingΒΆ

  • Implement a hash table (buckets + chaining; handle collisions) β€” [M] (β†’03)
  • Hashing vs hash tables β€” and use a hashmap to count pairs divisible by k β€” [M]

L. Recursion, DP & graphsΒΆ

  • Recursion + the call stack β€” factorial/fib and the memory used (lead-in to DP) β€” [E] (β†’03)
  • Maximise the number of toys purchasable with amount K (coin-change-style DP) β€” [M] Β· LC322-ish
  • Generate valid sentences from words (word break / segmentation) β€” [H] Β· LC139/140
  • BFS vs DFS β€” implement graph traversal β€” [M] (β†’03)
  • Number of Islands β€” [M] Β· LC200
  • Topological sort β€” [M] Β· LC210
  • Propagate failures through a dependency graph β€” [H]

M. C++ & OOP (write the code)ΒΆ

  • Function overloading vs overriding β€” show both in code β€” [E] (β†’02)
  • Polymorphism β€” virtual function with an example; types with code β€” [M] (β†’02)
  • Types of inheritance + resolving multiple-inheritance ambiguity (diamond) β€” [M] (β†’02)
  • Operator overloading (e.g. + and << for a small class) β€” [M] (β†’02)
  • new/delete vs malloc/free; smart pointer basics β€” [M] (β†’02)
  • Implement a thread-safe Singleton (private ctor, static instance, double-checked locking / Meyers) β€” [H] (β†’02)
  • Implement your own immutable class β€” [H] (β†’02/10)

N. Concurrency / multithreading (write the code)ΒΆ

  • Print odd and even numbers sequentially using two threads + a mutex/condition variable β€” [M] (β†’04)
  • Program using pthreads (create/join, pass args) β€” [M] (β†’07)
  • Two threads accessing the same map β€” protect with mutex/locking β€” [M]
  • Implement a binary semaphore (+ follow-ups) β€” [H] (β†’04)
  • Write pseudocode that creates a deadlock on threads (then fix it) β€” [M] (β†’04)
  • Identify the race condition in given pseudocode β€” [M] (β†’04)

O. Design / implement-a-system Β· hardest; code-heavy designΒΆ

  • LRU cache (hashmap + doubly linked list) β€” and the "twisted LRU" variant β€” [H] Β· LC146 (β†’03/10)
  • LFU cache β€” [H] Β· LC460
  • Timer module: handle timeouts & fire callbacks for many clients (timer wheel / min-heap) β€” [H] (β†’10)
  • Lottery machine: non-repeating random 1..N, circular elimination, logging, clean class design β€” [H] (β†’10)
  • Screen-tearing fix: CRT panel + SoC share one frame buffer (producer/consumer, reader-writer sync) β€” [H] (β†’05/10)
  • Text editor with undo/redo β€” [H]
  • Lift / elevator management system (FSM + scheduling) β€” [H] (β†’10)
  • Camera-driver architecture for multiple sensors (HAL + ops tables + registration) β€” [H] (β†’07/10)

Part 2 β€” Prerequisites: ~70 C/C++ base warm-ups (build syntax & capability first)ΒΆ

Do these to get fluent again before the harder Part-1 items. Grouped by skill, each group easy β†’ hard. Plain practice β€” no interview pressure. (Overlaps Part 1 on purpose.)

C β€” basics & control flowΒΆ

  • Print "Hello, World"; read & print an int, float, char, and a string
  • Sum and average of an array; find the max and min of an array
  • Print 1..n; factorial, Fibonacci, multiplication table (loops)
  • Sum of digits, reverse an integer, count digits
  • Even/odd, prime check, leap year, largest of three
  • Patterns: right triangle, pyramid, number triangle
  • GCD/LCM (Euclid) β€” iterative and recursive

C β€” functions & recursionΒΆ

  • Refactor the above into functions; pass arguments by value
  • Recursion: factorial, Fibonacci, GCD, sum of array, power(x,n)
  • Tower of Hanoi (classic recursion)

C β€” pointersΒΆ

  • Declare a pointer, take an address, dereference; print an address with %p
  • Swap two ints via pointers (pass-by-pointer)
  • Walk an array with a pointer (pointer arithmetic); arr[i] == *(arr+i)
  • Pointer to pointer; modify a pointer inside a function
  • Function pointer: declare one, call a function through it, build a tiny 2-entry dispatch table
  • void*: store an int then a float, cast back to print

C β€” arrays, strings, matricesΒΆ

  • Reverse an array in place; linear search; bubble sort; insert/delete an element
  • 2D array: sum, transpose, matrix multiply (incl. dynamic 2D array)
  • Strings as char[]: your own strlen, strcpy, strcmp, strcat
  • Reverse a string; count vowels; to-upper; palindrome check

C β€” structs, unions, enumsΒΆ

  • Define a struct; make an array of structs; pass a struct to a function (by value vs pointer)
  • Nested struct; typedef a struct; a struct with a pointer member
  • Define a union and observe shared storage; define an enum and print it
  • Compute sizeof for several structs and explain the padding

C β€” dynamic memory & storageΒΆ

  • malloc + free an int array; calloc; realloc to grow it
  • Allocate and free a dynamic 2D array (and avoid the leak on error paths)
  • static local counter across calls; const; global vs static global (file scope); extern across two files

C β€” bitwise & miscΒΆ

  • AND/OR/XOR/NOT/shift; set / clear / toggle / test the kth bit
  • Count set bits; check power of two; swap without temp (XOR)
  • File I/O: write lines to a file, read them back, count words in a file

C++ β€” I/O, strings, containersΒΆ

  • std::cout/std::cin; std::string basics (concat, length, substr, find)
  • std::vector: push_back, index, iterate (index loop, range-for, iterator)
  • std::map / std::unordered_map: insert, lookup, iterate; std::set; std::pair
  • std::sort with a custom comparator (lambda); std::stack, std::queue, std::priority_queue

C++ β€” classes & objectsΒΆ

  • Define a class with private data + public methods; getters/setters; the this pointer
  • Constructors: default, parameterized, copy constructor, member initializer list; destructor
  • static members & methods; const member functions
  • References (int&), reference parameters, const references
  • Operator overloading: operator+ for a Complex/Vector2, operator<< for printing

C++ β€” inheritance & polymorphismΒΆ

  • Inheritance: base/derived, access specifiers, constructor/destructor order
  • Virtual function + override; pure virtual / abstract class; virtual destructor (and why)
  • Demonstrate runtime vs compile-time polymorphism (overriding vs overloading/templates)
  • Trigger and explain object slicing

C++ β€” templates, RAII, smart pointersΒΆ

  • Function template (max<T>); class template (Stack<T> or Pair<A,B>)
  • unique_ptr and shared_ptr basics; show RAII (resource freed in destructor)
  • new/delete, new[]/delete[]; a leak, then fix it with a smart pointer
  • Exceptions: try/catch/throw; why RAII makes exceptions safe
  • A lambda capturing by value vs reference; store one in std::function

C++ β€” build-a-class capstones (bridge into Part 1)ΒΆ

  • Implement a dynamic array (vector-lite: push_back with geometric growth)
  • Implement a singly linked list class (insert/delete/reverse/print)
  • Implement a Stack and a Queue class
  • Implement a thread-safe Singleton
  • Implement a small LRU cache with std::list + std::unordered_map

Part 3 β€” Algorithms to understand (explain & trace, not code from scratch)ΒΆ

These were asked "for understanding," not to whiteboard from zero. Goal for each: explain the idea, trace a tiny example, state complexity and trade-offs. Cross-refs (β†’NN) point to the full write-up. Ordered most-asked/foundational first within each group.

P. OS / systems algorithms Β· the heaviest "explain the algorithm" area at QualcommΒΆ

  • Deadlock β€” the 4 Coffman conditions + prevention vs avoidance vs detection+recovery β€” understand: which condition each strategy breaks (β†’04)
  • Banker's algorithm (deadlock avoidance) β€” understand: the safety check + resource-request check; "is this state safe?"; complexity ~O(mΒ·nΒ²) (β†’04)
  • Deadlock detection β€” understand: wait-for graph (single instance) vs resource-allocation graph (multi-instance) cycle detection (β†’04)
  • CPU scheduling: FCFS, SJF/SRTF, Priority, Round Robin (time quantum / time-slicing), weighted RR β€” understand: draw the Gantt chart, compute waiting/turnaround time; starvation (β†’04)
  • Disk scheduling: FCFS, SSTF, SCAN/C-SCAN, LOOK/C-LOOK β€” understand: trace head movement, which is "best" and why (the asked Q) (β†’04, β†’10)
  • Page replacement: FIFO, LRU, Optimal, Clock/second-chance β€” understand: count page faults on a reference string; Belady's anomaly (β†’04)
  • Demand paging + page-fault handling β€” understand: the step-by-step fault service path (β†’04)
  • Virtualβ†’physical address translation β€” understand: paging, multi-level page tables, TLB hit/miss (β†’04, β†’09)
  • Context switch β€” understand: what state is saved/restored and why it's costly (β†’04)
  • Priority inversion β†’ priority inheritance / priority ceiling β€” understand: the bug and the fix (Mars Pathfinder) (β†’04)
  • Producer–consumer (bounded buffer) & reader–writer β€” understand: the semaphore/mutex/condition-variable solution (β†’04, β†’10)
  • Dining philosophers β€” understand: how it deadlocks and the resource-ordering / arbitrator fix (β†’04)
  • Cache coherence (MESI) + cache mapping (direct / set-associative) + LRU eviction β€” understand: states & invalidation (β†’09)
  • Fault tolerance / redundancy β€” understand: TMR / N-modular redundancy, heartbeat + failover (the "redundant systems takeover" Q)

Q. Core algorithm techniques (explain idea + complexity)ΒΆ

  • Big-O notation β€” best/average/worst, amortized; time-complexity of common operations β€” [E] (β†’03)
  • Binary search + variants (first/last, rotated, infinite array) β€” complexity in each scenario (β†’03)
  • Merge sort / quick sort / heap sort β€” understand: recurrence, pivot & partition, why pivot choice changes quicksort to O(nΒ²), stability (β†’03)
  • Floyd's cycle detection (tortoise & hare) β€” understand: why the pointers meet (β†’03)
  • KMP string matching β€” understand: the LPS / failure table β†’ O(n+m) (β†’01 E3, β†’03)
  • Hashing internals β€” understand: collision resolution (chaining vs open addressing), load factor, rehash (β†’03)
  • BFS vs DFS β€” when to use each; topological sort (Kahn's / DFS) (β†’03)
  • Shortest path: Dijkstra & A* β€” the "Google Maps road-blocks / rerouting" question (β†’03, β†’10)
  • Dynamic programming β€” understand: how to recognize it & set up the recurrence (coin change / knapsack) (β†’03)

R. Compiler & architecture proceduresΒΆ

  • Phases of a compiler β€” lexing β†’ parsing β†’ semantic β†’ IR β†’ optimization β†’ codegen β€” understand: what each phase does (β†’09)
  • Intermediate-code optimization β€” constant folding, common-subexpression elimination, dead-code elimination
  • Instruction pipelining β€” stages, hazards (structural/data/control), forwarding/stalls (β†’09)

S. Camera / ISP algorithms (understand the pipeline & each block)ΒΆ

  • The ISP pipeline rawβ†’output β€” black-level β†’ demosaic β†’ white balance β†’ denoise β†’ color-correction β†’ gamma/tone-map β†’ sharpen (β†’05)
  • Demosaic / debayer β€” bilinear interpolation over a Bayer CFA (β†’05)
  • 3A β€” auto-exposure, auto-white-balance (gray-world), autofocus (contrast vs PDAF) (β†’05)
  • Multi-frame HDR β€” exposure bracketing β†’ align β†’ merge β†’ tone-map; the challenges (β†’05)
  • Noise reduction β€” spatial vs temporal vs bilateral/NLM (β†’05)
  • Edge detection β€” Sobel gradient; the Canny steps (β†’05)
  • Image interpolation β€” bilinear vs bicubic (incl. "interpolate between two frames") (β†’05)
  • Image segmentation & masking / convolution (β†’05)
  • Video rate/bit-rate control & motion estimation (I/P/B frames) (β†’05)

T. ML / deep-learning algorithms (explain & derive)ΒΆ

  • Backpropagation β€” forward pass + chain-rule gradients (dense and convolutional) (β†’06)
  • Gradient descent β€” batch / SGD / mini-batch; learning-rate effects (β†’06)
  • Adam optimizer β€” 1st/2nd moments, bias correction, defaults lr=1e-3, betas=(0.9,0.999) (β†’06)
  • Convolution + receptive field, pooling, batch norm (β†’06)
  • 1Γ—1 convolution β€” how it reduces computation (channel bottleneck FLOP math) (β†’06)
  • CNN architectures β€” VGG; Inception (multi-scale + 1Γ—1); ResNet (residual/skip, vanishing gradients) (β†’06)
  • Object detection β€” R-CNN family vs YOLO (β†’06)
  • Seq2seq encoder–decoder + attention / cross-attention; Whisper conv front-end (β†’06)
  • Audio for ML β€” STFT β†’ mel filter-bank; SpecAugment / noise augmentation (β†’06)

Generated from qualcomm_camera_interview_experiences.md. Concepts cross-referenced to the topic guides (β†’01 C, β†’02 C++/OOP, β†’03 DSA, β†’04 OS, β†’05 camera, β†’06 ML, β†’07 embedded, β†’08 puzzles, β†’09 arch, β†’10 design). Tip: Part 2 to regain fluency β†’ Part 1 top-to-bottom to rebuild coding muscle β†’ Part 3 to lock in the algorithms you only need to explain. Part 3 is concept-recall (best reviewed in the linked topic file), not coding reps.