Java Backend Engineer Interview

Home PDF Audio

Java Core (20 points)

  1. Understanding of OOP principles: Encapsulation, Inheritance, Polymorphism, Abstraction.

  2. Generics in Java: Use of type parameters, bounded types, and wildcard generics.

  3. Multithreading in Java: Creating threads, thread lifecycle, and inter-thread communication.

  4. JVM memory management: Heap, Stack, PermGen/Survivor spaces, garbage collection algorithms.

  5. Exception handling: Checked and unchecked exceptions, try-catch blocks, finally, and multi-catch.

  6. Serialization in Java: Serializable interface, custom serialization with writeObject and readObject.

  7. Java Collections Framework: List, Set, Map, Queue interfaces and their implementations.

  8. Lambda expressions and functional interfaces: Using predicates, consumers, suppliers, and functions.

  9. Stream API: Intermediate and terminal operations, parallel streams, and stream pipelining.

  10. Reflection API: Accessing classes, methods, and fields at runtime, annotation processing.

  11. Java IO vs NIO: Differences in file handling, channel-based I/O, and non-blocking I/O.

  12. Java Date and Time API: Working with LocalDate, LocalDateTime, and Duration.

  13. Java Networking: Socket programming, URL connections, and HTTP clients.

  14. Java Security: Cryptography, digital signatures, and secure coding practices.

  15. Java Modules: Understanding of JPMS (Java Platform Module System) and modularity.

  16. Java Enumerations: Use of enums, ordinal values, and custom methods in enums.

  17. Java Annotations: Built-in annotations, custom annotations, and annotation processing.

  18. Java Concurrency Utilities: CountDownLatch, CyclicBarrier, Semaphore, and Exchanger.

  19. Java Memory Leaks: Causes, detection, and prevention strategies.

  20. Java Performance Tuning: JVM options, profiling tools, and memory optimization techniques.

Spring Ecosystem (20 points)

  1. Spring IoC container: Dependency injection, bean lifecycle, and scope.

  2. Spring Boot auto-configuration: How Spring Boot automatically configures beans.

  3. Spring Data JPA: Repository patterns, CRUD operations, and query methods.

  4. Spring Security: Authentication, authorization, and securing REST APIs.

  5. Spring MVC: Controller methods, request mapping, and view resolution.

  6. Spring Cloud: Service discovery with Eureka, load balancing with Ribbon.

  7. Spring AOP: Aspect Oriented Programming, cross-cutting concerns, and advice types.

  8. Spring Boot Actuator: Monitoring endpoints, health checks, and metrics collection.

  9. Spring Profiles: Environment-specific configurations and profile activation.

  10. Spring Boot Starter Dependencies: Use of starters to simplify dependency management.

  11. Spring Integration: Integrating different systems, messaging, and adapters.

  12. Spring Batch: Batch processing, job scheduling, and step implementations.

  13. Spring Cache: Caching strategies, annotations, and cache managers.

  14. Spring WebFlux: Reactive programming, non-blocking I/O, and WebFlux frameworks.

  15. Spring Cloud Config: Centralized configuration management for microservices.

  16. Spring Cloud Gateway: API gateway patterns, routing, and filtering.

  17. Spring Boot Testing: Using @SpringBootTest, MockMvc, and TestRestClient.

  18. Spring Data REST: Exposing repositories as RESTful services.

  19. Spring Cloud Stream: Integration with message brokers like RabbitMQ and Kafka.

  20. Spring Cloud Sleuth: Distributed tracing and logging in microservices.

