15 super classic big factory Java interview questions! Top priority

Programmer fish skin 2022-06-24 05:40:47 阅读数:622


Starting from the back-end interview question of UHF , Indicate the learning direction

Hello everyone , I'm fish skin .

Remember my brother, little Abba ? He is now in his freshman summer vacation , Self taught programming at home ( Short video ) in .

He spent the whole freshman year studying . later , I took him to write once , It collapsed , Wrote a bunch of bug!

Please read : The front-end brother wrote the back-end for the first time , Collapse !

But I didn't think , After stepping on the pit , Instead, I fell in love with back-end development . It haunts me this weekend , Let me tell him what back-end development should learn .

Although I really want to summarize a back-end learning route for him , But I'm also busy , So he thought about whether there was a faster way for him to understand the technology to be learned at the back end .

I think : He studied programming to get a good job , If you want to find a good job, you must pass the interview first ...

With ! My friend happened to be in the big factory “ ABA, ABA ” do Java Back end interviewer , I sent little Abba directly to the interview , Can't you let him know the technology he wants to learn ?

OK, take off !

take off

A day later , Little Abba is back , Look bitter , Said he didn't answer a question .

I asked the test center , Laugh and say : You're so lucky , This is not all in the back-end interview UHF Classic topic ? All middle school !

Okay , Let's pass the big factory interview question , Share what back-end programmers need to learn and why .

From the interview questions, we can see the necessary knowledge

The outline :

You must learn - Mind mapping

programing language

For programmers in development positions , Whether it's the front end or the back end , The minimum requirements are Skillfully use At least one programming language . The core language of the front end is JavaScript, There are Java、C++、Golang、Python etc. .

at present Java The demand for back-end posts is relatively large , So here we are Java For example .


Interview questions

Java in == and equals The difference between ?

Answer key



Proficiency is not just enough to write code , Many programming syntax levels Little details We must also pay attention to ! At work , quite a lot bug It is precisely because of the lack of detail knowledge , Therefore, these details are also the interviewer's favorite inspection points .

such as Java Medium == and equals Is to judge whether the variables are equal , But what's the difference ? If not used properly , It is likely that variables with the same value will be judged as unequal , Cause business logic error . also final keyword 、volatile Keywords, etc , They are commonly used Java grammar , It's also a high-frequency test site .

therefore , It's important to consolidate the foundation of grammar , recommend 《Java Core technology volume I》.

Class library

Interview questions

Java Sets in and their inheritance relationships ?

Answer key



Each programming language has built-in class libraries and functions , Although it may not be the most convenient , But usually the source code implementation is more reasonable 、 Good performance, too . Want to be proficient in using a programming language , Improve development efficiency , Or write your own encapsulation Library , We must first master the native class library of the language .

such as Java Collection classes are provided in , Let's easily manipulate various data structures , For example, array 、 Linked list 、Set、Hash etc. , These are classes commonly used in work , Therefore, it is necessary to understand their principle , To be more reasonable 、 Use correctly . image HashMap Implementation principle of 、HashMap and HashTable The difference between 、ArrayList and LinkedList The difference between , It's also a high-frequency test site .

Java Set framework relationship


Interview questions

What is? Spring Dependency injection of ?

Answer key



In addition to infrastructure , Development in the enterprise is basically based on the ready-made framework , You don't have to write everything yourself , Can greatly improve the development efficiency . But being able to use the framework is only the most basic requirement , How to maximize the performance of the framework 、 Lower out bug Probability 、 Further reduce development costs 、 Even how to design and implement a framework , That's what good programmers should think about . therefore , The design principle of common frame is high-frequency test site , such as Java in Spring The core design of the framework IOC and AOP、 Use multi-level cache to solve circular dependency, etc .


Interview questions

JVM What is the memory structure of ?

Answer key



In the interview of a large factory , Without the underlying implementation of the programming language .

Although this knowledge is rarely used directly in work , But when books are used, they hate less , The demand of large factories for job seekers is usually not what you can do now , It's whether you can meet potential challenges in the future . In case there is an urgent and serious problem in the online program bug, Need to analyze the garbage collector's log , Let you learn now , Is there any time ? This requires us to understand the underlying , Yes Java Speaking of , The key is Java virtual machine (JVM).

