Programmers: US Mission to the interview so hard, I actually hung up

Programmers: US Mission to the interview so hard, I actually hung up

 

one side

1, self-introduction

A: The self-introduction is the only interview on their own initiative to introduce their part, we must take advantage of the good, you learn good data structure can Shredded a red-black tree data structure you say I grasp the good, anyway, is to take highlighted their strengths, such as its own knowledge of java in a more familiar, introduced himself as my undergraduate experience later, I said I was recommended for admission to graduate school to continue, and then the end will be the most familiar with their own java, then interviewer I will ask something of java;

2, Projects and Highlights

A: hard blow ...

3, eight kinds of data types java What?

A: This question was asked feeling rotten, int, short, long, float, double, byte, boolean, char;

4, asked a range Integer cached data?

A: -128-127

5, followed by the Object class asked in what ways?

A: I have memorized, clone, getClass, toString, finalize, equals, hashCode, wait, notify, notifyALL. (Interview do not know what this means)

6, there is then asked to come up with a question, the interviewer small piece of paper, in the above title, String A = "123"; String B = new String ( "123") ;, Q I generated several String object ?

A: I said that if the constant pool, the original there is no "123" is then generated two objects, if there are constant pool "123" as long as an object generator (Do not fucking interviewer asked this question)

7, as referred to wait, wait and sleep incidentally asked what is the difference?

A: wait, then releases the object lock, sleep, then do not release the object lock

8, as also mentioned hashcode, the interviewer then asked me, hashcode use where?

A: I can say without hesitation, hashmap and ConcurrentMap, where I guess the interviewer will certainly have to continue to ask me two things.

9. Sure, the interviewer said, talk about hashmap?

A: hashmap me about data structures hashmap of an array of linked list structure, put hashmap spoke of, get, the underlying principle of expansion, while talking about the difference between hashmap and in 1.8, put in a red-black tree introduced in 1.7, as well as expansion various times, these would talk quite a long time, and finally I said something hashmap is not thread safe.

10, here referred to hashMap not thread-safe, the interview asked me why not thread-safe, give a few examples?

A: I said, hashmap will be possible when the expansion ring, resulting in an infinite loop; hashmap in the insertion of a new phase when multiple threads simultaneously inserted, will in addition to other threads that last thread of the insertion node is lost ; for modification when multiple threads to modify, to keep only the last one thread to modify the results; expansion of time, will retain only the expansion of the array after the last thread; modified from the expansion increase say it again;

11, I thought then asked to ConCurrentMap, forehead, to my surprise, did not ask, I might feel very well prepared hashmap, and then went on to ask me a JVM know?

A: I say understand;

12, let me say JVM meaning of which is divided into pieces?

A: The method area, a virtual machine stack, native method stacks, stack, program counter, and then I myself did not wait for the interviewer to ask new questions, and then continue to say that the method is thread stack area and shared, virtual machine stacks native method stacks and program counter is thread-private, technology is in addition to the program memory overflow does not occur, other memory overflow will occur, and to say what will happen heap overflow which stack overflow will occur; this is we have to learn to say it it it it pile, as far as I observe each interviewer is interviewing each have a fixed time, over this time period is over, so long as you do not interrupt the interviewer, you say meal;

13, as mentioned memory overflow, the interviewer asked me the difference between memory overflows and memory leaks?

A: I say it is a memory leak of a memory after the application, can not go to relieve this memory, this memory is missing references; memory overflow is to apply enough memory, the memory can not afford to support what we need;

14, ask them where I had to ask the database, the four major characteristics is what, for example?

A: Atomic, I say a transaction is either completed or fail, either do or do not do; consistency, such as a + b = 100, a transaction such as a change in the increased value of a, you must change b, after the end of the transaction to ensure that a + b = 100 is still valid, and this is consistent; persistent, the amount is after you modify, take effect in the database is permanent; isolation, that is for me to make transfers a to B, a did not take the time to complete this transaction, B is not aware of a turn to give him money.

15, so what's isolation level data, each isolation level give an example?

