[Preparing for the spring series of strokes] 50 micro-service interview Zhenti Detailed

2019 will soon be over, we will celebrate our Guowanchunjie gold and three silver four, we need to make adequate preparations to grasp this opportunity for everyone to collect the 2019 manufacturers some common interview Zhenti for everyone We put together a series of strokes preparing for spring, after eleven update to everyone.

1. What is your understanding of the micro-service?

Micro service, also known as micro-services architecture is an architectural style, it is to build applications for the business areas
Small collection of self-service model.
In layman's terms, you have to see how the bees by aligning the hexagonal wax cells to build their honeycombs.
They use a variety of materials from the very beginning a small portion, and continue to build from a large beehive. These fine
Cell patterning to give a strong structure, a specific part of the cell are secured together. Here, each cell
Independently of the other cells, but it is also associated with other cells. This means that damage to a cell do not infringe

Harm other cells, so that the bees can rebuild these cells without affecting the integrity of the beehive


 Figure 1: micro-cellular services represent - Micro service interview questions

Please refer to the map. Here, each hexagonal shape represents individual service components. Similar work with bees,
Agile teams use every available technology stack frame and chosen to build a separate service components. Just like in
Beehive, as each service component to form a powerful micro-services architecture to deliver better scalability.
In addition, Agile teams can deal with each service component alone, with no impact on the overall application
Or minimal impact.

2, micro Services Architecture What are the advantages?


Figure 2: the advantages of micro services - micro-service interview questions
  • Indie - all micro services can easily develop according to their function
  • Independent deployment - based on their service, they can be deployed in any application alone
  • Fault isolation - even if a service application does not work, the system can continue to run
  • Hybrid technology stack - can use different languages ​​and techniques to build the same application for different services
  • Zoom size - the individual components may be scaled according to need, all the components together without the scaling

3. What are the characteristics of micro-services?


Figure 3: Features Micro services - micro-service interview questions
  • Decoupling - service in the system is largely isolated. Therefore, the entire application can easily build, change and expansion
  • Componentized - micro-services are treated as independent components can be easily replaced and upgraded 
  • Operational capacity - Micro service is very simple, focusing on a single function
  • Autonomy - developers and teams can work independently of each other, thereby increasing the speed
  • Continuous Delivery - created by software, automated testing and approval system that allows frequent publishing software 
  • Responsibility - Micro service does not concern the application as a project. Instead, they will be treated as they are responsible for the application of the product
  • Decentralized governance - the point is to use the right tool for the right job. This means that there is no standardized mode or any technical mode. Developers are free to choose the most useful tools to solve their problems
  • Agility - Micro service support agile development. Any new features can be quickly developed and discarded again

4. What is the best practice is to design micro-services? 

The following are best practices for the design of micro services:


 Figure 4: Micro Design Services Best Practices - Micro service interview questions

5, how to operate the micro-service architecture? 

Micro-service architecture has the following components:


 Figure 5: Micro Services Architecture - Micro Services Interview Questions

  • Client - different users from different devices of the transmission request.
  • Identity provider - to verify the identity of the user or customer and issue security tokens.
  • Gateway API - a client request.
  • Static content - all content containment system.
  • Management - Balancing service on the node and identify the fault.
  • Service Discovery - Finding Guides communication path between micro-services.
  • Content Delivery Network - a proxy server and its distributed network of data centers.
  • Remote service - to enable remote access to information that resides on a network of IT equipment. 

6. What are the advantages and disadvantages of micro Services Architecture?


7, single, SOA, and micro Services Architecture What is the difference? 


Figure 6: comparison between the micro-chip and SOA service - microService interview questions
Monolithic architecture   similar to the large containers, in which all the software components of the application assembly and closely packed together 
A service-oriented architecture   is a collection of services communicate with each other. Communications may involve simple number
It passed, it can also involve two or more services coordinating some activity. 
Micro-service architecture   is an architectural style, it is an application to build a small business domain model
Self-service collection.

8, in the use of micro-service architecture, what your challenges? 

