An Introduction to Microservice Principles and Concepts Educative Quiz Answers

Get An Introduction to Microservice Principles and Concepts Educative Quiz Answers

Microservices are one of the most important and popular software architecture trends. This architecture forms the base for a lot of companies including: Amazon, Netflix, Spotify, and Uber.

In this course you’ll learn microservices in depth and understand reasons for and against microservices. Beyond that, you’ll learn about Micro and Macro architecture, strategies for migrating old systems, the role of Docker in this architecture, and technologies for implementing microservices.

After taking this course, you’ll be better equipped to implement microservices for your own use.

Enroll on Educative

Quiz 1: Introduction

Q1. A microservice should not be any longer than a few hundred lines of code.

  • True
  • False

Q2. Microservices are _____.

  • independently deployable modules
  • frameworks for e-commerce systems
  • deployment monoliths

Q3. A key feature of the microservices architecture is that a new version of the entire application is deployed when a change is made to any one microservice.

  • True
  • False

Quiz 2: Advantages

Q1. Why is it NOT likely that a developer will introduce a new dependency between two modules in a microservice architecture?

  • Because attention is only paid to the code level and not the architecture level
  • Because it is not immediately clear which module a class belongs to
  • Because microservices have clear boundaries due to their interface and to introduce a dependency, they will have to call it

Quiz 3: Advantage: Continuous Delivery

Q1. In what phase of continuous delivery would the performance of an application be checked against the expected load?

  • Acceptance test
  • Explorative test
  • Capacity test

Q2. Setting up an environment to integration test a microservices architecture can be complicated

  • True
  • False

Quiz 4: More on Advantages

Q1. In a microservice architecture, what will happen if one microservice crashes?

  • All others will crash as well.
  • The other microservices will keep running
  • Some will necessarily crash. Others may not

Q2. Free technology choice is a consequence of stronger isolation

  • True
  • False

Q3. Suppose you are designing a small social network. Which microservices would be the most appropriate to divide it into from the given options?

  • The server
    • The client
    • Routers
  • Registration
    • Searching for friends
    • Adding friends
    • Writing posts
    • Reading posts
  • A mobile app
    • Website
    • TV app

Quiz 5: Tradeoffs, Prioritizing Advantages, & Levels

Q1. Docker containers can help to make microservices independently deployable.

  • True
  • False

Q2. Suppose you are designing a small social network and you come up with a domain-based microservice to search posts. Which of the following are plausible technical divisions of this?

  • Search through all friends / search through all members
  • Search photo album posts / search text posts
  • Create posts / delete posts

Quiz 6: Challenges

Q1. Suppose you’re designing an application where one microservice gets data from another. If this data fetching fails, the functionality of the app will be compromised. What would be the best course of action in this situation?

  • Keep things as they are.
  • Merge the two microservices into one.
  • Create another microservice that gets data and then passes it on.

Q2. Automated deployment can save considerable effort with microservices.

  • True
  • False

Q3. Microservices should only be tested independently. Testing them together should be avoided.

  • True
  • False

Quiz 7: Introduction

Q1. The e-commerce system discussed in the last chapter, can be divided into microservices like so:

  1. ordering
  2. registration
  3. product search

Suppose the product search team decides to optimize search with a new algorithm. Is this a micro or macro architecture decision?

  • Micro architecture
  • Macro architecture
  • Both

Q2. It does not matter if the microservices can work with each other.

  • True
  • False

Q3. The macro architecture consists of all decisions which have to be made at an individual level for each microservice.

  • True
  • False

Quiz 8: Domain-Driven Design & Bounded Contexts

Q1. Suppose you’re given the following e-commerce system:

  1. Customer registration
  2. Order process
    • Data validation
    • Freight charge calculation
  3. Payment
  4. Shipping

What will happen to the rest of the modules if the internal architecture of order process is changed as follows:

  1. Customer registration
  2. Order process
    • Data validation
    • Input sanitation
    • Freight charge calculation
  3. Payment
  4. Shipping
  • The rest of the modules will have to adopt more security principles too. Otherwise, the entire app can be compromised.
  • Nothing – the rest of the modules will not have to change anything
  • The entire app will have to be deployed from scratch

Q2. Communication between bounded contexts can be triggered from ___.

  • Domain events
  • Changes in the network
  • Domain-driven design

