← 返回 xai 的题目列表Process vs Thread (Verbal CS Fundamentals)
类型:qbank
A short verbal CS-fundamentals question that interviewers tack onto the 15-minute screen, especially for infra / SRE / backend tracks. Be able to walk through the differences between processes and threads, whether they share memory, and the risks that shared memory introduces.
Requirements
In under 5 minutes, cover:
What is a process? What is a thread? How do they differ in scheduling and addressing?
Do threads share memory? Do processes? What about file descriptors and signal handlers?
What are the risks of shared memory across threads (race conditions, torn reads/writes, false sharing, atomicity, deadlock)?
How is concurrency typically achieved in your language of choice (Python: GIL + threading for IO, multiprocessing for CPU; Go: goroutines + channels)?
Follow-up directions interviewers go in:
Compare cost of context switching: process vs thread vs goroutine.
Synchronization primitives: mutex, RWLock, semaphore, condition variable, channel.
IPC mechanisms when processes need to exchange data.
Notes
Several reporters answered correctly and were still cut quickly afterwards — the question is not the only signal in the round; expect the project deep-dive to carry equal weight.
For Python candidates, mention the GIL up front; the interviewer will probe it anyway and getting there first reads as fluency.
Avoid hedge words. The 15-minute format penalizes hesitation; over-confident wrong answers are corrected, but wandering ones are cut.
Preparation
Memorize a 60-second "process vs thread" pitch with concrete examples from your stack.
Prepare a 30-second "risks of shared memory" answer naming at least three failure modes.
Have one example from your own work where you actually hit a race condition or deadlock — interviewers reward first-person experience over textbook recall.