Java Interview Preparation

Source: Internet
Author: User

Today we will be divided into four parts to talk about this problem, because I am a Java origin, so about the main language problems are related to Java, other language students can selectively ignore. In addition, the interview when the general interviewer's problems are closely linked, gradually in-depth, this point in the following can be more clearly felt.

1, the main language itself and its advanced features.

The main language is, of course, the guy you get to make money on weekdays. Don't tell me you don't have the main language, you will be n multiple languages, or you are proficient in n multiple languages.

And my main language is obviously Java, then for Java, its language itself and its advanced features, what is more easy to ask in the interview?

Generally speaking, the following knowledge points are very easy to ask. (PS: The following are some of the relatively advanced Java knowledge points, because this is about social recruitment, not school recruitment)

1) Java Data Structure-related class implementation principles, such as linkedlist,arraylist,hashmap,treemap this kind of. The following is a simple simulation of a data structure of a serial cannon.

For example, the interviewer first asked you if HashMap was orderly?

You must have replied that it was not orderly. The interviewer will continue to ask you, is there a sequential map implementation class?

If you don't know that at this time, that's the end of the question. If you say there are treemap and Linkedhashmap.

Then the interviewer may then ask you, how do treemap and Linkedhashmap keep it in order?

If you can't answer it, that's it. If you still answer, then the interviewer will continue to ask you, what do you think the two of them in order to achieve better?

If you still can answer, then the interviewer will continue to ask you, do you think there is a better or more efficient way to achieve it?

If you can still say it, you can still ask a lot of questions about the way you say it.

The above is an example of an interviewer's step-by-step questioning. So, if you know not much, do not perfunctory, because the next problem you will be exposed, it is better to say no, the problem is over, quickly switch to your familiar areas.

2) The classes in Java and the contract, what they all do, and how they are implemented, these classes are the java.concurrent packages. As with the above, we also simply simulate a serial cannon that has been contracted.

For example, the interviewer might ask you if you want to implement all of the threads waiting for an event to occur, and when an event occurs, all the threads start to execute together, what's the best way?

At this point you might say that you can use fences (Cyclicbarrier in Java's concurrent packages), then the interviewer will continue to ask you, do you know how it works?

If you continue to answer, the interviewer may continue to ask you, do you know any other ways of achieving it?

If you can tell a lot of ways to do it, then continue to ask, which way do you think is better?

If you say that one way is better, the interviewer can still ask you, if you want to write, do you think there is a better way to achieve it?

If you can still say that you are better at this time, then the interviewer will still be tugging at this and ask you again.

Why do you want to lead the interviewer during the interview, the reason is here. Because the interviewer's questions are often traceable, if you capture his trajectory, you can guess what he's likely to ask below, and you can say it in the direction you want to talk about when you answer. So the interview will appear more leisurely, more comfortable.

3) The contents of the IO package and the NIO package. This part of the NIO will be the focus, most of the IO package will be more familiar, so may skip directly to ask you the content of NiO.

The contents of the IO package and the NIO package are relatively different, first of all the NIO models should be familiar, especially the selector must be very clear about its responsibilities and implementation principles. In fact, the core of NIO is the IO thread pool, be sure to remember this key point. Sometimes, the interviewer may also ask you about the design pattern of the IO package (adorner mode), why design it like this?

Some interviewers will ask you if there is a better design, this time if you do not know to be decisive to say that their current level is limited, can not think of a better design, do not say, random yy.

4) The contents of the Java Virtual machine. This part mainly includes three parts, GC, class loading mechanism, and memory.

A GC part of a simple serial cannon.

The interviewer can ask you first what time an object will be GC?

Then continue to ask why you want objects to be GC at such times?

Then continue to ask you what sort of GC strategy is there?

If you say so, continue to ask you what are the advantages and disadvantages of each of these strategies? What are the scenarios for?

After you continue to speak out, give you a practical scenario that lets you choose a GC strategy?

If you choose to go ahead and ask you, why do you select this strategy?

Here is a simple serial cannon about the class loading mechanism.

First of all, I must ask you first what is the class loader for Java?

After answering these questions, you may be asked what classes each ClassLoader loads.

After that, you may be asked what is the parent-child relationship between these class loads?

You may refer to the Parental delegation model when you answer, so you can continue to ask what is a parental delegation model?

When you're done explaining it, you may continue to ask why the Java ClassLoader uses the parent delegation model?

After you have answered, you may continue to ask how you can customize your own classloader, how does your ClassLoader and Java-loaded classloader relationships work?

Let's have a serial cannon about memory.

The first thing is to ask you which parts of the memory are divided, which data are stored separately?

And then I'll ask you. How does an object survive and move from creation to destruction in these parts?

You may then be asked what part of the memory will be involved in GC recycling?

After that, you may be asked how the Java memory model was designed.

When you answer it, you'll continue to ask why you're designing it.

After that, you may also want to talk about the role of the volatile keyword with the design of the memory model?

When you are talking, you will definitely mention visibility, then the three words of visibility, you can continue to ask your concurrency.

Basically the Java language itself and the language of the slightly higher point of the content is the above, if you can get the above four parts of the very thorough understanding, that basically Java this part is not a problem, because the content of light above is enough for you to chat with the interviewer for a long time. When you talk about this for a long time, naturally asking you other questions will be a little shorter.

You from I write these questions the process should also be able to feel, many times, the interviewer is along a line all the way down, if you think this line you are not familiar with, you must turn in time, guide the interviewer to ask other aspects of the problem. Do not keep down the depth until you can not jump out, then embarrassed a embarrassed.

2, tell their own projects, and in the middle interspersed with problems

This part of the interview process must be asked, but also the longest chat stage. Unless you have a very solid language section in front of you, and have been asked by the interviewer for one or two hours, you still haven't found out how deep you know the language itself. Otherwise, you will not be able to escape your own project this level, and generally speaking time is not too short.

In this part of the story, the general pattern is to tell you what you've done, and then the interviewer will sudden you to explain a part of it, such as explaining why you did it at the time, or asking if you think there's a better way. Most of these interspersed questions are related to the technology you use for your project. And what you need to do is to fully and fully summarize the projects you've done (especially the last one or two projects), and dig out one or even n bright spots for the interviewer to create a bright feeling. If you can achieve this effect, it is basically not far away from your success.

3. Extra sub-items

The above two stages are basically required, and there are some additional points. These add-ons, some content interviewers will also ask you (such as TCP/IP protocol, algorithm), but more will be asked you do not understand, you know the words to continue to chat, do not know the words directly skipped, not because of this problem and directly into hell.

I would like to make a list of these additional points, and if so, the additional points will have to be sought.
1, computer system principle.
2, Network Communication Protocol (TCP/IP,HTTP, etc.).
3, data structure and algorithm.
4, the source code of the famous open source project.
5, you have a great open source project.
6. Your personal blog.


Article from: Link http://www.imooc.com/article/19239

Java Interview Preparation

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.