The development of some of the smaller micro-service sounds easy, but the challenge often encountered when developing them as follows
  • Automation components : difficult to automate, because there are many smaller components. Thus, for each component, we have to follow all stages of Build, Deploy and Monitor of. 
  • Susceptibility : the maintenance of a number of components together becoming difficult to deploy, maintain, monitor and identify the problem. It needs to have a good awareness in all the surrounding components. 
  • Configuration Management : sometimes becomes difficult to maintain the configuration components in various environments.
  • Debugging : It's hard to find the error of each service. Maintain centralized logging and dashboards critical to debug the problem. 

9. What is the main difference between SOA services and micro-architecture? 

The main difference between the micro and SOA services are as follows:


10, micro-services What are the characteristics? 

You can list the characteristics of micro-services, as follows:

 Figure 7: Feature Micro services - micro-service interview questions

11. What is domain driven design? 


Figure 8: DDD principle - Micro Services Interview Questions

12. Why Domain Driven Design (DDD)? 


Figure 9: We need DDD factor - Micro Services Interview Questions

13. What is the ubiquitous language? 

If you must define the ubiquitous language (UL), then it is the common language for developers and users to use a specific domain by which language can easily explain domain.
Ubiquitous language must be very clear, so that it will all team members on the same page, and machine translation in a manner understandable. 

14. What is cohesion? 

The degree of internal module element belongs is considered to be cohesive. 

15. What is the coupling? 

Dependencies between components strength metric is considered to be coupled. A good design is always considered to have high cohesion and low coupling.

16. What are REST / RESTful and its use is? 

Representational State Transfer (REST) ​​/ RESTful Web services is a way to help computer systems architectural style of communication over the Internet. This makes it easier to understand and micro-services implementation.
Micro service may or may not achieve using a RESTful API, but uses RESTful API to build loosely coupled micro service is always easier. 

17, what is your understanding of the Spring Boot?

In fact, with the addition of new features, the spring becomes more and more complex. If you must start a new spring items, you must add the build path or add maven dependencies, configure the application server, add the spring configuration. So everything must start from scratch. 
Spring Boot is a solution to this problem. Use spring boot to avoid all the boilerplate code and configuration. So basically if you think you're baking a cake, like spring as needed to make a cake ingredients, like spring shoe is complete cake in your hands. 


Figure 10: Factors Spring Boot - the micro-service interview questions

18. What is the Spring actuator guide?

Spring Boot execution of the program provides a restful Web services to access applications running in the production environment
The current status. With the help of the actuator, you can check the various indicators and monitor your application.

19. What is the Spring Cloud?

According to the official website of Spring Cloud, Spring Cloud provides tools to quickly build distributed systems in some of the common mode for developers (such as configuration management, service discovery, circuit breakers, intelligent routing, the leadership election, distributed session clustering state).

20, Spring Cloud which problems? 

When using Spring Boot developing distributed micro-services, the problems we face rarely resolved by the Spring Cloud. 
  • Complexity associated with distributed systems - including network problems, latency overhead, bandwidth issues, security issues
  • Ability to handle service discovery - the service discovery process and allow the cluster service to find and communicate with each other
  • Resolve the redundancy problem - redundancy problems often occur in distributed systems. 
  • Load balancing - Improvement across multiple computing resources (e.g., a computer cluster, a network linking the central processing unit) operating load distribution. 
  • Reduce performance problems - performance issues due to various operations to reduce overhead caused. 

21, within Spring MVC applications WebMvcTest comment what is the use?


In the case of the test target only concerned with Spring MVC components, WebMvcTest comment for unit testing Spring MVC application. In the snapshot shown above, we just want to start ToTestController. When you do unit testing does not start all other controllers and mapping.

twenty two. Can you give a break point on micro and services? 

Although you can implement micro service in many ways, but REST over HTTP is a way to achieve micro-services. REST can also be used for other applications, such as Web applications, API design and MVC applications to provide business data.

Service is a kind of micro-architecture, where all components of the system are put into separate components, these components may be constructed separately, deployment and expansion. Certain principles and best practices of micro-services help build resilient applications. 

In short, you can say that REST is to build a micro-service media.

23. What are the different types of micro-service testing? 

