Spring Cloud Interview Guide PDF
Spring Cloud Interview Guide PDF
Answer: Spring Cloud is a set of tools and frameworks that simplify the development of cloud-
native applications and microservices using the Spring Boot framework.
3. What is the main difference between Spring Cloud and Spring Boot?
Answer: Spring Cloud is a framework for building and managing microservices, focusing on the
coordination and communication aspects, while Spring Boot simplifies the development of
standalone Spring-based applications, including microservices.
5. What is Hystrix?
Answer: Hystrix is a fault-tolerance and latency library designed by Netflix for isolating points of
access to remote systems, third-party libraries, services, stopping cascading failures, and enabling
resilience in complex distributed systems where failure is common and cannot be avoided. This
library is created by Netflix and it implements Circuit breaker pattern
6. What is the use of the Spring Cloud Bus?
Answer: Spring Cloud Bus facilitates the propagation of configuration changes across multiple
instances of microservices, allowing for synchronized configuration updates.
Answer: Eureka and Zookeeper are services that offer service registration and discovery
functionalities.
@EnableConfigServer
@EunableEurekaServer
@EnableDiscoveryClient
@EnableCircuitBreaker
@HystricCommand
9. What is PCF?
Answer: PCF, or Pivotal Cloud Foundry, was an open-source multi-platform cloud platform used
for deploying, managing, and scaling applications. Although not as popular today, PCF was
significant for its contributions to Spring Framework development.
Answer: Load balancing is a technique that distributes network or application traffic across
multiple servers to optimize resource utilization, improve responsiveness, and enhance fault
tolerance.
11. Why do we use Netflix Feign?
Answer: Netflix Feign simplifies making HTTP requests to other services by providing a
declarative way to create REST clients. It reduces complexity and boilerplate code for service
communication.
Answer: Spring Cloud uses Netflix Ribbon for load balancing. Ribbon distributes client requests
across available service instances to achieve load balancing.
Answer: Eureka provides high availability and usability for service registration and discovery,
while Zookeeper offers strong consistency and fault tolerance in distributed systems.
Answer: The Hystrix circuit breaker prevents failures in one part of a system from affecting the
entire system by isolating failing components. It helps maintain system stability and performance.
Answer: Spring supports dependency injection through XML configuration or annotations like
@Autowired. Dependency injection enables the management and resolution of object
dependencies by the Spring IoC container.
Answer: Spring Security is a framework that provides authentication, authorization, and other
security features to Java applications. It ensures that applications are secured against various
security threats.
Answer:
Singleton: A single instance of the bean is shared across the entire application context.
Prototype: A new bean instance is created each time it is requested.
Request: A new bean instance is created for each HTTP request.
Session: A new bean instance is created for each user session.
Answer: Cross-Site Request Forgery (CSRF) is a security attack where an attacker tricks a user
into executing unintended actions on a web application where the user is authenticated.