Microservices Architecture (20 points)

  1. Service Discovery: How Eureka, Consul, and Zookeeper work.

  2. API Gateway: Patterns, routing, and security in API gateways.

  3. Circuit Breaker: Implementing resilience with Hystrix, Resilience4j.

  4. Event-Driven Architecture: Event sourcing, message brokers, and event handlers.

  5. RESTful API Design: HATEOAS, stateless design, and REST constraints.

  6. GraphQL: Implementing GraphQL APIs, schema definitions, and resolvers.

  7. Microservices Communication: Synchronous vs asynchronous communication.

  8. Saga Pattern: Managing distributed transactions across services.

  9. Health Checks: Implementing liveness and readiness probes.

  10. Contract First Development: Using Swagger for API contracts.

  11. API Versioning: Strategies for versioning RESTful APIs.

  12. Rate Limiting: Implementing rate limits to prevent abuse.

  13. Circuit Breaker Patterns: Implementing fallbacks and retries.

  14. Microservices Deployment: Using Docker, Kubernetes, and cloud platforms.

  15. Service Mesh: Understanding Istio, Linkerd, and their benefits.

  16. Event Collaboration: Saga vs Choreography patterns.

  17. Microservices Security: OAuth2, JWT, and API gateways.

  18. Monitoring and Tracing: Tools like Prometheus, Grafana, and Jaeger.

  19. Microservices Testing: Integration testing, contract testing, and end-to-end testing.

  20. Database per Service: Data management and consistency in microservices.

Databases and Caching (20 points)

  1. SQL Joins: Inner, outer, left, right, and cross joins.

  2. ACID Properties: Atomicity, Consistency, Isolation, Durability in transactions.

  3. NoSQL Databases: Document stores, key-value stores, and graph databases.

  4. Redis Caching: In-memory data store, data structures, and persistence options.

  5. Memcached vs Redis: Comparing caching solutions.

  6. Database Sharding: Horizontal partitioning and load balancing.

  7. ORM Frameworks: Hibernate, MyBatis, and JPA specifications.

  8. JDBC Connection Pooling: DataSource implementations and connection lifecycle.

  9. Full-Text Search: Implementing search in databases like Elasticsearch.

  10. Time-Series Databases: InfluxDB, OpenTSDB for time-based data.

  11. Transaction Isolation Levels: Read uncommitted, read committed, repeatable read, serializable.

  12. Indexing Strategies: B-tree, hash indexes, and composite indexes.

  13. Database Replication: Master-slave, master-master setups.

  14. Database Backup and Recovery: Strategies for data protection.

  15. Database Profiling: Tools like SQL Profiler, slow query logs.

  16. NoSQL Consistency Models: Eventual consistency, CAP theorem.

  17. Database Migrations: Using Flyway, Liquibase for schema changes.

  18. Caching Strategies: Cache-aside, read-through, write-through patterns.

  19. Cache Invalidation: Managing cache expiration and invalidation.

  20. Database Connection Pooling: HikariCP, Tomcat JDBC pool configurations.

Concurrency and Multithreading (20 points)

  1. Thread Lifecycle: New, runnable, running, blocked, waiting, terminated.

  2. Synchronization Mechanisms: Locks, synchronized blocks, and intrinsic locks.

  3. Reentrant Locks: Benefits over synchronized blocks, fairness, and timeouts.

  4. Executor Framework: ThreadPoolExecutor, ExecutorService, and thread pool configurations.

  5. Callable vs Runnable: Differences and use cases.

  6. Java Memory Model: Visibility, happens-before relationships, and memory consistency.

  7. Volatile Keyword: Ensuring visibility of variable changes across threads.

  8. Deadlock Prevention: Avoiding and detecting deadlocks.

  9. Asynchronous Programming: Using CompletableFuture for non-blocking operations.

  10. ScheduledExecutorService: Scheduling tasks with fixed rates and delays.

  11. Thread Pools: Fixed, cached, and scheduled thread pools.

  12. Lock Striping: Reducing lock contention with striped locks.

  13. Read-Write Locks: Allowing multiple readers or a single writer.

  14. Wait and Notify Mechanisms: Inter-thread communication using wait/notify.

  15. Thread Interruption: Handling interrupts and designing interruptible tasks.

  16. Thread-Safe Classes: Implementing thread-safe singleton patterns.

  17. Concurrency Utilities: CountDownLatch, CyclicBarrier, Semaphore.

  18. Java 8+ Concurrency Features: Parallel streams, fork-join framework.

  19. Multicore Programming: Challenges and solutions for parallel processing.

  20. Thread Dumps and Analysis: Identifying issues with thread dumps.

