"Talk about the design patterns you know!"

It's a simple question, but getting the interviewer to agree with your answer can take some work.

Hi, my name is Mic, a Java programmer who has been working for 14 years.

Today, I would like to share with you how to answer such a relatively general type of question in order to satisfy the interviewer.

I organized the text version into the 15W word interview document, you can get it from me

Check out the experts' answers below.

Expert:

Roughly classified according to the application target of the pattern, the design pattern can be divided into the creation pattern, the structural pattern and the behavior pattern.

The creational pattern is a summary of various problems and solutions in the object creation process, including various factory patterns, singleton patterns, builder patterns, and prototype patterns.

Structural pattern is a summary of software design structure, focusing on the practical experience of class, object inheritance, and composition.

Common structural patterns, including bridge pattern, adapter pattern, decorator pattern, proxy pattern, composition pattern, appearance pattern, flyweight pattern, etc.

A behavioral pattern is a pattern summarized from the perspective of interaction and division of responsibilities between classes or objects.

The more common behavioral patterns are strategy pattern, interpreter pattern, command pattern, observer pattern, iterator pattern, template method pattern, and visitor pattern.

Summarize

This question mainly examines the degree of mastery of job seekers to design patterns.

During the answering process, you can choose some common design patterns and give some cases and usage scenarios.

Such as singleton mode, decorator mode, factory mode, proxy mode, etc.

Better to deepen the interviewer's recognition of you.

Remember to like and subscribe! ! !

file

Copyright notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated. Please indicate the source of the reprint Mic带你学架构 !
If this article is helpful to you, please help to follow and like, your persistence is the driving force for my continuous creation. Welcome to follow the WeChat public account of the same name to get more technical dry goods!

跟着Mic学架构
810 声望1.1k 粉丝

《Spring Cloud Alibaba 微服务原理与实战》、《Java并发编程深度理解及实战》作者。 咕泡教育联合创始人,12年开发架构经验,对分布式微服务、高并发领域有非常丰富的实战经验。