Q3. Why are domain models that span multiple bounded contexts difficult to implement?

  • The domain model would be too complex
  • The microservice would be too large
  • A new feature would be hard to implement

Quiz 9: Strategic Design & Common Patterns

Q1. Consider the following two teams as a part of a small social media app.

  1. Image processing. They handle operations on images such as compression and storage.
  2. Photo Albums. They handle the look of each user’s ‘photo albums’.

Which team is upstream and which is downstream in terms of strategic design?

  • The image processing team is upstream and the photo albums team is downsteam.
  • The image processing team is downstream and the photo albums team is upstream
  • The image processing team is downstrem and the photo albums team is also downsteam

Q2. Consider a pizza delivery app. The two bounded contexts, delivery and purchase are done by different teams. However, delivery can give requirements to purchase. Which pattern describes this situation?

  • Conformist
  • Customer / Supplier
  • Strategic Design

Q3. Which pattern should NOT be used in a microservices scenario?

  • The customer/supplier pattern
  • The open host service pattern
  • The shared kernel pattern

Q4. How to pass configuration patterns to a microservice MUST be a decision of the individual microservice.

  • True
  • False

Quiz 10: Architecture Decisions

Q1. Suppose that it has been decided to use a REST interface between microservices for communication. What sort of technical decision could this have been?

  • Strictly macro
  • Strictly micro
  • Could have been either, it’s difficult to say.

Q2. Suppose you’re part of a team that is building a small social media app. You come across a document that details the dependencies between all the microservices of the app. Was that document written as part of the macro architecture, micro architecture, or both?

  • Macro
  • Micro
  • Both

Q3. Integration tests are a ___ architectural decision.

  • Macro
  • Micro
  • Difficult to say

Quiz 11: Operation: Micro or Macro Architecture?

Q1. Which of the following best describes why storing logs on a specialized log server is adventageous?

  • Since servers are always less prone to crashes than local machines, the data is safer and less prone to be lost due to a crash.
  • The logs from all microservices would be available regardless of their current status and searching and analyzing logs is simpler.
  • Servers are always faster than local machines, hence storing logs will be made efficient on a server.

Q2. Which configuration patterns to include MUST be a decision of the individual microservice.

  • True
  • False

Quiz 12: Give a Preference to Micro Architecture!

Q1. Which of the following macro architecture rules are better and why?

  1. User data for analytics must be stored in a JSON format
  2. The technology xyz should be used to gather user data for analytics and the data should be stored in a JSON format
  • Rule #2 because JSON is a standard way to store and retrieve data
  • Rule #1 because it is minimal
  • Either rule #1 or #2 are fine

Q2. A microservices system may graduate from one where all microservices use one language to one where each uses a different language.

  • True
  • False

Q3. What could happen if a macro architecture rule is violated?

  • Nothing. Those rules aren’t strict. They are there for guidance.
  • The microservice may not be able to go into production.
  • The whole app may have to be deployed

Quiz 13: Organizational Aspects

Q1. Even if an operational technology is not standardized at the macro architecture level, certain technologies are naturally conformed to by teams that communicate well.

  • True
  • False

Q2. Which of the following is a good way to enforce a macro architecture decision as described above?

  • Fire team members that are suspected of not conforming to those decisions.
  • Convince the teams of the decisions via well documented and convincing rationale.
  • Have long individual meetings with some team members to ensure that they understand the reasons. Those team members are expected to convince the rest.

Q3. A black box conformance test ______.

  • tests the internal code
  • tests the microservice as a whole
  • entails an mcq test regarding the code to be completed by each team member after each code pull request.

Quiz 14: Independent Systems Architecture Principles

Q1. The communication method between microservices has to be standardized.

  • True
  • False

Q2. Does a system where two microservices use different technologies for log analysis violate ISA rules?

  • Yes, because operations should be standardized but that does not include ISA rules.
  • No, because the rules says that operations “should” be standardized. It does not say “must”.

Q3. Once a user logs in, they must be able to access all functionalities of all microservices.

  • True
  • False

Quiz 15: Variations

Q1. Suppose a whitelist for the databases is defined at the macro level. Which of the following is true concerning the decision to use a specific database?

  • This is purely a macro architectural decision
  • This is purely a micro architectural decision
  • This is a complex decision that is neither purely macro nor purely micro

