What I Learned From My Java Backend Interview: Collections, Thread Pools, Redis & AOP Insights
This article shares a developer's job‑search journey and detailed interview recap, covering project experience, Java collections, HashMap vs Hashtable, synchronized and volatile, singleton patterns, thread‑pool types, Spring Boot AOP, and Redis caching concepts, illustrated with diagrams.
Preface
The author records a job‑search experience after a year and a half of work, aiming for a salary of 10K‑12K, reflecting on the challenges of finding a new position, the importance of searching while employed, and personal motivation.
Interview Summary
2020‑06‑04 Shenzhen Yunmai Technology 10K‑20K Java Mid‑level Engineer
Status: the interview was cancelled after a brief written test (84 points) and a rushed first interview without self‑introduction.
1. Project and Responsibilities
The candidate worked at a data‑security company on two projects: a database vulnerability scanning system and a big‑data AI‑driven database security governance platform. Responsibilities included data collection, ingestion into MySQL and Elasticsearch via Kafka, Redis caching for high‑frequency statistics, and managing database objects.
2. Collections Used
Frequent use of ArrayList, LinkedList, HashMap, and occasional Set.
3. HashMap vs Hashtable
HashMapis not thread‑safe, faster, and allows null keys/values; Hashtable is thread‑safe, slower, and disallows null entries.
4. synchronized and volatile
synchronizedprovides mutual exclusion for methods, blocks, or classes (object lock vs class lock). volatile guarantees memory visibility of a variable across threads.
5. Singleton Pattern
The singleton ensures a single instance, typically implemented with a public static field, a private constructor, and a public accessor method; eager (hungry) and lazy (lazy) initialization are the two main styles.
6. Singleton Thread‑Safety & Double‑Checked Locking
Without proper synchronization, lazy initialization can create multiple instances; double‑checked locking uses a synchronized block around the instance creation to guarantee only one object.
7. Java Thread Pool Types
Four common factories: newFixedThreadPool (fixed size), newCachedThreadPool (dynamic), newScheduledThreadPool (timed tasks), and newSingleThreadExecutor (single thread).
8. Spring Boot AOP
AOP inserts behavior before or after the original method execution without changing the core logic, commonly used for logging and transaction handling.
9. Spring Container Knowledge
The candidate mentioned bean lifecycle steps: component scanning → BeanFactory → BeanDefinition → injection and proxy creation, but could not elaborate further.
10. Other Spring Features
Unclear answer; the candidate recognized Spring’s broader ecosystem but did not specify additional functionalities.
11. Redis Usage, Cache Penetration & Eviction
Redis is used for fast data access rather than traditional caching. Cache penetration occurs when many requests query non‑existent keys, potentially overloading the database; solutions include proper key design and Bloom filters. Cache avalanche refers to massive key expiration causing a sudden DB load; mitigation involves staggering TTLs and distributed deployment. Common eviction policies (LRU, LFU, TTL, etc.) were outlined with diagrams.
12. Closing Remarks
The candidate expressed confidence in learning ability, willingness to improve technical breadth, and a positive attitude toward future growth.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
