LinkedIn · CS Fundamentals
Systems and Java Fundamentals
TrueInterview
October 27, 2026 · 3 min read
Requirements
Before any coding begins, the phone screen starts with spoken questions on systems topics. The Infra versions add Java concepts as well, and which topics come up is not fixed.
Systems comparisons
- Contrast heap memory with stack memory.
- Contrast a thread with a process.
- Contrast a semaphore with a mutex.
Additional Infra and Java prompts
- Describe what virtual memory is.
- Describe what an object is.
- Say when an inner class is the right choice, and illustrate with an example.
Notes
- In one Infra version, the conversation opens on a past project, then covers fundamentals, and finishes with coding.
- A different phone-screen version runs through the three systems comparisons and then gives two coding problems.
- Even when the concepts themselves are familiar, explaining them briefly in English is hard if you have not rehearsed.
Answer framework
- Heap versus stack: Under the JVM's logical memory model, every thread owns call frames that store local values and references, whereas objects and arrays live on a heap shared by all threads. When a method returns, its frame goes away, but the objects it pointed to do not necessarily go with it. Whether an object is collected depends on whether it is still reachable, so the lifetime of a local variable should not be confused with the lifetime of an object, and no specific physical layout should be assumed.
- Threads versus processes: Threads inside a single process share that process's address space while keeping their own call stacks and execution state. Each process gets its own address space, so talking between processes or sharing data on purpose needs something like IPC or shared memory. Mutable objects that are shared still require synchronization, even if the references to them sit in local variables.
- Semaphores versus mutexes: A mutex guards a critical section and has an owner. A counting semaphore keeps a count of permits, used for admission control or for signaling, and a binary semaphore does not by itself enforce who owns the lock. When limiting a resource, give back only a permit that was actually acquired, including on paths that exit via an exception, so that the count cannot drift upward by mistake.
- Virtual memory: Page tables translate virtual addresses into physical pages and record access permissions, and the TLB caches those translations. On a page fault, the system may need to allocate a page, load it, or refuse an invalid access. Beyond letting disk act as spillover storage, virtual memory also gives isolation and controlled sharing.
- Objects: Keep the definition of a class distinct from the identity and state of a particular instance. Several references may point at one object, and dropping a single local reference does not mean the object has become unreachable.
- Inner classes: A non-static member inner class is tied to an instance of its enclosing class and can read that instance's state. A static nested helper carries no hidden enclosing instance, so an object must be handed to it explicitly when one is required. When the helper has no need for an enclosing object, the static form is preferable.
Preparation
- Spend 15 minutes giving a spoken English answer of 60-90 seconds on each topic above, covering the definition, the rules for ownership or lifetime, and a single contrasting use case.
- Spend 20 minutes writing and compiling a short Java program in which a method returns an object, that object is reached through two references, and a member inner class is set beside a static nested class. Explain which references are still valid once the method has returned.
- Spend 15 minutes tracing two workers that share a bounded resource. Compare using a mutex against using a semaphore, handling acquisition, release, and an exception thrown after acquiring; check that each successful acquisition is matched by exactly one release.
Loading comments…