Besides , Understanding the bottom layer can deepen your understanding of programming language and Architecture , Many underlying design principles can be applied to working programs , Like how to allocate and manage memory 、 Garbage collector design 、 Recycling algorithm, etc .

In a nutshell : Play with the tools, understand , Make it possible to make tools .

Recommended books :《 In depth understanding of Java virtual machine 》 The first 3 edition

《 In depth understanding of Java virtual machine 》 The first 3 edition

Fundamentals of computer

No matter what programming language you learn , This knowledge is an important basic skill for programmers . Although it may not be directly used in work , But lay the foundation , It can improve your programming ability and literacy in all aspects , In the face of problems, there will be more ideas and thinking .

The interviewer passes these questions , Can see if your study is solid , reliable .

data structure

Interview questions

How to use stack to implement queue ?

Answer key



Data structure is an important idea independent of programming language , Like a linked list 、 Array 、 Stack 、 queue 、 aggregate 、 character string 、 Hashtable 、 Trees, etc. , Are commonly used data structures for writing programs , Therefore, it is also a high-frequency examination site for interview .

In the work , Although you won't let yourself implement a data structure , But at least understand the characteristics of each data structure 、 Use scenarios 、 Time and space complexity , Otherwise, the code written may “ Heavy and slow ”, A bit careless , out of memory !



Interview questions

Suppose you're climbing the stairs . need n To reach the roof . Every time you climb 1 or 2 A stair , How many different ways can you climb to the roof ?

Answer key



Similar to data structure , Algorithm is also the core quality of programmers . Like sort 、 Dynamic programming 、 recursive 、 iteration 、 Two points 、 Divide and conquer 、 Deep search, wide search and other basic algorithms , Are the focus of the interview .

computer network

Interview questions

TCP Three handshakes 、 What is the process of four waves ?

Answer key



For back-end development , Most of the work is to write interfaces , Accept network requests sent by the front end or other clients , Give the corresponding data response . therefore , Network knowledge is very important .

For example, network protocols commonly used in work 、HTTP Request and response 、 conversation 、 Four or seven layers load balancing, etc , Are common test sites . Because a lot of agreements are in TCP、UDP Packaging on the basis of , therefore TCP and UDP It's also a high-frequency test site . Understanding these helps to write more elegant and standardized interfaces 、 Reduce the time-consuming of network requests 、 Or improve the concurrency of the whole interface .

TCP Three handshakes

operating system

Interview questions

What is a deadlock ?

Answer key



Although the operating system is very low-level knowledge , But after all, the programs we write run on the operating system , Therefore, some concepts of operating system are used by developers all the time , Such as processes and threads 、 Deadlock 、 file 、 Socket 、CPU、 memory management 、 I/o, etc. . The depth of your thinking 、 The limits of program performance optimization , Much depends on the understanding of the operating system .

software development


Interview questions

MySQL How to optimize performance ?

Answer key



Most programmers who do back-end development can't do without databases , And the basic work is to write CRUD, Add, delete, modify and query data from the database .

For small projects done in school , Basically understand the use of database , Can write a few simple SQL That's enough . But in big factories ( In especial ToC) in , The amount of data is often millions 、 Even hundreds of millions , This puts forward requirements for database design and performance optimization .

therefore , In the back-end interview of a large factory , The UHF interview question is :MySQL How to optimize performance ? For this kind of problem , It's easy to be exposed by the interviewer just by reciting , I recommend doing a project myself , Design a library table actual combat , See if different optimization methods are effective 、 How much effect can you get .

Another common interview question is : Here's a scene for you , Let you design the database table structure . Most of the questions require you to play on the spot , So do more projects at ordinary times 、 It's really important to refer to the design of other systems .

Besides , Also learn about common concepts in databases , For example, affairs. 、 lock 、 Index, etc. ; There are also some basic operations , Like stored procedures 、 Backup 、 Locate slow queries . Otherwise, the code may have bug、 The data inserted accidentally is inconsistent 、 Accidentally locked the whole watch 、 There's nothing I can do to delete the database and run away .


Interview questions

Redis What are the data types ?

Answer key



Redis It's a high-performance Key-Value database , It plays a very important role in back-end development .

