Saravanan's Corner: Blackberry Dev

Monday, 28 July 2025

Top 3 tricky Interview questions

 2025: In this Code Decode video, we break down the top 3 tricky senior developer interview questions and their answers.


Udemy Course Discounted coupon code

https://www.udemy.com/...



Interview questions 


✅ What is a Cold Start in Spring Boot?

Understand why your app’s startup time can cause autoscaling failures, serverless timeouts, and production delays — and learn how to fix it.


✅ Real Cold Start Optimization Techniques:


Use of /actuator/startup to find bottlenecks


Enable lazy initialization


Exclude unused auto-configurations


Tweak DB and Liquibase setup


Use Spring AOT + GraalVM Native Image to reduce startup to lest than 1 second


✅ REST vs gRPC vs Event-Driven: What’s Best in 2025?

We explain:


When to use REST for simplicity


When to choose gRPC for speed


Why event-driven architecture is the backbone of scalable, decoupled systems


Real-world hybrid strategies that work in production


✅ Handling Breaking API Changes in Microservices

Learn how to implement:


API versioning


Separate DTOs for v1/v2


Feature toggles


Contract testing (Spring Cloud Contract)


Safe rollout and deprecation strategies


✅ Dealing with Large File Uploads in Spring Boot


Avoid memory bloat with streaming


Secure your uploads with size limits, antivirus, and safe naming


Scale to 100MB+ using pre-signed URLs (e.g., S3)


Offload heavy processing to background queues (Kafka, RabbitMQ)


🚨 Plus:

We cover the top 10 real production issues in Spring Boot microservices — from memory leaks, thread pool exhaustion, and cascading failures to logging, observability, and retry nightmares — with proactive fixes you can apply today.