Web Servers and Load Balancing (20 points)

  1. Apache Tomcat Configuration: Setting up connectors, context.xml, and server.xml.

  2. Nginx as Reverse Proxy: Configuring proxy_pass, upstream servers, and load balancing.

  3. HAProxy for High Availability: Setting up failover and session persistence.

  4. Web Server Security: SSL/TLS configurations, security headers, and firewall rules.

  5. Load Balancing Algorithms: Round Robin, Least Connections, IP Hash.

  6. Server-Side Caching: Using Varnish, Redis, or in-memory caches.

  7. Monitoring Tools: Using Prometheus, Grafana, and New Relic for server monitoring.

  8. Logging in Production: Centralized logging with ELK stack or Graylog.

  9. Horizontal vs Vertical Scaling: Understanding trade-offs and use cases.

  10. Web Server Performance Tuning: Adjusting worker threads, connection timeouts, and buffers.

  11. Reverse Proxy Caching: Configuring cache headers and expiration.

  12. Web Server Load Testing: Tools like Apache JMeter, Gatling for performance testing.

  13. SSL Offloading: Handling SSL/TLS termination at the load balancer.

  14. Web Server Hardening: Security best practices and vulnerability assessments.

  15. Dynamic vs Static Content Serving: Optimizing server configurations.

  16. Web Server Clustering: Setting up clusters for high availability.

  17. Web Server Authentication: Implementing basic, digest, and OAuth authentication.

  18. Web Server Logging Formats: Common log formats and parsing tools.

  19. Web Server Resource Limits: Configuring limits on connections, requests, and bandwidth.

  20. Web Server Backup and Recovery: Strategies for disaster recovery.

CI/CD and DevOps (20 points)

  1. Jenkins Pipeline as Code: Writing Jenkinsfiles for CI/CD pipelines.

  2. Docker Containerization: Dockerfile creation, multi-stage builds, and container orchestration.

  3. Kubernetes Orchestration: Deployments, services, pods, and scaling strategies.

  4. GitOps Principles: Using Git for infrastructure and configuration management.

  5. Maven and Gradle Build Tools: Dependency management, plugins, and build lifecycle.

  6. Unit and Integration Testing: Writing tests with JUnit, Mockito, and TestNG.

  7. Code Coverage Tools: Using Jacoco for measuring code coverage.

  8. Static Code Analysis: Tools like SonarQube for code quality checks.

  9. Infrastructure as Code (IaC): Using Terraform, CloudFormation for infrastructure provisioning.

  10. Blue/Green Deployments: Minimizing downtime during deployments.

  11. Canary Deployments: Gradual rollout of new features.

  12. Automated Testing in CI Pipelines: Integrating tests with build stages.

  13. Environment Management: Using Ansible, Chef, or Puppet for configuration management.

  14. CI/CD Best Practices: Continuous integration, continuous deployment, and continuous delivery.

  15. Rollback Strategies: Implementing automated rollbacks on deployment failures.

  16. Security Scanning: Incorporating security checks like SAST, DAST in pipelines.

  17. CI/CD Pipelines for Microservices: Managing pipelines for multiple services.

  18. Monitoring CI/CD Pipelines: Alerting on pipeline failures and performance issues.

  19. DevOps Tools Ecosystem: Understanding tools like Docker, Kubernetes, Jenkins, Ansible.

  20. CI/CD for Cloud-Native Applications: Deploying applications on cloud platforms.

