InterviewLegend

C++, OS & Computer Architecture Questions

Alex Chen18 min readGuide updated 61 real interview reports
In this lesson
  • Know which spoken C++, OS and architecture questions AMD rounds asked in 2025 and 2026
  • Answer each one in under a minute, then survive the follow-up
  • Know which questions lean toward GPU, driver and firmware teams

A lot of an AMD technical interview is talk. Someone asks what a semaphore is, then what happens when you fork, then whether you know how an LRU cache decides what to evict. There's no compiler and often no code at all. A senior Bengaluru loop in February 2026 spent a 1.5 hour round on operating systems, threads and caches, with one short concurrency problem in the middle.

AMD doesn't read from a fixed list. Each interviewer picks from the same few areas, so the useful prep is knowing each idea well enough to explain it plainly and take the next question. Nearly every question below came up in a real round, dated to when it was asked. The few that didn't are the background those questions lean on.

The AMD angle
AMD builds the hardware your answer describes. A cache-line answer here may be heard by someone who works on the cache. Skip the textbook paragraph. Say what the hardware does, give one number you're sure of, and stop. Then let them pull you deeper.

Where these questions show up in an AMD loop

Mostly in the long technical rounds, mixed in with a coding problem. The October 2026 Bengaluru Senior Software System Designer loop had an in-person round on OS, concurrency, CPU caches and LRU, then a third round on producer-consumer and C and C++ memory questions. The February 2026 uProf loop ran its OS round for 1.5 hours against a one-hour booking.

GPU teams ask their own version. A Toronto GPU onsite in September 2026 covered profiling, cache-line conflicts and a ROCm transpose kernel in one session, and its design talk got into memory-bound against compute-bound work. A Toronto screen in February 2026 had no live coding at all. Driver and firmware rounds lean on kernel mode, casts and bits.

AMD C++ interview questions

What's the difference between malloc and new, and between free and delete? Asked in the October 2026 Bengaluru round. malloc hands back raw bytes as a void pointer and returns NULL when it fails. new works out the size from the type and runs the constructor. On failure it throws a bad_alloc exception. delete runs the destructor, then releases the memory. free only releases it.

So never mix them. Calling free on an object from new skips its destructor, and the behaviour is undefined. Memory from new[] goes back with delete[]. Plain delete on it is undefined too, and in practice one destructor runs or the heap gets corrupted. If they push further, mention that new can be overloaded per class while malloc can't.

How does polymorphism work in C++? A Markham round in August 2026 asked how polymorphism works in the candidate's chosen language. An EDA tools round the same month gave code that overrides a method and asked what it prints, and why. A July 2026 C++ and concurrency round asked about polymorphism and virtual inheritance.

Each object of a class with virtual functions carries a hidden pointer to its class's vtable, a table of function addresses. A call through a base pointer follows that pointer at run time, so it reaches the derived version. A non-virtual call is fixed at compile time by the pointer's type. For predict-the-output code, virtual means the object decides and non-virtual means the pointer type decides. Overloading and templates are the compile-time kind.

Why does a base class need a virtual destructor? Virtual functions and vtables sat on a 2024 India campus list of topics to study, and the question follows naturally from any polymorphism answer. Delete a Derived object through a Base pointer when the destructor isn't virtual, and the behaviour is undefined. In practice only the Base destructor runs, so whatever Derived owns leaks.

cpp
struct Base { ~Base() {} }; // not virtual
struct Derived : Base { int* buffer = new int[1024]; ~Derived() { delete[] buffer; } };
Base* shape = new Derived();
delete shape; // ~Derived never runs, buffer leaks

The rule to say out loud: if a class has any virtual function, or anyone might delete it through a base pointer, give it a virtual destructor.

What is virtual inheritance? Also from that July 2026 round. It fixes the diamond. B and C both inherit from A, D inherits from both, and without help D holds two copies of A, so a call to an A member is ambiguous. Mark B and C as inheriting virtually from A and D gets one shared A. The most-derived class then constructs A directly, and reaching A costs an extra indirection.

What do the C++ casts do? A Markham Windows kernel-mode driver round in September 2026 asked about inheritance and casts. It paired them with OS questions.

Start with static_cast, which converts at compile time with no run-time check. The dynamic_cast version checks at run time, works only on polymorphic types, and gives a null pointer when the object isn't what you asked for. With a reference it throws bad_cast instead. You reach for const_cast to drop const, and for reinterpret_cast to treat the bits as another type, which is what driver code does to turn a register address into a pointer. A C-style cast quietly tries const_cast, static_cast and reinterpret_cast in turn and takes the first that compiles, which is why it's dangerous.