Mock Interview Playlist:

    • Mock Interviews (Face ...  


Most Asked Core Java Interview Questions and Answers:     • Core Java frequently a...  


Advance Java Interview Questions and Answers:     • Advance Java Interview...  


Java 8 Interview Questions and Answers:

     • Java 8 Interview Quest...  


Hibernate Interview Questions and Answers:

    • Hibernate Interview Qu...  


Spring Boot Interview Questions and Answers: 

    • Advance Java Interview...  


Angular Playlist: 

     • Angular Course Introdu...  

SQL Playlist:     • SQL Interview Question...  


GIT:     • GIT  


Subscriber and Follow Code Decode

Subscriber Code Decode: https://www.youtube.co...

LinkedIn :    / codedecodeyoutube   

Instagram:    / codedecode25  


#seniordev #codedecode #interviewquestions

Saturday, 19 July 2025

Java Interview - Kumaran

  1.  Core Java 8 and above 
  2.  JDK/JVM/JRE, 
  3. JVM Memory Meta Space, 
  4. Collection Framework – 
  5. Immutability, 
  6. Exception Handling - 
  7. Custom Exceptions, 
  8. Multithreading concepts - 
  9. Executor Frameworks, 
  10. Thread racing conditions, 
  11. Design Patterns, 
  12. synchronization, 
  13. object locks,
  14.  Concurrency Collections ( fail-fast - Fail Safe ), 
  15. Stream API, Lambda, Functional Interface, Coding Skill in Streams, 
  16. Date Time API 
  17. SOLID Principles,
  18. Candidate must have exposure to HTML, CSS, and JSP is an advantage and not a must.
  19. JDBC,
  20. Spring MVC, 
  21. Spring Boot (Version 2.7 or more is a MUST),
  22. JPA/Hibernate, 
  23. Restful Micro Services 
  24. Spring framework Fundamentals - 
  25. Dispatcher Servlet, 
  26. Spring Beans - Lifecycle, 
  27. Bean's Scope 
  28. Spring Configuration, 
  29. Spring JDBC, 
  30. ACID, 
  31. Spring ORM integration
  32. Spring AOP
  33. Logging Mechanism
  34. Exception Handling, 
  35. Spring Security
  36. Thread Local, 
  37. Transactions, 
  38. Spring Annotations, 
  39. Auto Configuration,
  40. Basic BOOT internals, 
  41. Spring Cloud – projects,
  42. JWT – Oath, 
  43. API Gateway, 
  44. Eureka Discovery Service, 
  45. Config Server, 
  46. Circuit Breakers, 
  47. Actuator, 
  48. Dev Tools, 
  49. Spring DATA JPA,
  50. Transaction Propagation,
  51. Pagination And Sorting, 
  52. Annotations,
  53. Exception Handling, 
  54. Rest Template, 
  55. Web Client, 
  56. Feign Client, 
  57. Load Balancing, 
  58. Response Error Handler, 
  59. Conditional Bean Creation, 
  60. Micro Service Communication: 
  61. Rest Template, 
  62. Web Client, 
  63. Kafka Streaming, 
  64. PUB/SUB
  65. Hibernate -
  66. Persistence Context, 
  67. Hibernate Core, 
  68. Second Level Cache Configuration, 
  69. Session Factory/Session, 
  70. Update vs Merge, 
  71. Get vs Load, 
  72. N+1 Problem, 
  73. Fetch Type - EAGER, LAZY
  74. @GeneratedValue – Strategy, 
  75. Connection Pool, 
  76. Composite Primary Key - 
  77. Embed, 
  78. Embeddable Concepts,
  79. One to many, 
  80. one to one 
  81. database: Oracle / SQL / PostgreSQL.
  82. Oops Concept – Multithreading and annotation are a Must.
  83. The candidate should be comfortable working in Git, and GitHub.Should be experienced in Maven/Gradle Build – Added Advantage.
  84. SQL - Data modelling,
  85. Aggregation, 
  86. Indexing, 
  87. Projection,
  88. Replication, 
  89. Query / Optimisation, 
  90. File systems
  91. Tomcat/WebLogic or any server exposure - 
  92. Tomcat configuration, 
  93. Application server – JBoss / WebLogic, 
  94. Bridge, 
  95. Queue, 
  96. connection pool configuration, 
  97. Load Balancing
  98. Build Process - Ant, Maven build process, CI/CD pipeline
  99. Unit Testing: JUnit/XUnit/NUnit – Added Advantage.
  100. SDLC - JIRA - Must have worked in Jira / Similar Agile tools and should be familiar with Epic, Story creation, grooming, task / sub-task creation, GIT Repository /  DevOps tools
  101. Methodologies: Agile/Waterfall
  102. Tech Design Skills - Analysis, Design and Documentation of HLD and supporting SRD, estimation techniques, etc
  103. DevOps Tools: Jenkins, CI/CD, Docker, Kubernetes- Added Advantage
  104. Familiarity with cloud platforms (AWS / Azure / GCP) – Added advantage, not a must.
  105. LLD Preparation, HLD Preparation and Sequence Diagram,
  106. Methodology in SDLC
  107. Understanding of front-end technologies like HTML/CSS/Bootstrap/ Angular/React (basic level)
  108. Deep understanding of Agile/Scrum, Kanban, and hybrid methodologies
  109. Experience in BFSI, or Finance domain – added advantage and not a must.p ll
  110. Experience with JIRA, Confluence, MS Project, or equivalent project management tools – Added Advantage and not a must.
  111. Experience with successful team handling experience delivering web-based software solutions
  112. SQL -Data modelling,  Aggregation, Indexing, Projection, Replication, Query / Optimisation, File systems, Joins, Index, Stored Procedures.

 andidate must have exposure to HTML, CSS, and JSP is an advantage and not a must.


Should have hands-on experience in JDBC, Spring MVC, Spring Boot (Version 2.7 or more is a MUST), JPA/Hibernate, and Restful Micro Services - Spring framework Fundamentals - Dispatcher Servlet, Spring Beans - Lifecycle, Bean's Scope Spring Configuration, Spring JDBC, ACID, Spring ORM integration, Spring AOP - Logging Mechanism- Exception Handling, Spring Security - Thread Local, Transactions, Spring Annotations, Auto Configuration, Basic BOOT internals, Spring Cloud – projects, JWT – Oath, API Gateway, Eureka Discovery Service, Config Server, Circuit Breakers, Actuator, Dev Tools, Spring DATA JPA, Transaction Propagation, Pagination And Sorting, Annotations, Exception Handling, Rest Template, Web Client, Feign Client, Load Balancing, Response Error Handler, Conditional Bean Creation, Micro Service Communication: Rest Template, Web Client, Kafka Streaming, PUB/SUB


Hibernate - Persistence Context, Hibernate Core, Second Level Cache Configuration, Session Factory/Session, Update vs Merge, Get vs Load, N+1 Problem, Fetch Type - EAGER, LAZY, @GeneratedValue – Strategy, Connection Pool, Composite Primary Key - Embed, Embeddable Concepts, One to many, one to one database: Oracle / SQL / PostgreSQL.


Oops Concept – Multithreading and annotation are a Must.


The candidate should be comfortable working in Git, and GitHub.Should be experienced in Maven/Gradle Build – Added Advantage. SQL - Data modelling,  Aggregation, Indexing, Projection, Replication, Query / Optimisation, File systems


Tomcat/WebLogic or any server exposure - Tomcat configuration, Application server – JBoss / WebLogic, Bridge, Queue, connection pool configuration, Load Balancing


Build Process - Ant, Maven build process, CI/CD pipeline


Unit Testing: JUnit/XUnit/NUnit – Added Advantage.


SDLC - JIRA - Must have worked in Jira / Similar Agile tools and should be familiar with Epic, Story creation, grooming, task / sub-task creation, GIT Repository /  DevOps tools


Methodologies: Agile/Waterfall


Tech Design Skills - Analysis, Design and Documentation of HLD and supporting SRD, estimation techniques, etc


DevOps Tools: Jenkins, CI/CD, Docker, Kubernetes- Added Advantage


Familiarity with cloud platforms (AWS / Azure / GCP) – Added advantage, not a must.


LLD Preparation, HLD Preparation and Sequence Diagram,


Methodology in SDLC


Understanding of front-end technologies like HTML/CSS/Bootstrap/ Angular/React (basic level)


Deep understanding of Agile/Scrum, Kanban, and hybrid methodologies


Experience in BFSI, or Finance domain – added advantage and not a must.


Experience with JIRA, Confluence, MS Project, or equivalent project management tools – Added Advantage and not a must.


Experience with successful team handling experience delivering web-based software solutions


SQL -Data modelling,  Aggregation, Indexing, Projection, Replication, Query / Optimisation, File systems, Joins, Index, Stored Procedures.


 


Brush up on all so that you can answer clearly.


All the best.


Do Well.

 andidate must have exposure to HTML, CSS, and JSP is an advantage and not a must.

Should have hands-on experience in JDBC, Spring MVC, Spring Boot (Version 2.7 or more is a MUST), JPA/Hibernate, and Restful Micro Services - Spring framework Fundamentals - Dispatcher Servlet, Spring Beans - Lifecycle, Bean's Scope Spring Configuration, Spring JDBC, ACID, Spring ORM integration, Spring AOP - Logging Mechanism- Exception Handling, Spring Security - Thread Local, Transactions, Spring Annotations, Auto Configuration, Basic BOOT internals, Spring Cloud – projects, JWT – Oath, API Gateway, Eureka Discovery Service, Config Server, Circuit Breakers, Actuator, Dev Tools, Spring DATA JPA, Transaction Propagation, Pagination And Sorting, Annotations, Exception Handling, Rest Template, Web Client, Feign Client, Load Balancing, Response Error Handler, Conditional Bean Creation, Micro Service Communication: Rest Template, Web Client, Kafka Streaming, PUB/SUB

Hibernate - Persistence Context, Hibernate Core, Second Level Cache Configuration, Session Factory/Session, Update vs Merge, Get vs Load, N+1 Problem, Fetch Type - EAGER, LAZY, @GeneratedValue – Strategy, Connection Pool, Composite Primary Key - Embed, Embeddable Concepts, One to many, one to one database: Oracle / SQL / PostgreSQL.

Oops Concept – Multithreading and annotation are a Must.

The candidate should be comfortable working in Git, and GitHub.Should be experienced in Maven/Gradle Build – Added Advantage. SQL - Data modelling,  Aggregation, Indexing, Projection, Replication, Query / Optimisation, File systems

Tomcat/WebLogic or any server exposure - Tomcat configuration, Application server – JBoss / WebLogic, Bridge, Queue, connection pool configuration, Load Balancing

Build Process - Ant, Maven build process, CI/CD pipeline

Unit Testing: JUnit/XUnit/NUnit – Added Advantage.

SDLC - JIRA - Must have worked in Jira / Similar Agile tools and should be familiar with Epic, Story creation, grooming, task / sub-task creation, GIT Repository /  DevOps tools

Methodologies: Agile/Waterfall

Tech Design Skills - Analysis, Design and Documentation of HLD and supporting SRD, estimation techniques, etc

DevOps Tools: Jenkins, CI/CD, Docker, Kubernetes- Added Advantage

Familiarity with cloud platforms (AWS / Azure / GCP) – Added advantage, not a must.

LLD Preparation, HLD Preparation and Sequence Diagram,

Methodology in SDLC

Understanding of front-end technologies like HTML/CSS/Bootstrap/ Angular/React (basic level)

Deep understanding of Agile/Scrum, Kanban, and hybrid methodologies

Experience in BFSI, or Finance domain – added advantage and not a must.

Experience with JIRA, Confluence, MS Project, or equivalent project management tools – Added Advantage and not a must.

Experience with successful team handling experience delivering web-based software solutions

SQL -Data modelling,  Aggregation, Indexing, Projection, Replication, Query / Optimisation, File systems, Joins, Index, Stored Procedures.

 

Brush up on all so that you can answer clearly.

All the best.

Do Well.

Friday, 18 July 2025

Key Microservices for a Simple Uber System:

Key Microservices for a Simple Uber System:
  1. 1. Customer Service:
    Handles customer-related functions like authentication, profile management, and ride history. 
  2. 2. Driver Service:
    Manages driver authentication, profile details, driver status (available, offline), and vehicle information. 
  3. 3. Ride Service:
    Responsible for ride matching, including finding nearby available drivers, estimating ETAs, and managing ride requests. This service might use technologies like quadtrees for efficient location-based queries. 
  4. 4. Trip Service:
    Manages the lifecycle of a ride, from initiation to completion, including fare calculation, payment processing, and ride status updates. 
Core Components and Considerations:
  • API Gateway:
    Acts as a single entry point for client applications, routing requests to the appropriate microservice. 
  • Service Discovery:
    Enables microservices to find and communicate with each other dynamically. 
  • Messaging Formats & Communication:
    Utilizing efficient messaging formats (e.g., REST, gRPC) for inter-service communication is crucial. 
  • Databases:
    Each microservice owns its dedicated database to ensure data isolation and independent scaling. 
  • Scalability & Performance:
    The microservice architecture inherently supports horizontal scaling, allowing individual services to scale based on demand. High availability and low latency are critical non-functional requirements for a ride-hailing system. 
  • Decoupling:
    Services should be loosely coupled, allowing for independent development, deployment, and updates without impacting other parts of the system. 

Java Tech Lead Interview Q&A

 Here are comprehensive, deep-dive, scenario-based interview questions tailored specifically for the Java Technical Lead role.

Java & Spring Framework

Describe a scenario where you migrated a monolithic application to microservices using Spring Boot.

“Yes, in my previous role, I migrated a monolithic Self service system to microservices using Spring Boot. The monolith had tightly coupled modules for KYC, credit scoring, approval logic, and disbursement.
I started by identifying clear domain boundaries and extracted KYC as the first microservice.
I used Spring Boot with REST APIs, integrated it with Kafka for async messaging, and deployed via Docker on Kubernetes.
I added OAuth2-based security at the gateway level and implemented circuit breakers using Resilience4j.
This modular approach improved deployment velocity and reduced the approval flow time from 2 minutes to under 20 seconds.”

How do you manage memory leaks or GC issues in a Java 8 production application?

“In one of my fintech projects, I identified memory leaks in a payment processing service by analyzing heap dumps using VisualVM and Eclipse MAT.
I used GC logs with -Xloggc and enabled GC tuning flags to monitor allocation failures.
To fix the leak, I traced it to an unbounded in-memory cache that wasn’t being cleared.
I replaced it with a time-based eviction cache using Caffeine.
For GC tuning, I used G1GC with proper sizing flags and monitored pause times to keep latency under SLA.”

Inwhat scenarios would you prefer Spring Cloud Gateway over Zuul?

“I prefer Spring Cloud Gateway over Zuul when I need better performance, reactive support, and deeper Spring Boot 2.x integration.
In a recent fintech microservices project, I chose Spring Cloud Gateway because it’s built on Project Reactor, supports non-blocking I/O, and works natively with WebFlux.
It also gave me out-of-the-box support for rate limiting, circuit breakers, and token relay using OAuth2 — which were essential for securing open banking APIs.”

How would you design a rate-limiting filter in a Spring Boot microservice?

“In one fintech API gateway I worked on, I implemented a rate-limiting filter using Redis and a token bucket algorithm. I used Spring Boot’s OncePerRequestFilter, integrated with Redis via Lettuce, and blocked requests exceeding limits with HTTP 429. Each user or client ID had a pre-configured rate, helping us mitigate API abuse from automated scripts.”

How would you implement retries and circuit breakers in Spring Boot for external API calls?

“For external services like credit check or AECB integrations, I used Resilience4j with Spring Boot to add both retry and circuit breaker logic. I configured retry policies with exponential backoff and isolated circuits for downstream systems. It prevented cascading failures and reduced support tickets due to transient API outages.”

You need to create a custom authentication provider in Spring Security. Walk me through the approach.

“I implemented a custom authentication provider to support OTP-based login for fintech users. I created a class that implements AuthenticationProvider, added logic to validate user and OTP from Redis, and returned a valid Authentication object. I wired it into the security config via the configure(AuthenticationManagerBuilder) method.”

What is the difference between @Component, @Service, and @Repository in Spring?

“@Component is a generic stereotype, while @Service is used for business logic and @Repository for data access. @Repository also enables exception translation into Spring’s DataAccessException, which helps in consistent DB error handling.”

Ifyour Spring Boot microservice becomes slow during peak hours, how would you debug it?

“I profile the JVM using VisualVM or JFR, check thread dumps, and enable Actuator endpoints for heap, GC, and metrics. I also analyze DB slow queries via APM tools like Dynatrace or New Relic and add caching for expensive calls if needed.”

InSpring JPA, how would you optimize performance when querying large datasets?

“I use pagination with Pageable, avoid N+1 with fetch joins, and project only required fields using DTO projections. For large read-only queries, I use native SQL or database views.”

How would you design a multi-tenant application using Spring Boot?

“I used Hibernate’s multi-tenancy support with a separate schema per tenant strategy. I implemented a TenantIdentifierResolver that resolves tenant ID from the request header and dynamically switches the datasource.”

Microservices, Cloud Native, and Distributed Systems

How do you handle inter-service communication failures in a microservices architecture?

“In my fintech deployment, I used Resilience4j to apply circuit breakers and timeouts on downstream calls. I added fallback logic and used Kafka for retrying non-critical operations asynchronously to avoid blocking the main thread.”

What architectural patterns would you apply for building a multi-region, highly available microservices app?

“I prefer a service-mesh-based architecture with geo-distributed Kubernetes clusters, global DNS-based routing, and replicated data stores like CockroachDB. For fintech, this ensures resilience, low-latency API access, and regulatory compliance in each region.”

You are asked to implement idempotency in a payment API. How would you approach it?

“I implemented idempotency by using a unique idempotency key in the request header. The key is cached temporarily with its response in Redis. If a retry with the same key comes in, I return the cached response without reprocessing.”

What role does service discovery play in Spring Cloud and which tools have you used (e.g., Eureka, Consul)?

“Service discovery eliminates hardcoded IPs. I’ve used Eureka for client-side discovery and Consul in Kubernetes. This helps fintech microservices dynamically register and locate each other based on environment and zone.”

How do you implement eventual consistency across services?

“I use event-driven patterns with Kafka. When one service updates a record, it emits an event, and downstream services consume and update their own states. I track event delivery using Kafka offsets and ensure idempotent consumers.”

Describe how you handle versioning of microservices and backward compatibility.

“I version API paths (e.g., /v1/, /v2/), use content negotiation, and ensure backward compatibility by avoiding breaking changes in contracts. I also maintain a deprecation policy with client coordination.”

Explain a real-world incident where your microservices architecture had to scale. What changes did you make?

“During a loan origination campaign, traffic spiked 8x. I autoscaled our Kubernetes pods based on CPU and request metrics. I also scaled Kafka partitions and added Redis caching in the approval service to reduce DB hits.”

Kafka, Redis, ElasticSearch

How do you handle message ordering in Kafka consumers across multiple partitions?

“For message ordering, I use a consistent partitioning key per user or transaction. This ensures all events for that entity go to the same partition, preserving order at the consumer level.”

How would you design a Kafka consumer for idempotent, exactly-once processing?

“I use a combination of a unique transaction ID and a deduplication table or cache. I commit offsets only after successfully storing the event. In one case, I integrated Kafka with PostgreSQL using transactional outbox pattern for atomic writes.”

Explain how you would use Redis for caching in a Spring Boot app. How would you invalidate stale cache?

“I use Redis with Spring Cache abstraction, annotated methods with @Cacheable, and set TTLs for expiry. For manual invalidation, I use @CacheEvict and implement Redis pub-sub to sync cache across services.”

Describe a scenario where ElasticSearch indexing caused production latency. How did you resolve it?

“We had a fintech case where write-heavy transaction logs overloaded the ElasticSearch cluster. I resolved it by batching writes using Logstash, applied index rollover, and added backpressure via Kafka to slow down indexing rate.”

What tools or patterns do you use for monitoring Kafka lag or dead-letter queues?

“I use Kafka Exporter with Prometheus + Grafana to monitor consumer lag. For DLQs, I set up a separate Kafka topic, added structured error logs, and created a replay service to process failed events with manual intervention.”

Docker & Kubernetes

How do you secure secrets in Kubernetes deployments for Java apps?

“I use Kubernetes Secrets encrypted with base64, mounted as environment variables or volumes in Spring Boot pods. For sensitive fintech data, I also integrate with HashiCorp Vault or AWS Secrets Manager via external secret operators.”

Describe the CI/CD flow you would set up for building, testing, and deploying Dockerized Spring Boot services.

“I use GitHub Actions or Jenkins to trigger builds on commit, run unit tests, then build Docker images and push them to ECR/ACR. I apply Helm charts for Kubernetes deployment and use separate namespaces for dev, staging, and prod environments.”

How do you handle persistent volumes in Kubernetes for a stateful Java application?

“For services like reporting or document generation, I use StatefulSets with PVCs backed by cloud-native storage like AWS EBS or Azure Disk. I configure volumeMounts in the pod spec and manage backups through CSI plugins.”

You have a memory leak in a container — how would you diagnose and fix it?

“I run kubectl top to identify memory usage, then exec into the pod to generate a heap dump using jmap. I analyze it with Eclipse MAT to trace retained objects and fix leaks in code or framework misuse. I also set resource limits to prevent node crashes.”

What’s the difference between readinessProbe and livenessProbe? How would you configure them?

“ReadinessProbe checks if the app is ready to serve traffic and avoids routing requests prematurely. LivenessProbe detects unresponsive apps and restarts them. I configure /actuator/health for readiness and a custom health endpoint for liveness with initial delay and timeout settings.”

Security (OAuth, LDAP, SSO)

How would you implement OAuth2 login with Spring Security for a REST API?

“I configure a resource server using Spring Security with the spring-boot-starter-oauth2-resource-server. I validate JWTs issued by an identity provider like Keycloak or Okta, and protect API routes based on roles from the token.”

What steps would you follow to integrate SSO (e.g., Azure AD or Okta) with a Spring Boot application?

“I register the app in the IdP (Azure AD or Okta), configure client credentials in Spring Boot, and use spring-security-oauth2-client to enable redirection-based login. Tokens are parsed and user info mapped to Spring Security authorities.”

Describe how JWT token-based authentication works. What are the common vulnerabilities and how to fix them?

“JWT contains claims and is signed with a secret or private key. It’s stateless and passed in Authorization headers. Common issues include token theft, weak signing keys, and no expiration. I mitigate them using HTTPS, short TTLs, and rotating signing keys.”

How would you integrate LDAP-based authentication for internal enterprise tools?

“I use Spring Security’s LdapAuthenticationProvider and connect to the enterprise LDAP directory over LDAPS. I map groups to roles and control access via antMatchers in security config. I also cache LDAP user info to reduce lookup latency.”

DevOps, CI/CD, Git, Jenkins

What Jenkins pipeline would you write to deploy a Java service to Kubernetes on every Git commit?

“I configure a multi-stage Jenkinsfile that triggers on Git commit, builds the JAR, runs unit tests, builds a Docker image, pushes it to ECR, and uses kubectl or Helm to deploy to Kubernetes. I use separate contexts for dev, QA, and prod.”

How would you enforce code quality and OWASP Top 10 checks before merging to main?

“I integrate SonarQube for static code analysis and enforce quality gates in Jenkins pipelines. For OWASP checks, I use tools like OWASP Dependency-Check and Snyk to scan for known vulnerabilities in dependencies before merge.”

What Git branching strategy would you use in a fast-moving Agile team?

“I use trunk-based development with short-lived feature branches. I apply pull request gates, enforce code review and automated checks, and deploy to dev environment from main branch using GitHub Actions or Jenkins.”

How do you roll back a failed deployment in Kubernetes using Jenkins?

“I version Helm releases and configure Jenkins to rollback using helm rollback <release> if a health check or post-deployment test fails. I also maintain backup of environment variables and configs to ensure clean rollback.”

Observability and Monitoring

How do you monitor memory/cpu usage of a Spring Boot service in Kubernetes?

“I use Prometheus node exporter and Kubernetes metrics-server to monitor container-level CPU/memory. On application level, I expose Actuator metrics and scrape them using Prometheus and visualize via Grafana.”

What is your preferred stack for log aggregation and visualization?

“I use ELK Stack (Elasticsearch, Logstash, Kibana) or EFK (Fluentd instead of Logstash). I configure Spring Boot to write JSON logs with MDC for trace ID correlation and push logs to Elastic via Fluent Bit.”

How would you use Grafana and Prometheus to detect and alert on a service degradation?

“I configure Prometheus to scrape custom metrics like response time, error rates, and memory usage. I create Grafana dashboards with alert rules that notify Slack/Email if thresholds are breached.”

How would you trace a user transaction that flows through 5 different microservices?

“I use Sleuth and Zipkin for distributed tracing. Each microservice propagates the same trace ID via headers. I view the complete trace in Zipkin UI to debug latency or failure in the transaction path.”

How do you handle log correlation and distributed tracing?

“I use MDC in Spring Boot to log trace and span IDs. These IDs are injected by Sleuth and correlate logs across services. Logs are then searchable in Elastic or Kibana using the shared trace ID.”

Design & Architecture Scenarios

Design an architecture for a real-time stock trading platform that scales to 10M users.

“I would use a microservices-based architecture with WebSocket-enabled frontend, Kafka for event streaming, and Redis for in-memory order book caching. Each service like order matching, risk checks, and notification runs independently in Kubernetes. I’d use CQRS to separate write-heavy trade execution and read-heavy portfolio queries, and store trades in Cassandra or DynamoDB for horizontal scaling.”

You need to redesign a batch-based loan approval system into an event-driven architecture. How would you do it?

“I would decouple the batch workflow into microservices like document verification, KYC, scoring, and approval. I’d use Kafka to emit events like ‘document_uploaded’ or ‘score_ready’, so downstream services react independently. This reduces latency, improves modularity, and lets each component scale independently. I also track audit events using a transaction log topic.”

How would you design a high-throughput, read-optimized search feature using ElasticSearch and Spring Boot?

“I use ElasticSearch for indexing customer or transaction metadata and expose search APIs via Spring Boot. I use bulk indexing with buffer queues and backpressure control to handle write bursts. For search, I cache common queries in Redis and implement paginated search results with filters and analyzers tuned for financial terms.”

What are some trade-offs between synchronous and asynchronous communication in microservices?

“Synchronous gives immediate response and simpler tracing but creates tight coupling and risk of cascading failures. Asynchronous decouples services and improves resilience but adds complexity in tracing and debugging. In fintech, I use sync for critical paths like payment confirmation and async for downstream analytics or notifications.”

How do you prevent cascading failures in a distributed service mesh?

“I use circuit breakers, timeouts, retries with backoff, and bulkhead patterns via service mesh like Istio. I also apply rate limiting and set up Prometheus-Grafana dashboards to monitor service health and proactively alert if latencies spike or error rates increase.”

Testing and Code Quality

How do you test Kafka-based event processing logic in your services?

“I use embedded Kafka for integration tests and Testcontainers to simulate Kafka brokers. I assert the output event or DB state using Awaitility to verify message consumption.”

What is your approach to writing unit vs integration vs contract tests?

“I write unit tests for isolated logic using JUnit and Mockito, integration tests for DB/API flows, and use Spring Cloud Contract for consumer-driven contract testing between microservices.”

How do you mock external REST APIs in Spring Boot for testing?

“I use WireMock for mocking external REST endpoints in integration tests. I stub responses based on request patterns and assert the application behavior using the mocked responses.”

What is your preferred strategy for test data setup in pipelines?

“I use DB migrations via Flyway or Liquibase and load seed data using SQL scripts or Java-based loaders. For tests, I use H2 or PostgreSQL Testcontainers.”

How do you automate security testing in CI/CD?

“I integrate OWASP ZAP or Snyk into the pipeline to scan for vulnerabilities. I fail the build if critical issues are found and notify the security Slack channel with remediation details.”

Leadership & Delivery

How do you mentor junior engineers on architectural principles?

“I conduct code walkthroughs, architecture design sessions, and explain trade-offs during reviews. I also encourage writing ADRs and reviewing open-source designs to build system thinking.”

What is your approach to balancing tech debt and business pressure?

“I identify critical debt that impacts velocity or risk and tag them with severity. I propose fixes during sprint planning and negotiate with product managers to allocate budgeted time for resolution.”

Have you led or participated in architectural review boards? What decisions did you contribute to?

“Yes, I participated in ARBs for a loan origination system and contributed to decisions around adopting Kafka over RabbitMQ, standardizing REST API versioning, and enforcing OAuth2 for internal APIs.”

How do you ensure code consistency across globally distributed teams?

“I enforce coding standards via checkstyle and pre-commit hooks. I review PRs actively and maintain a living design doc for each service that new developers can follow.”

How do you align sprint-level tasks with long-term architectural goals?

“I break down architecture initiatives into epics and align them with business OKRs. I create tickets for foundational work like refactoring, observability, or performance so that they can be scheduled like any user story.”

You’re preparing for a Lead role — this Q-set will push you into confidence zone for Level 2 and 3 rounds.