For example, in order to improve interface performance 、 Reduce database pressure , use Redis Do the cache ; To resolve concurrency conflicts , Use Redis Do distributed locks ; In order to achieve single sign on 、 Improve user efficiency , Use Redis Store session or token ;Redis It can also be used to make real-time leaderboards 、 Counter 、 The bloon filter 、 Queue system, etc .

therefore , In the interview of a large factory ,Redis There are more and more test sites , Common are Redis Basic use of ( What are the data types ? What are the application scenarios ? Cluster building )、 Working mechanism ( Persistence mechanism RDB and AOF The difference between ? Why single thread ?) 、 Scene design, etc .

Design patterns

Interview questions

Please write the implementation code of singleton mode ?

Answer key



Design patterns are abstracted by programmers in the process of software development 、 Solutions for the same kind of problems , It's generally a ratio function 、 Higher level abstraction of components , Code that uses design patterns generally has the following characteristics :

  1. Reuse code , Reduce repetitive code writing and copy and paste
  2. Better maintenance 、 Scalable
  3. Improve development efficiency
  4. Novices don't understand , Programmers who understand design patterns can understand at a glance

Because of these advantages , Design patterns are very helpful to improve work efficiency and ideas , It has also become a high-frequency examination site for interview . Although there are common design patterns 3 Categories: 、23+ Kind of , But the interview focus is mainly on the single case mode 、 Factory mode 、 Observer mode, etc .

Concurrent programming

Interview questions

Why pool threads ?

Answer key



How to use the least resources , Write higher performance 、 More reliable 、 More extensible programs are something that back-end programmers need to think about . therefore , High concurrency programming is the focus of the interview . It's like a thread pool 、 lock 、 queue 、 Contract issuance 、 Synchronous asynchronous, etc , All high-frequency test sites . Sometimes I will give you some practical problems to analyze , For example, the design of the classic second kill system 、 How to solve the oversold problem .

Thread pool


Interview questions

Linux Top What does the output information of the command represent ?

Answer key



Enterprise projects are generally deployed on ECs , Most server operating systems are Linux, Therefore, back-end development work , It is essential to operate Linux The server , Such as deployment projects 、 Install and configure services 、 View system operation information 、 Locate problems on the line, remove obstacles, etc .

therefore , Be familiar with the basic Linux command , Able to adapt to command line operation without mouse .

Also learn about some common system analysis commands , Help with troubleshooting . such as top command , You can view the resource usage of the system 、 Overall load , You can also see how much each process takes up CPU、 Memory , To lock the exception thread .

Linux top command


Interview questions

You used Git Version control system ?

Answer key



Most of enterprise development is teamwork rather than individual combat , Many people have to write code for the same project at the same time , So how to ensure code synchronization 、 Reduce conflict 、 Look at the changes ? This requires the use of a version control system , At present, the mainstream is Git.

Now ,Git It's already a required course for programmers , But many students just know a few simple Git operation , Such as uploading and updating code to GitHub, That's not gonna work . At work , The workspace is also often used 、 Branch 、 Merge 、 Back off 、 Conflict resolution capabilities , You must also know how to operate .

By the way , What most employees need to do when they first enter the company is to use Git Pull the code , If you can't even do this , It's really embarrassing .


Interview questions

What is microservice ? What's the difference from traditional architecture ?

Answer key



Today's architecture forms are rich and colorful , It's not an era when a set of structures eat all over the sky . Single point 、 colony 、 Distributed 、SOA、 Microservices 、 Containers 、 Cloud native 、 Service Grid , What are the characteristics of these architectures ? Which scenarios apply ? How to choose ? How to achieve ? These are all issues that back-end programmers need to consider 、 Learning and practice .

Example of architecture diagram

After listening to my analysis , The arrogant little Abba became silent , I ordered Fabulous Just put down the phone .

Want to learn the back end and enter a big factory , It's really a long way to go , You come on !

I'm fish skin , Finally, I'll send you some more Help me get to the big factory offer Learning materials

ran , leave 6T Resources for !

Welcome to I started from 0 Self study and enter Tencent's programming learning 、 To apply for a job 、 Textual research 、 Book writing experience , No more confusion !

I studied computer for four years , Mutual encouragement !

copyright:author[Programmer fish skin],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/175/20210805203720381a.html