Quiz 16: Introduction

Q1. Converting a monolithic system to a microservices system is called a _____.

  • Migration
  • Microservice conversion
  • Deployment

Q2. It is NOT possible to implement a microservices system from scratch.

  • True
  • False

Quiz 17: Reasons for Migrating

Q1. A team of two, working on a popular monolithic website with a very small codebase that started 15 years ago want to migrate to a microservices system. What would the primary reason for the migration be?

  • Easier deployment
  • Decreased coordination
  • Outdated technology

Q2. Depending on the reason for migrating, the procedure for implementing them may vary.

  • True
  • False

Quiz 18: Typical Migration Strategies

Q1. In what circumstances can synchronous communication be preferable?

  • If migration is already done
  • When the changes need to take effect as soon as possible
  • When the changes can wait

Q2. Changes to the data can be communicated via?

  • Events
  • Commits
  • Pull requests

Q3. In a black box migration scenario, which bounded context is a good choice to extract first?

  • The bounded context that implements the core logic of the app, i.e., the most important bounded context should naturally be migrated first.
  • Migration should occur in chronological order. The bounded context that was first implemented should also be extracted first.
  • An unimportant bounded context that does not have too much load.

Quiz 19: Alternative Strategies

Q1. When should the copy/change strategy be used?

  • When a freedom of technologies is necessary
  • When old code and functionality of the legacy system needs to be kept
  • When a new start is needed

Q2. Suppose as part of a migration, the UI, logic and data are all migrated separately. What migration strategy is likely being followed here?

  • Copy/change
  • Blackbox
  • Layer-based migration

Quiz 20: Build, Operation, and Organization

Q1. Why are changes that affect both the legacy system and the microservices difficult to implement?

You can pick more than one answer.

  • That entails writing a lot of code which can be difficult to do
  • That entails deploying the legacy system which takes considerable effort
  • That entails deploying the microservices which takes considerable effort

Q2. It is risky to implement all changes at once

  • True
  • False

Quiz 21: Introduction

Q1. A Dockerfile describes the installation of software in a simple way.

  • True
  • False

Q2. How can developers implement Docker-like systems?

  • Docker is a simple technology and so anyone can create their own proprietary Docker-like technology
  • Some of Docker’s core components are under the Open Source license which allows developers to create Docker-like technology using them
  • Docker Machine and Docker Compose support Docker on server systems so developers are able to implement them

Quiz 22: Docker for Microservices: Reasons

Q1. Which of the following is NOT a reason why microservices must at least be implemented as separate processes?

  • To ensure the robustness of the whole system
  • To make sure that each microservice is independently scalable
  • They can use the same network port.

Q2. Which of the following is NOT a reason why processes are NOT the best solution to deploy microservices separately?

  • Each microservice has to have a unique network port. All of these ports have to be kept track of which can be painstaking and unused ports can be difficult to find as the number of microservices increases
  • All of the microservices have to run on one operating system even if that OS is not ideal for the microservice
  • Processes do not guarantee robustness. If one process fails, all of them fail

Q3. What is a virtual machine?

  • A machine with a generic OS that can behave as any OS that the microservice chooses
  • Simulated computers that all run on the same physical hardware
  • Lightweight machines

Q4. Why are virtual machines NOT the best solution for separate deployment of microservices either?

  • Virtualized operating systems do not work exactly like real ones which can cause issues
  • Virtual machines on one system cannot communicate with each other
  • Virtual machines have substantial overhead

Quiz 23: Docker Basics

Q1. Consider an application where all the microservices have to be individually externally accessible from the network. Does Docker solve the issue of keeping track of unused ports that the host machine has?

  • Yes
  • No

Q2. Why should only one process run in a Docker container?

  • Running more than one process in a Docker container contradicts the idea of isolating processes via Docker containers
  • Docker containers cannot run more than one process by design
  • Docker containers are too lightweight to run more than one process

Q3. In a Docker container should there be daemon or background processes in addition to the foreground process?

  • Yes
  • No

Quiz 24: Dockerfiles

Q1. Which of the following best describes how the COPY command works?

  • COPY <src> <dst>
  • COPY <dst>
  • COPY <dst> <src>

Q2. Which of the following best describes what the CMD statement would do in a microservices context?

  • It should start any process
  • It should start a bash instance
  • It should start the intended microservice