When using micro-services, because there are multiple micro-services work together, the test becomes very complex. Therefore, the test is divided into different levels. 
  • In the bottom , we have the technology for testing, such as testing and performance testing unit. These are fully automated
  • In the middle level , we conducted exploratory testing such as a stress test and usability testing of
  • In the top level , the number of our acceptance test rarely. These acceptance tests help stakeholders understand and verify software functions

24. What is your understanding of the Distributed Transaction?

Distributed transaction means any case of a single mutation event results in two or more separate sources of data can not be submitted in atomic manner. In the micro-world service, it becomes more complicated because each service is a unit of work, and most of the time more services must work together to make the business successful. 

25, what is Idempotence and use it where?

Idempotence is able to do two things in such a way characteristic, that is, the end result will remain the same, that is, if it only once.
Usage : used in Idempotence remote service or data source, so that when it receives an instruction a plurality of times, only one processing instruction. 

26, what is bounded context? 

Bounded context is the core mode domain-driven design. DDD focus on strategic design department is to handle large models
And teams. DDD bounded different context and clarify its relationship to handle large models divided by
Large models. 

27. What is two-factor authentication?

Two-factor authentication is enabled second-level authentication for account login process.

Figure 11: representation of two-factor authentication - Micro service interview questions

Therefore, assuming that the user must enter only a user name and password, then this is considered to be a single-factor authentication. 

28, two-factor authentication credential types are there? 

These three documents are:


Figure 12: Two-factor authentication certificate type - Micro Services Interview Questions

29. What is a client certificate? 

The client system for a digital certificate authenticated request to a remote server is called a client certificate. Client certificates plays a very important role in the design of many mutual authentication, provides a strong guarantee for the identity of the requestor.

30, what PACT use in micro-services architecture is? 

PACT is an open source tool that allows testing services provided to interact with the contract between isolation and consumers, thereby improving the reliability of the micro-service integration.
Micro service usage
  • For implementing consumer-driven contract in micro service.
  • Consumer-driven contracts between consumers and providers of micro-testing services. 
View upcoming batch

31. What is OAuth? 

OAuth authorization on behalf of open protocols. This allows the client applications by enabling (such as third-party providers Facebook, GitHub, etc.) on the HTTP service to access resources in the resource owners. Therefore, you can resources on one site and another site in the shared storage without the use of their credentials.

32, Conway what law is?

Organization "any design system (broadly defined) will produce a design which is the organizational structure of the communication structure
s copy. "- Mel Conway


Figure 13: Conway's law represents - Micro service interview questions
The law basically trying to convey this fact: In order to make the software module to work, the whole team should enter
Good lines of communication. Therefore, the structure of the system reflects the organization of society produces its boundaries.

33, contract test what you know? 

According to Martin Flower argument, contract test is a test done outside the service boundary for verification
If it meets consumer expectations of the service contract.
In addition, contract test does not conduct in-depth testing services. Rather, it tests the output of the service invocation
& Output contains the required properties and the response delay, throughput within allowable limits. 

34. What is the micro-end service testing?

End testing to verify each process workflow are operating normally. This ensures that the system as a whole
Work together and meet all requirements.
In layman's terms, you can say to-end testing is a test, test everything after a certain period of time.

 Figure 14: Test level - Micro Services Interview Questions 

35, what is the use of micro Container service is? 

Container management is based on the application of micro services to their individual development and deployment of a good way. You can micro-service package in a container image and its dependencies, and then you can use it to scroll through on-demand instances of micro-services without any extra work.


Figure 15: represents the container and its use in the service of micro - micro-service interview questions 

36. What is a micro-service architecture DRY? 

DRY representatives do not repeat yourself. It basically promotes the concept of code reuse. This led to the development and shared libraries, which in turn leads to tightly coupled. 

37, what is consumer-driven contract (CDC)? 

This is basically a micro and services for the development mode, so that they can be used by an external system. When we are dealing with micro-services, there is a specific provider to build it, and use one or more micro-services consumers.
Typically, the provider interface is specified in the XML document. But in the consumer-driven contracts, each service provider, consumers are expected to convey Interface

38, Web, RESTful API in the role of micro-services in what is? 

Micro-service architecture is based on a concept in which all services should be able to interact with each other in order to build a business function. Therefore, to achieve this, each micro must have a service interface. This makes the Web API has become a very important promoter of micro-services. RESTful API Web-based open network principles, provides the most reasonable model for building interfaces between the various components of micro-services architecture.