How do smart pointers work? Memory management and smart pointers opened the July 2026 round. A 2024 Staff loop in the US asked about smart pointers and lambdas too. With unique_ptr there's one owner. It can be moved but not copied, and costs nothing over a raw pointer. A shared_ptr keeps a reference count in a separate control block and frees the object when the count hits zero. The count is atomic, so copying a shared_ptr across threads is safe but not free. weak_ptr watches without owning, which breaks reference cycles. That July round then had the candidate write a basic shared_ptr, which is in LRU Cache, shared_ptr & Thread-Safe Queues.

What does static mean? A UK software developer round in March 2025 asked about static variables. The keyword means three things. Inside a function, the variable is set up once, keeps its value between calls, and lives in the data segment with the globals. At file scope it hides a global or function from every other file. On a class member it gives one shared copy for the whole class. Since C++11 the first-time setup of a function-level static is thread-safe.

How does the STL work inside? A San Jose intern in February 2026 got basic C++ and STL internals from three team members. Expect something like how a vector grows. When it runs out of room it allocates a bigger block, usually a fixed multiple of the old size, moves the elements over and frees the old block. Every iterator and pointer into it is now invalid. std::map is a red-black tree with O(log n) lookups. std::unordered_map is a hash table of buckets, O(1) on average, with a rehash when it fills.

OS and concurrency questions

Most of these come from one round: the February 2026 Bengaluru uProf interview, which opened with mutexes, semaphores, child processes and fork, then kernel and user mode, then process states, with a focus on threading. The October 2026 Bengaluru loop covered the same OS and concurrency ground in person.

What's the difference between a mutex and a semaphore? Asked in February 2026 and in a 2024 Staff loop in the US. A mutex is a lock with an owner. One thread locks it, that same thread unlocks it, and it guards a critical section. A semaphore is a counter with wait and post. Wait takes one or blocks at zero, post adds one, and any thread may post.

That ownership difference is the answer they want. A mutex is for mutual exclusion, a semaphore for counting or signalling, like letting four threads into a pool or waking a consumer. A binary semaphore looks like a mutex but has no owner, so nothing stops the wrong thread from releasing it. Producer-consumer uses both: one semaphore counting empty slots, one counting full slots, and a mutex around the buffer.

What does fork do, and what's a child process? fork makes a near copy of the calling process. Both run on from the same line. It returns 0 in the child, the child's process ID in the parent, and -1 if it failed. The memory isn't copied up front. Pages are shared copy-on-write until one side writes.

c
fork();
fork();
fork();
printf("hello\n"); /* prints 8 times */

Each fork doubles the number of processes, so n calls give 2 to the n. Know the two process words that come next. A zombie has exited but its parent hasn't called wait, so its entry stays in the process table. An orphan's parent died first, and init or a subreaper adopts it.

What's the difference between user mode and kernel mode? It's a CPU privilege level. On x86, user code runs in ring 3 and the kernel in ring 0. User code can't touch hardware, page tables or another process's memory. To get something done it makes a system call, which traps into the kernel, runs there and returns. Interrupts and faults switch modes too. Each switch costs time, which is why batching calls matters.

For driver roles, add the consequence. A bug in a kernel-mode driver can take the whole machine down. A Markham SDET loop in May 2026 asked how to troubleshoot a blue screen of death.

What are the process states? New, ready, running, waiting (or blocked) and terminated. The transitions matter more than the names. The scheduler moves a process from ready to running. A timer interrupt preempts it back to ready. An I/O request sends it to waiting, and when the I/O completes it goes back to ready, so the scheduler has to pick it again. On Linux you'll also see zombies, which ties back to fork.

How are threads different from processes? Threads in one process share the address space, the heap, globals and open files. Each has its own stack and registers. That makes threads cheap to create and switch, and it also means one thread's crash kills them all. Processes are isolated and talk through pipes, sockets or shared memory.

The February 2026 round followed its threading questions with a problem twisted from the LeetCode concurrency list, on the easier side. A Taipei round in 2022 asked about deadlock and the critical section. Deadlock needs four conditions at once: mutual exclusion, hold and wait, no preemption, circular wait. Break any one. Taking every lock in a fixed global order breaks the circle, and it's the answer interviewers like best.

