Interview

20 Eureka Server Interview Questions and Answers

Prepare for the types of questions you are likely to be asked when interviewing for a position where Eureka Server will be used.

Eureka is a REST (Representational State Transfer) based service that is primarily used in the AWS (Amazon Web Services) cloud platform to discover and register services. It is also used by other cloud providers, such as Heroku, to provide service registry and discovery. In this article, we will review some questions that you may be asked during a technical interview for a position that uses Eureka Server.

Eureka Server Interview Questions and Answers

Here are 20 commonly asked Eureka Server interview questions and answers to prepare you for your interview:

1. What is Eureka?

Eureka is a REST-based service that is used for locating services for the purpose of load balancing and failover of middle-tier servers.

2. How does a system register with the Eureka server?

When a system wants to register with the Eureka server, it sends a POST request to the server’s registration URL. The request includes the system’s hostname, IP address, and other information about the system. The Eureka server then adds the system to its list of available systems.

3. How can you make sure that your application registers with the right instance of Eureka Server?

You can configure your application to register with a specific instance of Eureka Server by setting the eureka.instance.hostname property to the hostname or IP address of the Eureka Server instance that you want to register with.

4. Can you explain what DNS based service registration and discovery is?

DNS based service registration and discovery is a way of automatically registering and discovering services using DNS. This can be useful if you have a lot of services that need to be registered and discovered, as it can make the process much simpler and more automated.

5. What protocols are used by Eureka?

Eureka uses two different protocols: the native Java protocol and the Apache Thrift protocol. The native Java protocol is the simplest to use and is the recommended protocol for most users. The Apache Thrift protocol is more efficient but requires a bit more setup.

6. What do you understand about load balancing in the context of Eureka?

Eureka uses load balancing to distribute traffic evenly across all available servers. This ensures that no single server is overwhelmed with requests, and that all servers have an equal opportunity to process requests.

7. Is it possible to disable self-preservation mode for certain instances? If yes, then how?

Yes, it is possible to disable self-preservation mode for certain instances by setting the eureka.instance.lease-expiration-duration-in-seconds property to 0.

8. What are some advantages of using Eureka over other service registries such as Consul or Zookeeper?

Eureka has a number of advantages over other service registries. First, it is very easy to set up and use. Second, it has built-in fault tolerance, meaning that if one instance of Eureka goes down, the others can still continue to function. Third, it is highly scalable, meaning that it can handle a large number of service instances with ease. Finally, it is very lightweight, meaning that it has a small footprint and does not require a lot of resources to run.

9. What happens when a new instance comes up but fails to renew its lease with the registry?

When a new instance comes up but fails to renew its lease with the registry, it will be removed from the registry.

10. What happens when an instance stops responding to the health check?

When an instance stops responding to the health check, it is removed from the Eureka server’s registry. This ensures that traffic is not routed to a non-functioning instance.

11. What are some best practices related to architecture, security, monitoring, and handling failure when using Eureka?

Some best practices for using Eureka Server include:

-Using a load balancer in front of the Eureka Server to distribute traffic
-Using a firewall to protect the Eureka Server from unauthorized access
-Monitoring the Eureka Server for performance and availability
-Configuring Eureka Server to handle failure gracefully

12. What are some best practices that should be followed while developing Spring Cloud applications?

While developing Spring Cloud applications, it is important to keep in mind a few best practices. First, you should always use the latest versions of both Spring Boot and Spring Cloud. Second, you should configure your Eureka server to use SSL for communication. Third, you should use a load balancer in front of your Eureka server to distribute traffic. Finally, you should make sure to monitor your Eureka server for any issues that may arise.

13. What is the difference between @EnableEurekaServer and @EnableDiscoveryClient? Which one would you use in which situation?

@EnableEurekaServer is used to indicate that the application is a Eureka server, and is responsible for providing service registration and discovery functionality. @EnableDiscoveryClient is used to indicate that the application is a Eureka client, and will register itself with a Eureka server in order to receive service discovery information. In general, you would use @EnableEurekaServer when you are setting up a standalone Eureka server, and @EnableDiscoveryClient when you are setting up a Eureka client that will register with a Eureka server.

14. What are some examples of real-world uses of Eureka?

Eureka is used in a variety of different ways in the real world. One common use is in service-oriented architecture, where Eureka can be used to help manage and discover services. Another common use is in cloud computing, where Eureka can be used to help manage and discover cloud-based resources.

15. What do you understand about client side vs server side load balancing?

Client side load balancing is when the client makes requests to a server and the server then decides which server to send the request to. Server side load balancing is when the server itself decides which server to send the request to.

16. What are some common problems that could occur if there is more than one instance of Eureka running in production?

There are a few potential problems that could occur if there are multiple instances of Eureka running in production:

1. If each instance is not configured identically, then they may not be able to communicate with each other properly, leading to inconsistencies in the data that they store.

2. If the instances are not load-balanced properly, then some instances may become overloaded while others are underutilized, leading to suboptimal performance.

3. If one instance goes down, then all of the other instances will need to pick up the slack, which could lead to increased latency and decreased availability.

17. How many instances of Eureka should I run in production?

In a production environment, it is recommended to run at least 3 instances of Eureka Server. This will provide for high availability and failover in the event that one of the servers goes down.

18. What do you understand about self preservation in Eureka?

Eureka’s self-preservation mode is a mechanism used by the server to protect itself from network and instance failures. When self-preservation is enabled, the server will avoid removing instances from the registry unless it is absolutely certain they are unavailable. This helps to ensure that the registry always has a healthy set of instances to serve requests.

19. Is it possible to handle failures in Eureka? If yes, then how?

Yes, it is possible to handle failures in Eureka. The Eureka server can be configured to handle different types of failures, such as network partitions and individual node failures. To handle failures, the Eureka server uses a number of strategies, such as replicating data across multiple servers and using heartbeats to detect failed nodes.

20. What are some limitations of Eureka?

Eureka is a great tool for service discovery, but it does have some limitations. One such limitation is that it can be difficult to scale. Additionally, Eureka does not support service-to-service communication, so if you need to communicate between services, you will need to use a different tool.

Previous

20 Routing Protocols Interview Questions and Answers

Back to Interview
Next

20 B-Tree Interview Questions and Answers