---Advertisement---
Hystrix Microservices

Hystrix Interview Question-Answer

By smart_answer13

Published on:

---Advertisement---

Q.1 What is the fallback method used for Hystrix command

       A. HystrixCommand.fallback()

       B. HystrixCommand.callFallback()

       C. HystrixCommand.getFallback()

       D. None of the options

Ans : HystrixCommand.getFallback()


Q.2 Which of the following is a correct Hystrix Command object creation?

       A. HystrixCmd command = new HystrixCmd(arg1, arg2);

       B. Hystrix command = new Hystrix(arg1, arg2);

       C. HystrixCommand command = new HystrixCommand(arg1, arg2);

       D. Hystrixcommand = new HystrixCommand(arg1, arg2);

Ans : HystrixCommand command = new HystrixCommand(arg1, arg2);


Q.3 Which of the following is not a execute command for an observable command?

       A. queue()

       B. observe()

       C. toObservable()

       D. None of the options

Ans : queue()


Q.4 Fallback gets executed when _____________.

       A. circuit is open

       B. Exception running construct() or run()

       C. Threadpool reaches maximum capacity

       D. All the options

Ans : All the options


Q.5 Which state does the Circuit breaker move into after sleep window?

       A. OPEN

       B. HALF OPEN

       C. CLOSED

       D. None of the options

Ans : HALF OPEN


Q.6 What is the pattern used in Hystrix to terminate external call if the service call fails?

       A. Factory Pattern

       B. Bulkhead pattern

       C. Facade pattern

       D. Circuit Breaker Pattern

Ans : Circuit Breaker Pattern


Q.7 Which of the following is an invalid Circuit Breaker state?

       A. HALF OPEN

       B. OPEN

       C. CLOSED

       D. HALF CLOSED

Ans : HALF CLOSED


Q.8 Calls to dependencies happens in a separate thread in this model

       A. Threads & Thread Pool

       B. Semaphore

       C. Both the options

       D. None of the options

Ans : Threads & Thread Pool


Q.9 Bulkhead pattern is derived from the design practice used in constructing __________.

       A. Ships

       B. Buses

       C. Air craft

       D. None of the options

Ans : Ships


Q.10 Which of the following the correct method to implement fallback?

       A. collectFallback()

       B. fallback()

       C. getFallback()

       D. None of the options

Ans : getFallback()


Q.11 What is the syntax to construct a thread Pool Key?

       A. HystrixThreadPool.Factory.asKey(“Test Pool”)

       B. ThreadPoolKey.Factory.asKey(“Test Pool”)

       C. HystrixThreadPoolKey.Factory.asKey(“Test Pool”)

       D. None of the options

Ans : HystrixThreadPoolKey.Factory.asKey(“Test Pool”)


Q.12 Which of the following is the method to be implemented to include request caching?

       A. setCache()

       B. setCacheKey()

       C. getCache()

       D. getCacheKey()

Ans : getCacheKey()


Q.13 Which of the following is the syntax for executing hystrix command?

       A. helloWorldCommand.execute()

       B. helloWorldCommand.run()

       C. helloWorldCommand.queue()

       D. None of the options

Ans : helloWorldCommand.execute()


Q.14 Which of the following error types does not throw HystrixRuntimeException?

       A. SHORT_CIRCUITED

       B. TIMEOUT

       C. FAILURE

       D. BAD_REQUEST

Ans : FAILURE


Q.15 ________ is used to monitor a cluster of servers.

       A. Turbine

       B. Hystrix Dashboard

       C. Hystrix Metrics

       D. Hystrix Stream

Ans : Turbine


Q.16 Which of the following are included in the Metrics data provided by Hystrix dashboard?

       A. Health and traffic volume

       B. Circuit Breaker status

       C. Thread pool rejections

       D. Thread timeouts

       E. all the options

Ans : all the options


Q.17 HystrixCommandProperties.Setter() .withExecutionTimeoutInMilliseconds(int value); This piece of code is used to set Execution timeout property.

       A. True

       B. False

