home / java / must-prepare-topic-before-attending-any-java-backend-interview
Java

Must Prepare Topic Before Attending Any Java Backend Interview

1. Java Core

  • What are the differences between JDK, JRE, and JVM?
  • How does the JVM manage memory?
  • Explain Heap vs Stack.
  • What causes OutOfMemoryError?
  • What causes StackOverflowError?
  • How does Garbage Collection work?
  • What GC algorithms are available?
  • Explain equals() vs ==.
  • Why should hashCode() be overridden with equals()?
  • Explain immutable classes.
  • How does String Pool work?
  • Explain volatile.
  • What is synchronization?
  • What is Reentrant Lock?
  • Explain Atomic classes.
  • Explain ExecutorService.
  • Callable vs Runnable.
  • Future vs CompletableFuture.
  • How does ConcurrentHashMap work?
  • Explain fail-fast vs fail-safe iterators.

2. Java 8

  • Functional Interface
  • Lambda Expressions
  • Method References
  • Stream API
  • Parallel Stream
  • Optional
  • Collectors
  • GroupingBy
  • PartitioningBy
  • FlatMap
  • Reduce
  • Default Methods
  • Date & Time API

Coding questions:

  • Find duplicate elements
  • Count frequency
  • Top N salaries
  • Second highest salary
  • Group employees by department
  • Merge lists
  • Remove duplicates
  • Find longest string

3. Spring Boot

  • Why Spring Boot?
  • Spring Boot Auto Configuration
  • Starter Dependencies
  • Spring Boot Lifecycle
  • Bean Lifecycle
  • Bean Scope
  • @Component vs @Bean
  • @Autowired vs Constructor Injection
  • @Value vs @ConfigurationProperties
  • Profiles
  • External Configuration
  • Actuator
  • Spring Boot Logging
  • Exception Handling
  • Validation
  • Filters
  • Interceptors

4. Spring Security + JWT

  • Authentication vs Authorization
  • Security Filter Chain
  • JWT Flow
  • Stateless Authentication
  • Refresh Token
  • Access Token
  • OAuth2
  • CORS
  • CSRF
  • Password Encoding
  • Method Security
  • Custom Authentication Filter

5. JPA & Hibernate

You’ve already covered most of these, but revise:

  • Entity States
  • Persistence Context
  • First-Level Cache
  • Second-Level Cache
  • Lazy vs Eager
  • N+1 Problem
  • Cascade Types
  • Orphan Removal
  • Fetch Join
  • JPQL
  • Criteria API
  • Hibernate Filters
  • Optimistic Locking
  • Pessimistic Locking
  • Dirty Checking
  • Transactions
  • Batch Processing

6. SQL

  • Joins
  • Indexes
  • Composite Index
  • Clustered vs Non-clustered Index
  • Execution Plan
  • Explain Analyze
  • ACID
  • Isolation Levels
  • Deadlock
  • Locking
  • MVCC
  • Window Functions
  • CTE
  • Stored Procedure
  • Trigger
  • Pagination

Coding:

  • Nth Highest Salary
  • Duplicate Records
  • Running Total
  • Rank
  • Dense Rank
  • Department-wise highest salary
  • Recursive queries

7. Microservices

  • Why Microservices?
  • Monolith vs Microservices
  • Service Discovery
  • API Gateway
  • Config Server
  • Circuit Breaker
  • Retry
  • Bulkhead
  • Rate Limiting
  • Distributed Transactions
  • Saga Pattern
  • Event-driven Architecture
  • Synchronous vs Asynchronous Communication
  • REST vs Messaging
  • Idempotency
  • API Versioning

8. Docker

  • Docker Architecture
  • Dockerfile
  • Image vs Container
  • Volume
  • Network
  • Multi-stage Build
  • Docker Compose
  • Health Check

9. Kubernetes

  • Pod
  • ReplicaSet
  • Deployment
  • Service
  • Ingress
  • ConfigMap
  • Secret
  • Namespace
  • Persistent Volume
  • Liveness Probe
  • Readiness Probe
  • HPA
  • Rolling Update
  • Rollback

10. Observability (Very Hot Topic)

Since we discussed this today.

  • What is Observability?
  • Monitoring vs Observability
  • Three Pillars
  • Metrics
  • Logs
  • Traces
  • Distributed Tracing
  • What is OpenTelemetry?
  • OpenTelemetry Architecture
  • OpenTelemetry Collector
  • Java Agent
  • Custom Instrumentation
  • Prometheus
  • Grafana
  • Loki
  • Elasticsearch
  • Jaeger
  • Grafana Tempo
  • Trace ID
  • Span ID
  • PromQL
  • Alerting

Scenario Questions:

  • API is slow. How do you investigate?
  • Database deadlock occurred.
  • CPU is high.
  • Memory leak.
  • Service A calling Service B failed.
  • Kafka consumer lag increased.

11. Kafka

  • Kafka Architecture
  • Topic
  • Partition
  • Offset
  • Consumer Group
  • Rebalancing
  • Replication
  • Producer Acknowledgement
  • ISR
  • Idempotent Producer
  • Exactly Once
  • Retry
  • DLQ

12. Redis

  • Why Redis?
  • Cache Aside
  • Write Through
  • Write Back
  • Redis Data Types
  • TTL
  • Pub/Sub
  • Distributed Lock
  • Cache Eviction

13. System Design

Design:

  • URL Shortener
  • Parking Lot
  • WhatsApp
  • BookMyShow
  • Food Delivery
  • Hotel Booking
  • Payment System
  • Notification System

Concepts:

  • Load Balancer
  • CDN
  • Caching
  • Sharding
  • Replication
  • Partitioning
  • CAP Theorem
  • Consistent Hashing
  • Database Scaling

14. DevOps

  • CI/CD
  • Jenkins
  • GitHub Actions
  • Argo CD
  • GitOps
  • Blue-Green Deployment
  • Canary Deployment
  • Rolling Update

15. AWS Basics

  • EC2
  • S3
  • RDS
  • IAM
  • VPC
  • ELB
  • Auto Scaling
  • CloudWatch
  • ECS
  • EKS

16. Scenario-Based Questions (Most Important)

These are very common in interviews:

  • Your application suddenly becomes slow. How will you investigate?
  • Memory usage keeps increasing every day. What will you do?
  • CPU utilization is 100%. How will you debug it?
  • One microservice is timing out. Where do you start?
  • Database deadlocks are occurring frequently.
  • Kafka messages are not being consumed.
  • One service is returning 500 errors.
  • A deployment failed after release. How will you rollback?
  • How do you debug production issues without direct server access?
  • How do you identify which microservice is causing latency?
  • How would you design a highly available payment system?
  • What happens when one service is down in a microservice architecture?
  • How do you prevent duplicate order creation?
  • How would you handle distributed transactions?

17. Coding (DSA)

For product companies, don’t skip this.

  • Arrays
  • Strings
  • HashMap
  • Stack
  • Queue
  • Linked List
  • Binary Tree
  • BST
  • Heap
  • Graph
  • BFS
  • DFS
  • Sliding Window
  • Two Pointer
  • Binary Search
  • Dynamic Programming (basic)