Memory questions: addresses, page tables and the TLB

Where do the stack and the heap live, and when do you use each? Every memory question in this guide leans on this one. Each thread has its own stack, a few megabytes, where locals live and die with their function. Allocation is a pointer bump, so it's fast. The heap is one big shared pool for memory you manage by hand. It's slower, it fragments, and you have to free it. Return a pointer to a local and you've made a dangling pointer, which is a favourite find-the-bug plant.

What's the difference between a virtual and a physical address? A secondhand account of a US GPU systems phone screen in February 2026 started with virtual and physical addresses, page tables and the TLB, then moved to coding an allocator. A 2021 India intern round asked whether a linked-list pointer holds a virtual or physical address. It's virtual. Every process sees its own address space, and the MMU translates each access to a physical frame. That gives isolation, a tidy contiguous view of memory, and room to swap or share pages.

How do page tables and the TLB work? With 4 KB pages, the low 12 bits of an address are the offset inside the page and the rest is the page number. The page table maps page numbers to physical frames, with permission bits. On x86-64 it's a four-level tree, so a cold lookup costs four memory reads. The TLB is a small cache of recent translations that skips that walk.

Have the follow-ups ready. A TLB miss means a page walk. If the page isn't in memory at all, that's a page fault and the OS steps in. A context switch can flush the TLB unless the hardware tags entries by process, which x86 does with PCIDs. Huge pages of 2 MB cover far more memory per entry, so big working sets miss less.

For the allocator question that often follows, see Design a Memory Allocator with Coalescing.

Computer architecture and GPU questions

How do caches work, and what's a cache-line conflict? Cache-line conflicts came up at the Toronto GPU onsite in September 2026. CPU caches were a topic in the October 2026 Bengaluru round, and an Austin firmware intern in March 2025 got cache-protocol questions. Memory moves in lines, 64 bytes on current x86 parts. Each address maps to one set, and each set holds a few lines.

A conflict miss happens when hot addresses land in the same set and keep evicting each other, even with the rest of the cache empty. A stride that's a large power of two is the classic cause. Its cousin is false sharing: two threads write different variables that share a line, and the line bounces between cores. Pad or align the data to fix it.

c
for (int row = 0; row < size; row++)
for (int col = 0; col < size; col++)
total += grid[row][col]; /* fast: walks each line in order */
/* swap the two loops and every access jumps a whole row ahead */

If they ask about the coherence protocol, name MESI: each line is Modified, Exclusive, Shared or Invalid. A write to a shared line invalidates the other copies first. The transpose kernel from the Toronto round is this same idea on a GPU, worked in Matrix Multiply, Tiling & Transpose.

What is TSO? A Sydney engineer with five-plus years got simple questions on low-level systems, x86 and TSO in January 2026. Total store order is the x86 memory model. Loads aren't reordered with other loads, and stores aren't reordered with other stores. The one reordering allowed is a later load passing an earlier store to a different address, because stores wait in a store buffer. That's enough to break Peterson's lock without an mfence. ARM is weaker and reorders much more.

How is an OS thread different from a GPU thread? An ML software engineer intern in Markham got this in November 2025, next to a matrix multiply in C++. A CPU thread is heavy: the OS schedules it, it has its own stack, and each core runs one or two at a time with big caches and branch predictors to cut latency. GPU threads are tiny and run in lockstep groups.

On AMD hardware a group is a wavefront: 64 lanes on CDNA, 32 or 64 on RDNA. NVIDIA calls it a warp of 32. A compute unit keeps many wavefronts resident and swaps between them in hardware whenever one stalls on memory. That's how a GPU hides latency, by having thousands of threads in flight. Branch divergence inside a wavefront runs both paths one after the other.

What's the difference between memory-bound and compute-bound? Look at arithmetic intensity, the operations done per byte moved. The roofline model caps speed at whichever is lower: peak compute, or memory bandwidth times intensity. Below the ridge point you're memory-bound. Vector addition does one add for every 12 bytes of floats it moves, so it's memory-bound on any chip. A large tiled matrix multiply reuses each byte many times and turns compute-bound.

The September 2026 Toronto GPU loop took this into LLM inference with roofline for prefill and decode. Prefill pushes many tokens through the weights at once, so it's compute-bound. Decode at small batch sizes reads every weight for each new token, so it's memory-bound. That loop's full design is Trace an LLM Request Through an Inference Engine.

