Chaturmind
LearnDSASystem DesignInterview PrepDevOpsEngineering GrowthBlog
Start learning
Chaturmind

Structured learning paths for engineers who want to go deep. Written by practitioners.

Learn

  • Java
  • DSA
  • System Design
  • Spring Boot
  • AI / ML
  • DevOps
  • Engineering Growth
  • Java Interview Prep

Company

  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Chaturmind. All rights reserved.

Built for engineers who want to go deep.


← Java Interview Prep: 2–5 Years

Revise the Fresher Tier

  • Revise: Core Java Fundamentals (Fresher Tier)
  • Revise: Collections, Threads, Java 8 & Coding (Fresher Tier)
  • Revise: Spring Core, Spring Boot & Spring MVC (Fresher Tier)
  • Revise: Hibernate, SQL, Microservices, Maven & Git (Fresher Tier)

Intermediate Core Java

  • Intermediate OOP & Language Features — Interview Questions
  • Enums, Generics, Pass-by-Value & Imports — Interview Questions
  • Collections Internals & Scenarios — Interview Questions
  • JVM, Memory & Class Loading — Interview Questions
  • Exception Design & Serialization Edge Cases — Interview Questions

Java 8 Deep Dive & Stream Coding

  • Lambdas, Functional Interfaces & Method References — Interview Questions
  • Default Methods, Backward Compatibility & Optional — Interview Questions
  • Stream API Internals (Part 1) — Interview Questions
  • Stream API Internals (Part 2) — Interview Questions
  • Stream Coding Problems (Level 2, Part 1) — Interview Questions
  • Stream Coding Problems (Level 2, Part 2) — Interview Questions

Concurrency & Multithreading

  • Synchronization, Locks & Deadlocks — Interview Questions
  • Executors, ThreadLocal & Concurrent Collections — Interview Questions

Spring Framework In Depth

  • Bean Lifecycle, Contexts & Circular Dependencies — Interview Questions
  • Spring Bean Conflicts, AOP, Batch & Injection Styles — Interview Questions

Spring Boot In Depth & Scenarios

  • Spring Boot Internals & Auto-Configuration — Interview Questions
  • Spring Boot Configuration, Profiles & Secrets — Interview Questions
  • Spring Boot Data, Transactions & Caching — Interview Questions
  • Spring Boot Testing, Error Pages & Deployment — Interview Questions
  • Spring Boot Performance, Scaling & Resilience — Interview Questions
  • Spring Boot Async, Events & Messaging — Interview Questions
  • Spring Boot Security Scenarios — Interview Questions
  • Actuator, AOP, Spring Cloud & Distributed Tracing — Interview Questions
  • External APIs, Files, GraphQL & WebFlux — Interview Questions

Spring Security

  • Spring Security — OAuth2, CORS, CSRF & Access Rules — Interview Questions
  • Spring Security — Passwords, Filter Chain, Sessions & Debugging — Interview Questions

Apache Kafka

  • Kafka Architecture, Topics & ZooKeeper vs KRaft — Interview Questions
  • Kafka Producers, Consumers, Reliability & Streams — Interview Questions
  • Kafka Security, Connect & Core Scenarios — Interview Questions
  • Kafka Production Scenarios — Interview Questions

Git, Maven & Gradle (Level II)

  • Git Workflows, Rebase & Conflict Handling — Interview Questions
  • Git Recovery, Hooks, Tags & Collaboration — Interview Questions
  • Maven Builds, Multi-Module Projects & Dependency Resolution — Interview Questions
  • Maven Profiles, settings.xml, Plugins & Quality Gates — Interview Questions
  • Gradle Fundamentals, Migration & Dependencies — Interview Questions
  • Gradle Performance, Plugins, Testing & Publishing — Interview Questions

Deployment & CI/CD

  • Sessions, CI/CD Pipelines, Rollbacks & Secrets — Interview Questions
  • Migrations, Zero-Downtime Releases, Containers & Monitoring — Interview Questions

JUnit 5 & Mockito

  • JUnit 5 — Interview Questions
  • Mockito Basics — Interview Questions
  • Mockito Advanced & Tricky Questions — Interview Questions