Design Patterns and Best Practices (20 points)

  1. Singleton Pattern: Implementing thread-safe singletons.

  2. Factory Pattern: Creating objects without specifying the exact class.

  3. Strategy Pattern: Encapsulating algorithms and switching between them.

  4. SOLID Principles: Understanding and applying Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion.

  5. Dependency Injection: Reducing coupling and increasing code maintainability.

  6. Event Sourcing Pattern: Storing events to reconstruct application state.

  7. CQRS Architecture: Separating command and query responsibilities.

  8. Designing for Scalability: Using horizontal scaling, sharding, and load balancing.

  9. Code Refactoring Techniques: Extracting methods, renaming variables, and simplifying conditionals.

  10. Clean Code Practices: Writing readable, maintainable, and self-documenting code.

  11. Test-Driven Development (TDD): Writing tests before implementation.

  12. Code Versioning: Using Git branching strategies like GitFlow, Trunk-Based Development.

  13. Designing for Maintainability: Using modular design, separation of concerns.

  14. Anti-Patterns to Avoid: God classes, spaghetti code, and tight coupling.

  15. Designing for Security: Implementing least privilege, defense in depth.

  16. Designing for Performance: Optimizing algorithms, reducing I/O operations.

  17. Designing for Reliability: Implementing redundancy, fault tolerance, and error handling.

  18. Designing for Extensibility: Using plugins, extensions, and open APIs.

  19. Designing for Usability: Ensuring APIs are intuitive and well-documented.

  20. Designing for Testability: Writing code that is easy to test and mock.

Security (20 points)

  1. OAuth2 and JWT: Implementing token-based authentication.

  2. Role-Based Access Control (RBAC): Assigning roles and permissions to users.

  3. Security Headers: Implementing Content Security Policy, X-Frame-Options.

  4. SQL Injection Prevention: Using prepared statements and parameterized queries.

  5. Cross-Site Scripting (XSS) Protection: Sanitizing inputs and outputs.

  6. Encryption and Decryption: Using AES, RSA for data protection.

  7. Secure Coding Practices: Avoiding common vulnerabilities like buffer overflows.

  8. Implementing Audit Trails: Logging user actions and system events.

  9. Handling Sensitive Data: Storing passwords securely with hashing algorithms.

  10. Compliance with Regulations: GDPR, PCI-DSS, and data protection laws.

  11. Implementing Two-Factor Authentication (2FA): Adding an extra layer of security.

  12. Security Testing: Penetration testing, vulnerability assessments.

  13. Secure Communication Protocols: Implementing SSL/TLS for data encryption.

  14. Secure Session Management: Managing session tokens and timeouts.

  15. Implementing Web Application Firewalls (WAF): Protecting against common attacks.

  16. Security Monitoring and Alerting: Using tools like SIEM for threat detection.

  17. Security Best Practices in Microservices: Securing service-to-service communication.

  18. Implementing CAPTCHA for Bot Protection: Preventing automated attacks.

  19. Security in CI/CD Pipelines: Scanning for vulnerabilities during builds.

  20. Implementing Security by Design: Incorporating security from the start of the development process.

Performance Tuning and Optimization (20 points)

  1. Profiling Java Applications: Using tools like JProfiler, VisualVM for performance analysis.

  2. Garbage Collection Tuning: Adjusting GC parameters for performance.

  3. Database Query Optimization: Indexing, query rewriting, and using explain plans.

  4. Caching Strategies: Using distributed caches, cache invalidation mechanisms.

  5. Load Testing and Stress Testing: Identifying performance bottlenecks.

  6. Optimizing RESTful APIs: Reducing response times, minimizing data transfer.

  7. Reducing Network Latency: Using CDNs, optimizing API calls.

  8. Connection Pool Sizing: Determining optimal pool sizes for databases and connections.

  9. Monitoring and Alerting Setups: Using Prometheus, Grafana for real-time monitoring.

  10. Identifying and Resolving Bottlenecks: Profiling CPU, memory, and I/O usage.

  11. Optimizing Java Heap Settings: Setting appropriate heap sizes for different environments.

  12. Reducing Garbage Collection Pauses: Using G1GC, ZGC for low-latency applications.

  13. Optimizing Disk I/O: Using SSDs, RAID configurations, and file system optimizations.

  14. Caching vs Storing: Deciding when to cache data versus storing it in a database.

  15. Optimizing Logging: Reducing logging overhead and managing log volumes.

  16. Optimizing Concurrent Access: Using locks efficiently and minimizing contention.

  17. Profiling Memory Usage: Identifying memory leaks and optimizing object allocations.

  18. Optimizing Thread Pool Sizes: Balancing between too few and too many threads.

  19. Optimizing Data Structures: Choosing the right data structures for specific use cases.

  20. Performance Metrics and KPIs: Defining and tracking key performance indicators for applications.


Back java.interview.en.md Donate