39, what is your understanding of the semantic monitoring micro-service architecture? 

Semantic monitoring, also known as integrated monitoring, automated testing will be combined with monitoring application to detect business failure factor. 

40, How can we cross-functional testing? 

Cross-functional tests is to verify the demand for non-functional, that is, those demands can not be realized as like an ordinary function.

41, how do we eliminate non-determinism in the test?

Non-deterministic test (NDT) is essentially unreliable test. So, sometimes they pass, apparently sometimes they may fail to occur. When they fail, they will be re-run through. 
Some non-deterministic method to remove from the test as follows:
1, isolation
2, asynchronous
3, remote services
4, isolation
5, time
6, resource leaks

42, Mock or Stub What is the difference? 

stub
  • A virtual object to run tests help.
  • Providing a fixed behavior under certain conditions may be hard-coded.
  • Never test stubs of any other act. 
For example, for an empty stack, you can create one just for empty () method returns the stub to true. Therefore, it does not care whether there is an element in the stack. 
fling in teeth
  • A virtual object, which is initially set up some properties.
  • The behavior of this object depends on the set attributes.
  • You can also test the behavior of the object. 
For example, for the Customer object, you can simulate it by setting the name and age. You can set the age of 12, and then test isAdult () method returns true when older than 18. Therefore, your Mock Customer object applies to specified criteria. 

43, you know about Mike Cohn's pyramid test?

Mike Cohn provides a model called the Test Pyramid. This describes the type required for automated testing of software development. 


Figure 16: Mike Cohn test pyramid - Micro Services Interview Questions
According to the pyramid, the number of tests of the first layer should be the highest. In the service layer, the test should be less than the number of unit test
Level, but it should be greater than the level of end to end. 

44, what is the purpose of Docker?

Docker environment provides a container that can be used in any application hosting. Here, software applications and tightly packed together in support of its dependencies.
Therefore, the packaged product is called Container, because it is made Docker done, so it is called Docker containers! 

45, what is the canary release? 

Canary Releasing a reduced risk of introducing new software version of the technology in production. This is slowly extended to a small number of users by the change, and then publish it to the entire infrastructure, which is available to everyone soon to be completed. 

46 What is continuous integration (CI)?

Continuous Integration (CI) is a member of each team submitted a version control process automated build and test code when changing. This encourages developers to incorporate the change to a shared version control repository to share code and unit tests after each small task is completed. 

47. What is the continuous monitoring?

Continuous monitoring of in-depth monitoring of coverage, from front-end performance indicators within the browser, to application performance, to host virtual infrastructure indicators.

48, what is the role of the architect in the micro-service architecture is? 

Micro service architect architecture plays the following roles:
  • Determine the layout of the entire software system.
  • Help determine the partition assembly. Therefore, they ensure that the components adhere to each other, but not tightly coupled.
  • Together with the developer to write code, understand the challenges faced in everyday life.
  • Advise some tools and techniques for the development of micro-services team.
  • Provide technical management, technology development team in order to follow the principle of micro-services

49, we can create it with a micro-state machine service? 

We know that each have their own micro-service is a database program unit can be deployed independently, which in turn brings us to create a state machine. Therefore, we can specify different states and events for specific micro-services.
For example, we can define a micro-Order service. Orders can have different states. Conversion Order state may be an isolated incident Order micro service. 

50, what is the micro-reactive service expansion?

Reactive Extensions, also known as Rx. This is a design method, we collect the results by invoking multiple services, then compile the combined response. These calls can be synchronous or asynchronous, blocking or non-blocking. Rx is a distributed system very popular tool, contrary to conventional processes.
Hope that these micro-service interview questions can help you fine-service architect interview. 


At last:

Detailed micro-interview about service on here, have the opportunity to prepare for the spring series of thematic strokes behind which will share Mybatis, ZooKeeper, Dubbo, kafka and other interview topics. All topics I also concluded a pdf document the

The entire series about a 1000 interview Zhenti Detailed requires source files may be concerned about micro-channel public number: Java programmers to gather.



Guess you like

Origin juejin.im/post/5df1d05d518825123a5ab01a