Chaturmind
← Java Interview Prep: 2–5 Years

Revise the Fresher Tier

  • Revise: Core Java Fundamentals (Fresher Tier)
  • Revise: Collections, Threads, Java 8 & Coding (Fresher Tier)
  • Revise: Spring Core, Spring Boot & Spring MVC (Fresher Tier)
  • Revise: Hibernate, SQL, Microservices, Maven & Git (Fresher Tier)

Intermediate Core Java

  • Intermediate OOP & Language Features — Interview Questions
  • Enums, Generics, Pass-by-Value & Imports — Interview Questions
  • Collections Internals & Scenarios — Interview Questions
  • JVM, Memory & Class Loading — Interview Questions
  • Exception Design & Serialization Edge Cases — Interview Questions

Java 8 Deep Dive & Stream Coding

  • Lambdas, Functional Interfaces & Method References — Interview Questions
  • Default Methods, Backward Compatibility & Optional — Interview Questions
  • Stream API Internals (Part 1) — Interview Questions
  • Stream API Internals (Part 2) — Interview Questions
  • Stream Coding Problems (Level 2, Part 1) — Interview Questions
  • Stream Coding Problems (Level 2, Part 2) — Interview Questions

Concurrency & Multithreading

  • Synchronization, Locks & Deadlocks — Interview Questions
  • Executors, ThreadLocal & Concurrent Collections — Interview Questions

Spring Framework In Depth

  • Bean Lifecycle, Contexts & Circular Dependencies — Interview Questions
  • Spring Bean Conflicts, AOP, Batch & Injection Styles — Interview Questions

Spring Boot In Depth & Scenarios

  • Spring Boot Internals & Auto-Configuration — Interview Questions
  • Spring Boot Configuration, Profiles & Secrets — Interview Questions
  • Spring Boot Data, Transactions & Caching — Interview Questions
  • Spring Boot Testing, Error Pages & Deployment — Interview Questions
  • Spring Boot Performance, Scaling & Resilience — Interview Questions
  • Spring Boot Async, Events & Messaging — Interview Questions
  • Spring Boot Security Scenarios — Interview Questions
  • Actuator, AOP, Spring Cloud & Distributed Tracing — Interview Questions
  • External APIs, Files, GraphQL & WebFlux — Interview Questions

Spring Security

  • Spring Security — OAuth2, CORS, CSRF & Access Rules — Interview Questions
  • Spring Security — Passwords, Filter Chain, Sessions & Debugging — Interview Questions

Apache Kafka

  • Kafka Architecture, Topics & ZooKeeper vs KRaft — Interview Questions
  • Kafka Producers, Consumers, Reliability & Streams — Interview Questions
  • Kafka Security, Connect & Core Scenarios — Interview Questions
  • Kafka Production Scenarios — Interview Questions

Git, Maven & Gradle (Level II)

  • Git Workflows, Rebase & Conflict Handling — Interview Questions
  • Git Recovery, Hooks, Tags & Collaboration — Interview Questions
  • Maven Builds, Multi-Module Projects & Dependency Resolution — Interview Questions
  • Maven Profiles, settings.xml, Plugins & Quality Gates — Interview Questions
  • Gradle Fundamentals, Migration & Dependencies — Interview Questions
  • Gradle Performance, Plugins, Testing & Publishing — Interview Questions

Deployment & CI/CD

  • Sessions, CI/CD Pipelines, Rollbacks & Secrets — Interview Questions
  • Migrations, Zero-Downtime Releases, Containers & Monitoring — Interview Questions

JUnit 5 & Mockito

  • JUnit 5 — Interview Questions
  • Mockito Basics — Interview Questions
  • Mockito Advanced & Tricky Questions — Interview Questions
HomeLearnJava Interview PrepJava Interview Prep: 2–5 YearsSpring Boot In Depth & Scenarios
✓ FreeIntermediate· 6 min read

Actuator, AOP, Spring Cloud & Distributed Tracing — Interview Questions

