This question evaluates understanding of Java runtime memory management (generational garbage collection, marking, compaction), software design patterns (Singleton), and object-oriented design and SOLID principles, testing competencies in performance reasoning, concurrency and thread-safety considerations, design trade-offs, and maintainability.
Answer the following Java/software-engineering fundamentals questions:
Give clear explanations and small code snippets or examples where helpful.