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
mallocin 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 - pyield? β[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) -
structvsunion+ struct padding: computesizeofof 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;constplacement β[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"ΒΆ
-
memcpyyourself β[M](β01 E1) -
memcpyhandling overlap +memmove(copy direction) β[H](β01 E1) -
memcpywithout a temporary array / covering all error scenarios β[M] -
strcmpyourself β[E](β01 E2) -
strstrthe optimal way (naive then KMP) β[H](β01 E3) -
sizeofoperator yourself (macro, pointer-arithmetic trick) β[M](β01 E4) -
malloc/freestrategy β 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/deletevsmalloc/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;
typedefa struct; a struct with a pointer member - Define a
unionand observe shared storage; define anenumand print it - Compute
sizeoffor several structs and explain the padding
C β dynamic memory & storageΒΆ
-
malloc+freean int array;calloc;reallocto grow it - Allocate and free a dynamic 2D array (and avoid the leak on error paths)
-
staticlocal counter across calls;const; global vsstaticglobal (file scope);externacross 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::stringbasics (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::sortwith 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
thispointer - Constructors: default, parameterized, copy constructor, member initializer list; destructor
-
staticmembers & methods;constmember functions - References (
int&), reference parameters,constreferences - Operator overloading:
operator+for aComplex/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>orPair<A,B>) -
unique_ptrandshared_ptrbasics; 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.