A: The amount, (for example how to be sub-ah, ah ah ah ah ~), heart waves, his face deadpanned: 1 Uncommitted read, modify transaction took place, even if not committed, other transactions are also visible , I say for example a child a number of modifications to the original 50 100, but I have yet to commit changes, another transaction to see this change, but this time the original transaction rollback occurs, this time a or 50, but another a transaction sees is 100, which is read uncommitted; 2 read committed, that is, from the start for a transaction until commit any changes made by other transactions are not visible, for example a number a is the original 50, and then submit modified to 100, this time another transaction before a commit changes, read the a 50, just finished reading, it was modified to 100 a, and this time again to read another transaction found a 100 suddenly becomes a;. 3 repeatable read; repeatable read, reading is recorded for a plurality of times to record the same, for example if a number that has been read a a, between two consecutive read to A is the same; serializable read, that in the concurrent case, and the results serialized reading is the same, no different, I said this example, dirty reads and phantom reads does not occur; The database then this one is over.

16, I then asked the computer network, asked me which of Layer 7 Layer 7?

A: a physical layer, data link layer, network layer, transport layer, session layer, presentation layer, application layer;

17, then asked me where TCP, UDP, in which layer, HTTP in which layer?

A: TPC and UDP at the transport layer, and then asked me what HTTP layer, I look a little bit forgotten, this did not answer it, will go to see in the application layer.

18, asked to end here, then so what I want to ask the interviewer asked, I asked how to evaluate my performance in the interview?

A: Because one side are asking basic knowledge, the interviewer and I said, I feel you very solid foundation, he said, and I direct my words here is through, do not know how to ask the interviewer behind you, and then I said thank you, and went to a hotel conference room to wait two faces;

Two faces

Not long side, they flew a second interview, and midway feeling a little hungry, the US group pretty human words, put a bunch of cookies in the back of the table, forgot the name of the cookie, short especially good, I ate several pieces.

1, self-introduction

2, project reports, and highlights presentation.

Then I asked a collection of understanding it, let me speak of the difference between ArrayList and LinkedList?

A: ArrayList bottom is an array, LinkedList bottom is a list, ArrayLIst find data fast, LinkedList insert delete fast;

3, continue to ask me linkedList can be used for loop through it?

A: can not try not to use, linkedList bottom is a list, which can be traversed using for accessing each element is then accessible from the beginning until you find the element, for example, to find a third node, we need to find the first node and then locate the second node; continue to look for the first four nodes, not from the third node to start looking, or start from the first node, so very slow, not recommended and can be traversed with iterators.

4, tell us about ConCurrenthashmap

A: I feel because I questioned the hashmap, so the two faces The interviewer may be seen interview notes, the amount of this I am very familiar, that I speak for a long time, talked about the underlying ConCurrentHashMap segmented lock structure, told ConCurrentHashmap get the source code, source code is not get to use the lock, back here I get the source code written down, and spoke to the interviewer get the source code at the insertion modify delete multithreading is safe; then told put operation, remove, expansion operation, then the difference between the stresses of 1.7 and 1.8, the introduction of the red-black tree, chain length greater than 8 converted into a red-black tree, using CAS + synchronized to ensure concurrency-safe, it it it it also stresses quite a long time;

5, take a look at this question, spoke out a small piece of paper

A: This note is only the interviewer feel each note, so as much as possible and more exchanges around the students, maybe he is willing to have some of your interviewer to interviewer. Title: Let me count the value of their hands, a, b, c, d, and

 

Programmers: US Mission to the interview so hard, I actually hung up

 

The results are

a=8, b=5,c=7,d=35

Calculate finished I asked him right, he did not le me. . .

6, then asked me not to understand simple interest mode, write a singleton?

A: This preparation had before, I wrote a singleton pattern a double lock.

 

Programmers: US Mission to the interview so hard, I actually hung up

 

Do not write this recommendation singleton pattern, or directly to what kinds of privations

7, then asked me a virtual machine to understand it, introduce some of the virtual machine's memory model?

A: Before this has been prepared to note here, the data region memory model and runtime virtual machine is not the same thing; virtual machine memory model called JMM, that is, each thread has its own working memory, and then a main memory, thread work, when all copies in their working memory a copy of main memory; also said JMM happens before principle, the principle of procedural order, lock principle, thread interrupts principle, the principle of the transfer, there are other I did not say the verses.

8, introduce some garbage collection algorithm you know?

A: Clear labeling, marking consolidation, replication algorithm, the algorithm is valid and each say it again;

9, asked to be here, you know SurvivorRatio asked me why this parameter is the initial default of 8: 1: 1?

A: Because this just just asked a garbage collection algorithm, I think it may be linked to, so I said, to facilitate replication algorithm operation, Eden area mostly raw evening toward death, this ratio, you can easily copy algorithm from and to back and forth object replication survival, the amount of finished, he did not say what the feeling is acquiesced in it;