Actuator endpoints and their risks, AOP in Spring with a real aspect, what Spring Cloud provides for microservices, serverless with Spring Cloud Function, configuring Spring Cloud Gateway for routing, security and monitoring, and distributed tracing with Micrometer Tracing and OpenTelemetry (Sleuth's successor).

Published September 25, 2026


How to use this lesson

These questions cover the operational and platform side of Spring. Get the names and versions right: Sleuth is gone in Boot 3, Spring Cloud is its own release train, and Gateway comes in reactive and MVC flavours. That signals you've worked with a current stack.

Q1. What are the Spring Boot Actuator endpoints?

Short answer: Actuator exposes operational endpoints under /actuator:

EndpointPurpose
health (+ liveness/readiness groups)Aggregated health indicators, used for load balancers and Kubernetes probes
infoBuild, git and custom application info
metrics, prometheusMicrometer metrics (JVM, HTTP, pools, custom)
loggersView or change log levels at runtime
env, configpropsEffective configuration (values masked)
beans, conditions, mappingsThe bean graph, auto-configuration report, request mappings
threaddump, heapdumpDiagnostics
scheduledtasks, caches, flyway/liquibaseRuntime state

Key points to cover:

  • Only health is exposed over HTTP by default. Diagnostics such as env and heapdump leak secrets if they're public, so secure them (see the security lesson), or run them on a separate management port.
  • You can add custom endpoints with @Endpoint, and custom health checks with HealthIndicator.

Learn it in depth → Metrics & Monitoring

Q2. What is aspect-oriented programming in Spring?

Short answer: AOP moves cross-cutting concerns (transactions, security, caching, metrics, auditing, retries) out of business methods and into aspects. Spring applies an aspect's advice at join points (method executions on beans), selected by pointcuts, by wrapping the beans in proxies. You use AOP constantly without writing any: @Transactional, @Cacheable, @Async, @PreAuthorize, @Retryable and @Timed are all aspects.

@Aspect
@Component
class AuditAspect {
    @AfterReturning(pointcut = "@annotation(audited)", returning = "result")
    void audit(JoinPoint jp, Audited audited, Object result) {
        auditLog.record(audited.action(), currentUser(), jp.getArgs(), result);
    }
}

@Audited(action = "REFUND_ISSUED")                       // custom annotation, used as a pointcut
public Refund issueRefund(long orderId, BigDecimal amount) { … }

Key points to cover:

  • Proxy limits:
    • Self-invocation skips the advice.
    • private and final methods aren't advised.
    • Aspects apply to Spring beans only.
  • Use @Order when several aspects apply to the same method.

Learn it in depth → Spring AOP

Q3. What is Spring Cloud, and how does it help with microservices?

Short answer: Spring Cloud is an umbrella of projects, released as a release train aligned with Spring Boot versions, that implements common distributed-system patterns:

NeedSpring Cloud project
Centralised configurationSpring Cloud Config, Spring Cloud Vault / AWS / Azure integrations
Service discoverySpring Cloud Netflix Eureka, Consul, Zookeeper, Kubernetes
Client-side load balancingSpring Cloud LoadBalancer
Edge routingSpring Cloud Gateway
Declarative HTTP clientsSpring Cloud OpenFeign
ResilienceSpring Cloud Circuit Breaker (Resilience4j)
Messaging abstractionSpring Cloud Stream (Kafka/RabbitMQ binders)
ServerlessSpring Cloud Function
Contract testingSpring Cloud Contract

Common trap: calling Spring Cloud a "component of the Spring Framework". It's a separate set of projects built on Spring Boot. On Kubernetes, the platform already covers several of these needs (discovery, config, load balancing), so teams adopt only the parts they need.

Q4. How does Spring Cloud Function turn business logic into serverless functions?

Short answer: You write business logic as plain java.util.function beans: a Function<I,O>, Supplier<O> or Consumer<I>. Spring Cloud Function adapts those beans to different execution targets with no code changes: HTTP endpoints (spring-cloud-function-web), message-driven processing (Spring Cloud Stream), and serverless platforms (AWS Lambda, Azure Functions, GCP) through adapter modules.

@Bean
Function<OrderPlaced, Invoice> generateInvoice(InvoiceService invoices) {
    return invoices::createFor;                       // the same bean can run as Lambda, as an HTTP POST, or on a Kafka topic
}

Key points to cover:

  • Cold starts matter for serverless Java. Combine it with AWS Lambda SnapStart, CRaC, or GraalVM native images to cut startup time.

Q5. How do you configure Spring Cloud Gateway for routing, security and monitoring?

Short answer:

  • Routing: routes with predicates (path, host, header, method, weight) and filters (rewrite path, add headers, retries, circuit breaker, request rate limiter), defined in YAML or the Java DSL. Use lb://service-id for discovery-based load balancing.
  • Security: make the gateway an OAuth2 resource server (validating JWTs), or an OAuth2 client with TokenRelay (a BFF), and apply rate limiting per user or API key with Redis.
  • Monitoring: Actuator (/actuator/gateway/routes), Micrometer metrics per route, and tracing that propagates trace IDs downstream.
spring:
  cloud:
    gateway:
      routes:
        - id: orders
          uri: lb://order-service
          predicates: [ "Path=/api/orders/**" ]
          filters:
            - name: CircuitBreaker
              args: { name: orders, fallbackUri: "forward:/fallback/orders" }
            - name: RequestRateLimiter
              args: { redis-rate-limiter.replenishRate: 50, redis-rate-limiter.burstCapacity: 100 }

Key points to cover:

  • Gateway traditionally runs on WebFlux/Netty. A Spring Cloud Gateway Server MVC variant now exists for servlet stacks, including with virtual threads.

Learn it in depth → API Gateway

Q6. How do you integrate distributed tracing in Spring Boot for monitoring and troubleshooting?

Short answer: In Spring Boot 3, tracing is provided by Micrometer Tracing, with a bridge to OpenTelemetry (or Brave), and an exporter (OTLP to Jaeger, Tempo, Zipkin or a vendor). Boot auto-instruments incoming and outgoing HTTP (RestClient, WebClient), Kafka, JDBC (with add-ons) and @Observed methods, propagates W3C traceparent headers, and puts traceId/spanId into the logs (MDC). You then follow one request across services, see where time is spent, and jump from a trace to its logs.

<dependency><groupId>io.micrometer</groupId><artifactId>micrometer-tracing-bridge-otel</artifactId></dependency>
<dependency><groupId>io.opentelemetry</groupId><artifactId>opentelemetry-exporter-otlp</artifactId></dependency>
management:
  tracing:
    sampling:
      probability: 0.1          # sample 10% in production; 1.0 in development
  otlp:
    tracing:
      endpoint: http://otel-collector:4318/v1/traces

Common trap: recommending Spring Cloud Sleuth. It supports only Boot 2.x. Its functionality moved into Micrometer Tracing for Boot 3.

Key points to cover:

  • Use tail-based sampling (in the OpenTelemetry Collector) to keep every error and slow trace while sampling the normal ones.
  • Propagate the trace context through async boundaries: executors and messaging.

Learn it in depth → Distributed Tracing

Follow-up questions this topic invites — and their answers

Q: What is the Micrometer Observation API? A: A single instrumentation API (Observation) that produces metrics and traces (and log correlation) from one piece of instrumentation. Spring Boot 3 uses it internally. You can use it through @Observed, or ObservationRegistry.

Q: How do you add a custom health check? A: Implement HealthIndicator (or ReactiveHealthIndicator), and return Health.up() or .down().withDetail(...). Put it in the readiness group only if a failure really means "don't send me traffic".

Q: What's the difference between metrics, logs and traces? A: Metrics are cheap, aggregated numbers over time, used for alerting and trends. Logs are detailed, discrete events, used for investigation. Traces show the causal path and timing of one request across services. You need all three, linked by the trace ID.

Q: Why use a gateway instead of exposing each service? A: A single entry point centralises TLS, authentication, rate limiting, CORS and routing. It hides the internal topology, and lets services change without breaking clients.

Previous

Spring Boot Security Scenarios — Interview Questions

Next

External APIs, Files, GraphQL & WebFlux — Interview Questions

AI Tutor

Lesson: Actuator, AOP, Spring Cloud & Distributed Tracing — Interview Questions

Quick actions

AI responses can be inaccurate. Verify critical information.