The interview mainly focused on Java internals, system design basics and distributed systems.
1. Retry mechanism – disadvantages
Explain problems with retries in distributed systems (duplicate requests, cascading failures, increased load, thundering herd, idempotency issues, etc.).
2. Design a cache system
High-level cache design – eviction strategy, TTL, consistency, read-through / write-through, local vs distributed cache, failure handling.
3. What is Jitter?
Why jitter is added to retry / backoff strategies and how it helps avoid retry storms.
4. System.arraycopy()
How it works internally, performance benefits compared to manual copy, native implementation, and when to use it.
5. Types of Garbage Collection in Java
Different GC algorithms (Serial, Parallel, CMS, G1, ZGC / Shenandoah) and when each is suitable.
6. Java Stream API – handling Map
Operations on Map using streams – converting Map to stream, grouping, filtering, collecting to Map, handling duplicate keys in collectors.
7. Kafka acknowledgement configuration
Explanation of acks=0, acks=1, acks=all and trade-offs between performance and durability.
8. SQL – find second highest salary
Different approaches (subquery, DISTINCT, LIMIT/OFFSET, window functions like DENSE_RANK()).
9. HashMap internal working
How HashMap works internally (hashing, buckets, collision handling, treeification)
HashMap vs ConcurrentHashMap
When and how HashMap resizes
Effect of initial capacity and load factor