← Back to CS Fundamentals

Primitive vs Reference Types / Stack vs Heap

CS Fundamentalsdata-structures

The Question

What is the difference between primitive and reference types? How do stack and heap relate?

What a Strong Answer Covers

  • stack = local vars
  • "heap = objects
  • "Python: everything on heap
  • "GC manages heap

Related Questions

  • Process vs Thread
  • Race Condition
  • Deadlock — 4 Conditions, Prevention
  • Thread Safety — Is dict Thread Safe?
  • HashMap Internals

Practice This Question

Get AI-graded feedback on your answer with follow-up probes on weak points.

Take the Free Assessment
GrindQuestionsAITechnical interview assessment
TermsPrivacyAbout