Ans : True


Q.18 execute() method is called to run the command in asynchronous mode.

       A. True

       B. False

Ans : False


Q.19 Which is the correct property to set maximum concurrent request using Semaphore Strategy?

       A. HystrixCommandProperties.Setter() .withExecutionIsolationSemaphoreMaxConcurrentRequests(int value)

       B. HystrixCommandProperties.Setter() .withMaxConcurrentRequests(int value)

       C. HystrixCommandProperties.Setter() .withExecutionIsolationMaxConcurrentRequests(int value)

       D. None of the options

Ans : HystrixCommandProperties.Setter() .withExecutionIsolationSemaphoreMaxConcurrentRequests(int value)


Q.20 Which of the following is not a valid Isolation strategy property?

       A. FUNCTION

       B. SEMAPHORE

       C. THREAD

       D. None of the options

Ans : SEMAPHORE


Q.21 What is the fallback method used for Hystrix Observable command

       A. HystrixObservableCommand.getFallback()

       B. HystrixObservableCommand.obervableFallback()

       C. HystrixObservableCommand.resumeWithFallback()

       D. None of the options

Ans : HystrixObservableCommand.resumeWithFallback()


Q.22metrics.rollingStats.numBuckets’ property is used to ______.

       A. Sets the number of buckets allocated for thread and Semaphore

       B. Sets the number of buckets for which the rolling window is partitioned

       C. Set the number of buckets for all rolling windows

Ans : Sets the number of buckets for which the rolling window is partitioned


Q.23 _________ property to set the duration of rolling window.

       A. metrics.rollingStats.timeInMilliseconds

       B. metrics.timeInMilliseconds

       C. metrics.rollingStats.time

       D. None of the options

Ans : metrics.rollingStats.timeInMilliseconds


Q.24 What is the technique used in hystrix to collapse multiple request into single request?

       A. Request Caching

       B. Request Collapsing

       C. Request merging

       D. None of the options

Ans : Request Caching


Q.25 What is the default timeout provided by Hystrix?

       A. 10000 ms

       B. 100 ms

       C. 2000 ms

       D. 1000 ms

Ans : 10000 ms


Q.26 Hystrix is mainly used to avoid ____________.

       A. cascading failures

       B. tolerance

       C. resilency

       D. all the options

Ans : all the options


Q.27 What is the default number of concurrent request to external system allowed?

       A. 20

       B. 100

       C. 10

       D. 200

Ans : 100


Q.28 What is the cost of using Request Collapsing?

       A. threadpool usage

       B. additional memory usage

       C. latency in command execution

       D. None of the options

Ans : threadpool usage


Q.29 Which of the following fallback pattern returns a static value defaulted in code?

       A. Fail Silent

       B. Fallback – Stubbed

       C. Fallback – Static

       D. None of the options

Ans : Fallback – Static


Q.30 This technique will ensure consistent request across all codes that involves multiple functionality.

       A. Request Caching

       B. Request Collapsing

       C. Request merging

       D. None of the options

Ans : Request Collapsing


Q.31 Every dependency has a separate thread pool allocation to implement _____________ pattern.

       A. Facade pattern

       B. Factory Pattern

       C. Circuit Breaker Pattern

       D. Bulkhead pattern

Ans : Bulkhead pattern


smart_answer13

---Advertisement---

Related Post

Zipkin-Jaeger Interview Question-Answer

Q.1 Which is responsible for sending spans to storage?        A. Transport        B. Collector        C. Component        D. ...

Weaveworks Interview Question-Answer

Q.1 Which of the following features offered by WeaveClouds?        A. Observability        B. VCS integration        C. none of the mentioned ...

Vaadin Unplugged Interview Question-Answer

Q.1 Which of the Programming Model is not supported by Vaadin?        A. Browser        B. Client Side        C. Server Side ...

Spring Boot Framework Interview Question-Answer Part – 2

Q.1 The annotation used to import additional configuration classes is ___________.        A. @Import        B. @Include        C. @EnableImport     ...

Leave a Comment