Q3. What does the following COPY statement do in a Docker container with a Windows base-image?

COPY code.cpp c:\\

  • It copies the C directory of the host system to the code folder in the Docker container
  • It copies the code.cpp file in the host system to C directory of the Docker container
  • It copies the C directory of the Docker container to the host system

Q4. What sub directory is the Dockerfile expected to be in in the following build command?

docker build --tag=educative educative-courses

  • educative
  • educative-courses
  • courses

Q5. Suppose you used the following Dockerfile to build an image. Then, sometime later, some updates have been rolled out and naturally, the base image has changed. You try to build the image using the same file again, but notice no updates. What is happening and how can you fix the issue?

FROM ubuntu:15.04
RUN apt-get update ; apt-get dist-upgrade -y -qq 
  • There is an error in the Dockerfile. The -y flag will not allow it to build
  • The image has been cached and will not be downloaded again. Passing the --no-cache=true flag with the build command should fix this.
  • You should write a fresh Dockerfile.

Q6. Why are multi-stage builds useful?

  • They allow the program to compile in one phase of the build and pass on only the binaries to the final stage which keeps the final build free of the compile tools needed for the program.
  • They allow the program to compile on the host machine and pass on only the binaries to the final build which keeps it free of the compile tools needed for the program.
  • They allow the program to compile on the host machine which keeps the Docker container free of the compile tools needed for the program.

Q7. With each build of a Docker container, everything is reinstalled from scratch.

  • True
  • False

Quiz 25: Docker Compose

Q1. What is the purpose of Docker Compose?

  • To start and run several containers together for starting all the modules that the system consists of in one go.
  • To facilitate starting a single Docker container.
  • To build and run a single Docker container.

Q2. Consider the following YAML file:

version: '3'
services:
  process:
    build: ../scs-demo-esi-common/
    links:
     - finish
     - order
  order:
    build: ../scs-demo-esi-order
  finish:
    build: finish
    ports:
     - "3000:8080"

Which service binds a port to a port on the host?

  • process
  • order
  • finish

Q3.

version: '3'
services:
  process:
    build: ../scs-demo-esi-common/
    links:
     - finish
     - order
  order:
    build: ../scs-demo-esi-order
  finish:
    build: finish
    ports:
     - "3000:8080"

Which service has Docker Compose links to other services?

  • All of them
  • process
  • order
  • finish

Quiz 26: Variations

Q1. Why should applications run in a cluster?

  • To safeguard against individual server failure and to scale across servers
  • To allow for newer technology to be used
  • To ensure appropriate user authentication at each stage

Q2. What is Kubernetes?

  • A Docker image
  • A Docker scheduler
  • A type of Docker container

Quiz 27: Introduction

Q1. Which technology are microservices often implemented with as stated above?

  • REST
  • Reactive
  • HTTP

Q2. One of the weaknesses of microservices is that different technologies can be used in each individual microservice.

  • True
  • False

Quiz 28: Requirements

Q1. What are the factors that influence the technical Micro Architecture?

  • Deployment
    • Operation
    • Logs
    • Metrics
    • Resilience
  • New Microservices increasing in size
    • Configuration
    • Metrics
    • Logs
    • Operation
    • Messaging
  • Operation
    • Logs
    • Metrics
    • Configuration
    • Deployment
  • Communication
    • Resilience
    • New Microservices
    • Operation
    • logs
    • metrics
    • configuration
    • deployment

Q2. It is a _________ decision which communication protocol is used.

  • system level
  • macro architecture
  • transport layer
  • optional

Q3. In principle, different libraries can be used for implementing a macro architecture rule which for instance predefines a log format and a log server. In this case, the micro architecture has to choose a library for the microservice.

  • True
  • False

Q4. When implementing new features Microservices, we usually have two ways to go about it. These are:

  1. Either the microservices become smaller or
  2. The number of microservices of constant size increases.
  1. Either the microservices become larger or
  2. The number of microservices of constant size increases.
  1. Either the microservices become smaller or
  2. The number of microservices of constant size doubles.
  1. Either the microservices become larger or
  2. The number of microservices of constant size increases exponentially

Q5. Resilience means that each microservice has to be able to deal with the failure of other microservices.

  • True
  • False

Quiz 29: Reactive Programming