How do profilers and performance counters work? Profiling came up at the Toronto onsite in September 2026, a 2024 US Staff loop asked about experience with performance counters, and a 2024 onsite had oral questions on profilers and GPU architecture. A sampling profiler interrupts the program at intervals and records where it was. Instrumentation adds code at function entry and exit. It's exact, but it slows the program and skews small functions.

Hardware performance counters are registers in the CPU's monitoring unit that count events like cycles, instructions retired, cache misses and branch mispredictions. Instructions per cycle tells you if a hot loop is stalling, and the cache-miss counts tell you if it's memory. AMD's own tools are uProf for CPUs and rocprof for ROCm GPUs. The February 2026 loop was for the uProf team, so for that role know the tool.

What's the difference between an API and an ABI? Asked in the 2024 US Staff loop. An API is the source contract: function names, argument types, what each call means. An ABI is the binary contract: calling convention, which registers hold arguments, struct sizes and layout, name mangling and vtable layout.

Add a field to a public struct in a shared library and the API still compiles, but the ABI broke, so old binaries read the wrong offsets. That's why driver and runtime libraries freeze struct layouts, hide them behind pointers, and use extern "C" at the boundary.

Older topics worth a quick review

A 2024 India campus post listed pipelining and its hazards under computer architecture. Data hazards are an instruction needing a result that isn't ready yet, fixed with forwarding or a stall. Structural ones are two instructions wanting the same unit. Branches cause control hazards, handled by prediction and a flush on a miss. The same list named dangling pointers, weak and strong pointers and vtables, all covered above, plus friend functions: a function the class lets read its private members without being a member itself. A 2020 Austin MTS round asked about MPI basics and roofline analysis.

How to answer spoken systems questions

Do

  • Give the one-line definition first, then the reason it exists
  • Use one concrete number you know is right, like a 64-byte line or 4 KB pages
  • Tie it to the team: kernel mode for drivers, wavefronts for ROCm, counters for uProf
  • Say "I am not sure, here is how I would find out" when you are not

Don't

  • Recite a textbook paragraph before you reach the point
  • Guess a number you half remember; interviewers here often know the exact figure
  • Answer mutex and semaphore as if they were the same thing
  • Stop at the definition when the follow-up is obviously about performance

Common questions

What technical questions does AMD ask software engineers?

Spoken C++, OS and architecture questions, beside one or two coding problems. Recent rounds asked mutex or semaphore, fork, user and kernel mode, process states, malloc against new, polymorphism, casts, caches, page tables and the TLB. GPU rounds added OS threads against GPU threads and memory-bound against compute-bound.

What C++ interview questions does AMD ask?

Memory first: malloc against new, free against delete, smart pointers. Then polymorphism, virtual destructors, virtual inheritance, casts, static and STL internals. Some rounds hand you code that overrides a method and ask what it prints, which is in Find the Bug & Predict the Output.

Do AMD embedded, firmware and driver interviews ask different questions?

They lean lower. Expect kernel mode, casts, cache protocols and a lot of bit work in C. A Markham kernel-mode driver round in September 2026 paired OS concepts with string-to-integer, bitwise and threading tasks in C. See Bit Manipulation in C.

Do AMD compiler and MTS interviews go deeper?

Senior and compiler loops push further on the same ground: ABI, performance counters, memory models, and why code is slow. A secondhand account of a January 2026 GPU and compiler intern loop in India lists compilers, LLVM, OS and HPC beside C and C++. For any of these, be ready to explain your own past work at this level too.

How should I prepare for AMD technical questions?

Practise saying each answer above out loud in under a minute, then add the follow-up. Read a few pages of an OS textbook on processes, threads and virtual memory, and the cache chapter of an architecture book. For GPU roles, learn the AMD words: wavefront, compute unit, LDS and ROCm. Your AMD Prep Plan fits it into weeks.

Key Takeaways

  • ✓AMD technical rounds spend long stretches on spoken C++, OS and architecture questions with no code to write.
  • ✓The OS core repeats: mutex or semaphore, fork, user and kernel mode, process states and threads.
  • ✓Memory and cache answers need real numbers: 64-byte lines, 4 KB pages, the TLB and page walks.
  • ✓GPU teams add wavefronts, OS threads against GPU threads, and memory-bound against compute-bound.
AMD interview guide

Know what AMD asks before you walk in.

37 coding · 5 system design · 17 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

Find the Bug & Predict the Output in C and C++Had your AMD interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.