All the major Internet Java surface Questions summarized, finally I successfully get Baidu offer

Source: Internet
Author: User
Tags cas

Java development also has more than 5 years of experience, in early July to the Royal Park, open interview experience, around 20 days, the main surface of the Internet company, one or two line large companies or financing startups have interviewed, took some offer, including Qihoo 360, the final comprehensive decision or to Baidu.

First of all, different interviewer interview style must be different, I am here to summarize these days of interview Java development process of most problems, comprehensive classification has Java Foundation, framework, multi-threading, network communication, database and design patterns, algorithms, and other modules, due to the problem is too many, the following first lists the problem, Then there is time to write an article answer, or there are many answers on the Internet, you can search by yourself.

About professional skills

Writing a project and then writing about the skills that a Java programmer should have in a 3-year working experience is probably something that Java programmers are more concerned about. I want to explain here that the following list is not everything----but if you master the more, the final evaluation, the salary will be higher.

1. Basic grammar

First, the Java Foundation

Why the 1.String class is final.

2.HashMap source code, the realization principle, the bottom structure.

3. The difference between class.forname and ClassLoader in reflection

4.session and cookie differences and connections, session life cycle, multiple services deployed when session management.

What is the difference between the queues in 5.Java.

6.Java of memory models and GC algorithms

New features of 7.java7 and Java8 (Baidu Q, good BT)

8.Java array and List of the operational efficiency of the two structures, in which cases (starting from the beginning, starting from the end, starting from the middle), which operations (INSERT, find, delete) the efficiency of high

9.Java Memory Leak problem Survey Location: Jmap,jstack use and so on

Second, multi-threading

This is also a must-ask piece. Because three years of work experience, so basically will not ask you how to implement multi-threading, will ask in depth, such as the difference between the thread and runnable, how to start a thread more than once, the thread has what state. Of course, this is just the most basic, unexpectedly, several interviews have been asked at the same time a question, the law is different, summed up is such a meaning:

If there are Thread1, Thread2, Thread3, Thread4 four threads respectively statistics C, D, E, f four disk size, all threads are counted to the THREAD5 thread to do the summary, how should be implemented?

Do smart netizens have an answer to this question? It is not difficult, there are ready-made classes to use under Java.util.concurrent.

In addition, the thread pool is a more frequently asked piece, the common thread pool there are several? What is the difference and connection between these kinds of thread pools? How does the thread pool implement the principle? Actually, it will give you some specific scenarios that allow you to answer this scenario by using what kind of thread pool is more appropriate.

Finally, although the interview did not ask a lot, but multi-threaded synchronization, lock this piece is also the focus.

Synchronized and Reentrantlock differences, synchronized lock common method and lock static method, the principle of deadlock and troubleshooting methods and so on, on multi-threading, I have in the previous article summed up the 40 problems of multithreading, You can see a summary of the 40 Java multithreading issues.

Third, IO

The content of the IO is replenished again, and I forgot to write it before.

Io is divided into File io and socket io,file io basically will not ask, ask also can not ask what come, usually will be good, also remember File io are blocking IO.

Socket IO is an important piece to understand the difference between blocking/nonblocking, synchronous/asynchronous, understanding the four IO models of blocking IO, nonblocking io, multiplexed io, asynchronous Io, and how Socket io is associated with these four models. This is some basic, in-depth words, will ask the principle of NiO, NiO belongs to what kind of IO model, NIO three major components and so on, this is difficult, I also studied for a long time to understand NiO. In other words, NIO is not a strictly non-blocking IO but should be a multiplexed io, which should be noted in the interview answer, and that NiO blocking the selector Select method will increase the interviewer's affection for you.

If used Netty, may ask some netty things, after all, this framework basically belongs to the current best NiO framework (Mina is actually good, but overall is not as Netty), most Internet companies are also using Netty.

Four, JDK source code