Q1. Elastic means that:

  • The system can deal with many kinds of services with flexibility
  • The system can deal with different levels of load
  • The system is always ready for any kind of task
  • The system can handle multiple server requests at a time

Q2. Responsive means that the system:

  • Responds as fast as possible
  • Can take many requests
  • Can handle many I/Os all day long
  • Is elastic

Q3. In Reactive Programming, the event loop is a thread and processes one event at a time. Instead of waiting for I/O, the processing of the event is suspended. Once the results of the I/O operation are available, they are part of a new event which is processed by the event loop.

In this way, a single event loop can process a plethora of network connections.

  • True
  • False

Q4. A microservice MUST be implemented with reactive programming in order to achieve the goals of the Reactive Manifesto.

  • True
  • False

Quiz 30: Spring Boot

Q1. The version of the Maven parent indirectly determines which version of Spring Boot is used.

  • True
  • False

Q2. The following method responds to requests to which URL?

@RequestMapping("/") public String hello() {
return "hello\n"; 
}
  • RequestMapping/
  • /
  • hello\n

Quiz 31: Spring Boot Starter Web as Single Dependency

Q1. Why is Tomcat server NOT considered to be a dependency of our application?

  • We do not use Tomcat server
  • Tomcat server is installed by default in all Docker setups
  • Tomcat server runs as an embedded part of the application

Q2. What is Spring Cloud?

  • A cluster of cloud servers that can run our Spring application
  • A collection of extensions for Spring Boot which are useful for cloud applications and for microservices.
  • A useful and generic Java library

Q3. What does the following command do?

mvn clean package
  • Clears the directory
  • Clears all previous commands made in the command-line
  • The above command deletes the old build results and builds a new JAR.

Quiz 32: Spring Boot for Microservices: Communication

Q1. What does MVC in the context of Spring Boot stand for?

  • Model-Vanish-Compile
  • Model-View-Controller
  • Model-View-Compile

Q2. How is view-based rendering avoided in Spring MVC?

  • With the @ResponseBody annotation and many HttpMessageConverter implementations
  • Spring MVC does not avoid view-based renderring
  • With the @HttpMessageConverter annotation and many ResponseBody implementations

Quiz 33: Other Communication APIs Supported by Spring

Q1. What is Kafka?

  • A 20th century German-speaking novelist
  • A messaging system that processes data streams
  • A JMS implementation starter

Q2. Java libraries can NOT be used with Spring Boot projects.

  • True
  • False

Quiz 34: Spring Boot for Microservices: Operation

Q1. A spring boot application can NOT read configuration from ______.

  • a configuration file
  • environment variables
  • events

Q2. A spring boot application can generate logs in which of the following formats?

  • Display on the console
  • Store in log files
  • Send to a log server
  • All of the above

Q3. Deploying a spring boot application is incredibly complex.

  • True
  • False

Q4. To deploy a Spring Boot application, it is enough to just copy the JAR file to the server and start it.

  • True
  • False

Q5. Settings for the configuration of the microservices or for logging can be defined in the metrics file.

  • True
  • False

Quiz 35: Spring Boot for Microservices: New Microservices & Resilience

Q1. Name a library that can be used for resilience in Java.

  • REST
  • JAX
  • Matplotlib
  • Hystrix

Quiz 36: Go

Q1. What are the advantages of using multistage builds to compile Go code?

  • They are much faster
  • They result in runtime environments that are smaller and more secure
  • They are not only the industry standard for Go, but Go code cannot be compiled any other way

Q2. What is Go?

  • An MVC framework that is incredibly popular with microservices
  • A support library for multistage Docker builds
  • A concurrent programming language

Q3. Go is based in C.

  • True
  • False

Quiz 37: Go for Microservices?

Q1. What is viper?

  • A library used for the configuration of Go applications
  • A feature for logs
  • A library that supports Go output to YAML and JSON files

Q2. Go does NOT support logs

  • True
  • False

Q3. Adding a new microservice to a Go application requires a considerable amount of effort.

  • True
  • False
Conclusion:

I hope this An Introduction to Microservice Principles and Concepts Educative Quiz Answers would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.

This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.

Keep Learning!

More Coding Solutions >>

LeetCode Solutions

Hacker Rank Solutions

CodeChef Solutions

Leave a Reply

Your email address will not be published.