Explain GC, singleton, and OOP principles
Company: SoFi
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Technical Screen
Answer the following Java/software-engineering fundamentals questions:
1. How does Java garbage collection work at a high level (generational GC, marking, compaction), and what are common GC tuning/diagnostic signals?
2. What is the Singleton pattern? When is it appropriate, what are common pitfalls (testing, hidden dependencies), and how do you implement it safely in Java (thread safety, lazy vs eager)?
3. What are core OOP/SOLID principles you use in object-oriented design, and how do they improve maintainability/extensibility?
Give clear explanations and small code snippets or examples where helpful.
Quick Answer: 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.