10, suddenly asked, binary understand it, write a binary tree traversal search of the depth?

A: At that time I heard middle title, a bit ignorant, what is the depth of a binary tree traversal search, I only know that traverse the level, before subsequent order preorder ah, I thought, feeling and post-order traversal quite like, I think it should be the post-order traversal, I first wrote after a written order traversal recursive

 

Programmers: US Mission to the interview so hard, I actually hung up

 

Then he looked at, did not spade, the interviewer feel a little less, then cold, and I'm not full interactive, emmmm .... down under their own Baidu, right. . .

This code is finished I asked, after I let go and so inform, answer me feel okay, and she did a few minutes, I went to inform on three sides;

Three sides

1, as usual, introduce themselves and Projects;

2, let me Shredded up a singleton. . .

A: I continue to write the double lock mode

 

Programmers: US Mission to the interview so hard, I actually hung up

 

3, so that spoke to me about the code is what does it mean?

answer:

STEP 1. A thread access getInstance method, because the single instance of the embodiments are not so locked into blocks.

STEP 2. Thread B getInstance access method, because the single instance of the embodiment has not, to reach the next block, and the next block has been locked thread 1.

STEP 3. A into the next thread is determined, because the single instance of the embodiment has not, so a single instance of the embodiment, the exit code blocks instantiated successfully, unlocked.

STEP 4. Thread B goes to next block, locking thread, into the next determination, as already instantiated, block exit, the lock is released.

STEP 5. A thread initializes and acquires the singleton instance and returns, the thread B can obtain a single embodiment A is initialized in the thread. Such is the case in general.

5, due to my project referred to JVM, so give me a scene out of the question, the garbage will retractor, after labeling to clear many times, the use of the mark is clear algorithm, then you think what problems might arise?

A: Then I said, due to the generation of memory fragmentation, so as to allocate a large object, because of the memory is not continuous, it will generate full GC;

6, here referred to the full gc, I asked what the situation will have full GC, which situations produce minor GC?

A: minor in eden district will have full, fullGC produce enough space in old age, and lack of permanent generation of memory fullGC also occur.

7, in addition to memory overflow problem in your project, you also know what about memory overflow memory leak?

A: Before you find out about ThreadLocal here, I say, ThreadLocal key-value pairs in the key is a weak reference, then the recovery time in memory, the key is likely to be recovered off, then the key is gone, you can not find value value, resulting in a memory leak;

8, then give me a hand-written code dynamic programming of a problem, say it to write code, generally in a matrix of n * m grid, looking for a maximum of a few square multiply few, somewhat forgotten,

A: Because the subject is not ready for dynamic programming, this topic see me just say a method of violence to resolve, and then let the interviewer prompted me to do with dynamic programming, I thought for a long thought out. . . . At that time the feeling should be cold. . .

Time about the same time, the interviewer said, right here, then let me out and so inform, and she informed me the interview is over today, a whole afternoon, especially particularly tired, before the end of both sides when feeling particularly stable, did not expect the end handwritten code because this one will not hang up the dynamic programming, the mentality was feeling a little collapse. . .

Interview recently put together a document explaining very thorough. Share with you today. Documentation includes a total of 14 chapters content from the foundation to the project, explain the depth and thorough, I hope you get the offer favorite.

 

Programmers: US Mission to the interview so hard, I actually hung up

 

 

Programmers: US Mission to the interview so hard, I actually hung up

 

 

Programmers: US Mission to the interview so hard, I actually hung up

 

 

Programmers: US Mission to the interview so hard, I actually hung up

 

Document Access: Can help forward + concern private letter reply "interview" get Oh! ! !

Java multi-threading

Programmers: US Mission to the interview so hard, I actually hung up

 

Java Advanced ssh / ssm framework

Programmers: US Mission to the interview so hard, I actually hung up

 

database

 

Programmers: US Mission to the interview so hard, I actually hung up

 

The internet

Programmers: US Mission to the interview so hard, I actually hung up

 

Document Access: Can help forward + concern private letter reply "interview" get Oh! ! !

Due to space limitations only show you some of the content, the following is the directory of the document, will participate in the interview program ape (Yuan) want to get the full document can help forward + concern private letter reply "interview" Get oh

 

Programmers: US Mission to the interview so hard, I actually hung up

Published 106 original articles · won praise 68 · views 50000 +

Guess you like

Origin blog.csdn.net/kxkxyzyz/article/details/104684445