To get high wages, JDK source code must be read. The above content may also be linked to specific scenarios, JDK source code is real deal to see if you usually love to delve. In the process was asked a lot of JDK source code problem, one of the most tricky one asked, string of Hashcode () method is how to achieve, fortunately, the usual string source codes to see much, answered a probably. JDK source code In fact there is nothing to summarize, purely to see the individual, summed up the more important source code:

(1) Source Code of List, MAP, set implementation class

(2) Source code of Reentrantlock and Aqs

(3) The realization principle of atomicinteger, mainly can explain the CAS mechanism and atomicinteger how to use the CAS mechanism to achieve

(4) The implementation principle of thread pool

(5) Methods in the object class and the role of each method

These requirements are very high, the last year of the basic JDK in the main class of the source code study all over again, really spend time, spend energy, of course, look back, it is worthwhile----not only to meet the interview.

V. Framework

The difference between 1.struts1 and struts2

The difference between 2.struts2 and SPRINGMVC

What jar packages need to be referenced in the 3.spring framework, and the purpose of these jar packages

The principle of 4.srpingMVC

Meaning of the 5.springMVC annotation

The relationship and difference between beanfactory and ApplicationContext in 6.spring

Several ways to inject 7.spring

8.spring How to achieve the management of things

Principles of 9.springIOC and AOP

How to use and differentiate between Level 1 and 2 cache in 10.hibernate

How to loop injection in 11.spring

Vi. Database

The database will also be asked in all likelihood. Some basic differences, such as union and union all, the left join, several indexes and their differences are not discussed, the more important is the optimization of database performance, if the performance of the database optimization is not a good thing, then there is time, It is also recommended that you spend one or two days before an interview to prepare for SQL-based and SQL-optimized content.

But the database does not worry, a company often has a lot of departments, if you are not familiar with the database and the basic technology is very good, 90% will want you, it is estimated to put you in the database use is not very demanding departments to exercise.

VII. data structure and algorithm analysis

Data structure and algorithmic analysis, for a programmer, will be better than not and in the work can definitely come in handy. Arrays, linked lists are the foundation, stacks and queues go deeper but it's not hard, trees are important, more important tree AVL trees, red and black trees, can not understand their specific implementation, but to know what is the two-fork search tree, what is the balance tree, AVL tree and red black tree difference. Remember an interview, an interviewer and I talked to the index of the database, he asked me:

Do you know what kind of data structure is used for indexing?

Answer the use of the hash table, answer the wrong. He asked again, do you know why you use trees? Answer that because the hash table may appear more conflicts, in tens of millions or even billions of levels of data before, will greatly increase the time complexity of the search. And the tree is more stable, the basic guarantee up to twenty or thirty times to find the data you want, the other side said not exactly, finally we still exchange a bit of this problem, I also understand why to use the tree, here do not say, friends think why the index to use the tree to achieve it?

Viii. Java Virtual machine

Unexpectedly, the Java Virtual machine should be a very important piece of content, the results of these companies are asked the probability of almost 0. You know, last year, it took a lot of time to study the Java Virtual machine, the light Zhou Zhiming teacher's "in-depth understanding of Java Virtual Machine: JVM advanced features and best practices," studied not less than five times.

Anyway, although the Java Virtual machine did not ask, but I think it is necessary to study, simply make an outline, talk about the more important Java Virtual machine content:

(1) Memory layout of Java Virtual machine

(2) GC algorithm and several garbage collectors

(3) class loading mechanism, that is, parental delegation model

(4) Java memory model

(5) Happens-before rules

(6) Volatile keyword usage rules

Perhaps the interview is useless, but on the way to Daniel, not necessarily, this is the interview a few companies finally through the integration of these questions, the interview decided your salary, must treat, these questions may not ask, but the programmer more than the pressure, and finally received the offer of Baidu, pay is good, To share these questions to help those who are planning to go to the job, and to find friends to record some video, there are for the Java interview, there are some of the internet industry some technology, including Java high concurrency, distributed, micro Services, JVM, IO, and other technologies, into the group free to share to everyone! Java back-end technology Exchange Group:720893309

All the major Internet Java surface Questions summarized, finally I successfully get Baidu offer

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.