preface
Along the way, I also encountered a lot of difficulties and stepped on a lot of pits. At the same time, I also explored a lot of learning methods, summarized a lot of experience, and did some research and corresponding preparation for the interview.
Here to share interview ali, toutiao, Tencent experience and some summary
All ali
I interviewed for the position of R&D engineer. I made internal recommendation directly to the big man of Ant Financial, and participated in the early approval interview of the middleware department of Alibaba. After four interviews, I got the oral offer.
A:
- To introduce myself
- What do you do in the project? What are the difficulties.
- Java thread pool describes the function of each parameter and how it works.
- A: Redis
- How to implement the global ID of distributed system. Zookeeper: Machine number + timestamp.
- Distributed locking, redis or ZooKeeper is better. In clustered deployment, which one performs better in high concurrency?
- Kafka knows what message queues are.
- Business or research?
- Then came the question, Linux access is in RWX format. Use a class to support the increase, deletion, change and review of access, and pay attention to the data format and method efficiency, specification. I was given over an hour to write the problem.
It takes nearly 30 minutes.
2:
- Describe the project you worked on and the difficulties involved.
- Last time the interviewer asked me what is the function of reflection.
- Data warehouse, multithreading and concurrency tools, etc.
- Private cloud, Docker and K8S etc.
- Know which middleware, Dubbo, RocketMQ, MyCAT, etc.
- How to implement RPC in Dubbo.
- What should I do to implement RPC myself
- Dubbo service registration and discovery.
- I heard I was ungrad, so I asked about sorting algorithms
It takes nearly 30 minutes.
Three sides:
The three interviews were not an interview, but a written, three-hour test on the basics of Java core. But it doesn’t seem to penetrate the problem, so I won’t say. It’s all very difficult.
Java concurrency, collection classes, thread pools, communication between multiple threads, etc.
HR:
HR little sister is very gentle and happy to talk about life and dreams. For 30 minutes.
Five surface tencent
I interviewed for the position of background development engineer, and I did not choose my target business group.
The department of SNG grabbed my resume and started the interview. Their technology stack is mainly Java, so they have gone through four technical interviews and one HR interview and got the offer.
A:
- Ordered array sort, binary, complexity
- Common sorting algorithms, quick sorting, time complexity
- The height of a full binary tree with N nodes. 1+logN
- The point-to-point relationship between friends is maintained by graph, how to judge whether two people are friends, and look up set, time complexity, process. No clear
- Cell point shortest method, time complexity
- How to implement keyword input prompt, use dictionary tree, how much complexity, there is no other scheme, answer hashing, if it is Chinese, build dictionary tree after word segmentation?
- Let’s talk about the implementation of hashMap. We’re going into a lot of detail here. Talk about red-black tree structure, query performance and so on.
- Java garbage collection talk, talk about generation, GC algorithm, GC root reachability analysis, etc
- Tell me what you did on both projects.
- What other techniques did you learn besides code? Frameworks.
- How do deadlocks occur
- The difference between threads and processes
- How processes communicate
- CPU execution mode
- Code encountered process blocking, process zombie, memory leakage and other situations how to troubleshoot. Perform troubleshooting by querying status through PS and analyzing dump files.
- For Linux, check the process status ps and CPU status top. Run the netstat grep command to check the process that occupies the port
- 10GB file, only 2g memory, how to find the specified string location in the file. MapReduce splits files.
2:
- The time complexity of fast row, the bubble time complexity, whether fast row is stable, the process of fast row
- 100w numbers, how to find the first 1000 largest, heap sort, how to construct, how to adjust, time complexity.
- A matrix, from the top left to the bottom right, with a weight at each position. You can go up and down, left and right, to the bottom right corner of the path with the lowest weight.
- Four cars, each can go a kilometer on a full tank, how can one car go the farthest? After several schemes, the interviewer guided me to optimize them, but I was still not satisfied, and finally he said to skip them.
- Implementation of hashMap, HashTable, ConcurrenthashMap implementation.
- MySQL index, B+ tree nature.
- How to check CPU 100 of Linux, top Jstack, log, GUI tools
- How to check a line in a Linux large file.
- Redis memory database memory refers to shared memory
- Redis persistence
- Second kill system architecture design
Three sides:
- The set of a billion numbers and the set of 10w numbers, how to find their intersection.
- Billion and number to find the top 100 largest heap sort, how to implement, how to adjust.
- TCP and UDP differences, specific use scenarios.
- TCP wave four times to explain the process, the last ACK if the client did not receive what to do.
- For socket programming, what does the accept method do? In the third handshake, you can guess why.
- Linux operating system? A little bit, but no questions asked.
- For the singleton pattern, what are the usage scenarios, talked about the global ID generator, he asked me how to implement the distributed ID generator, said ZK, asked me if ZK understood the principle, talked about ZAB, and then stopped asking.
- Besides singletons, do you know how to implement the adapter pattern
- Back to the Internet, just now you said about the live broadcast scene, do you know how to design the structure of live broadcast and what the key points are? You made several mistakes. He said to avoid broadcast storm, but no.
- What is the difference between Redis and MySQL?
- I asked what books I read recently and when did I start blogging
- I asked how many more interviews there were, and he said I could pass this one, which was a bit of a surprise
All around:
After more than half a month on the three sides, four sides were finally arranged.
- To introduce myself
- Project, harvest
- What does Linux know, basic commands and knowledge. Proc file system: Proc file system: proc file system
- The core difference between TCP and UDP is that the sliding window ensures reliable and orderly transmission, while UDP is not reliable. TCP requires a connection while UDP does not.
- TCP wave four times, time wait state meaning.
- With that he asked if I had any questions for him.
- I asked him why it took so long, and the first three interviews were just preliminary interviews, and he said he was on vacation recently, so… Had me worried for a long time. He said to wait for the HR interview.
HR:
To introduce myself
Internship harvest
Exchange Experience in Taiwan
Have you got the offer from the company where I practiced before? How will you choose
Rank factors such as company, department, salary and city.
What are your strengths and weaknesses? How can you improve them
My greatest success as a student
Your expected salary
Three sides headlines
The interview position was background R&D engineer, and the location was Shanghai. Through the boss’s internal promotion, he skipped the death test and went directly to the video interview, which started at 3 o ‘clock and ended at 8 o ‘clock in the evening.
There were three rounds of technical interviews, each of which required me to write code and ask questions in a style similar to Tencent. I also liked to ask some basic knowledge, which made me feel a little confused.
A:
- Let’s write a problem. Find the median of an unordered array
- I wrote a quicksort, and I was told to find the KTH largest number in an unordered array, and I said sort first and find later, but I can actually use the quicksort partition function.
- What’s the worst case, what’s the best case, what’s the heap sorting time, what’s the heap building time, NLGN.
- Operating systems? Linux and Windows
- Talk about disk management for Linux
- What are the methods of process communication in Linux
- How to implement Linux shared memory is explained briefly.
- Shared memory implementation of the specific steps, I said that did not
- Socket network programming, say TCP three handshake and four wave, the middle network is not good, the interviewer did not hear clearly, very embarrassing
- Skipped the network and asked about the project
- Asked me how to explain Docker clearly, I explained the specific implementation from physical machines, virtual machines to containers.
- Ask me the implementation of cgroup in Linux, no.
- How many threads have been used? CHM and Countdownlatch were used in their internships
2:
- To introduce myself
- Java collection classes which are thread-safe
- How does hashMap implement these collection classes
- MySQL index implementation, innoDB index, b+ tree index is how to achieve, why use B + tree index node, how much data stored in a node, how to specify the size, and disk page corresponding.
- MySQL transaction isolation level, and what problems are resolved separately.
- If Redis has 100 million keys, will using keys affect the online service? I said yes, because it is a single-threaded model, multiple nodes can be deployed.
- Ask me if I know of a command that can do this. I don’t know
- Redis persistence mode, AOD and RDB, how to implement, append logs and backup files, the underlying implementation principle, do you know, not clear.
- Ziplist + QuickList, ziplist compresses space, QuickList implements linked lists.
- Sortedset is a simple, quick query structure that uses dict+ Skiplist.
- What do you know about message queues, RMQ and Kafka
- Time to write the problem. Problem 1: Write a sequence traversal.
- Write an insert tree node into a sort tree insert method, using recursive way to find the insert position.
- The third problem: a directed graph with adjacency matrix representation, and is entitled graph, now ask how to determine whether the graph has a ring.
- Problem 4: a binary tree, find the longest path in the binary tree.
Three sides:
Three of the interviewer really high cold ah, serious smile calculate, I asked him he does not love to take reason, make me a panic than, feel cool.
1 Introduce the project
2. How are CHM and Countdownlatch used for the concurrency technology you mentioned
3 why do we do this? Is it ok to use a thread pool? I said yes
4 operating system process communication, zombie process and orphan process is what, how to avoid zombie process, I said to let the parent process display notification, how does the parent process know the child process is over, answer won’t.
5 computer network TCP and UDP have what difference, why thunder download is based on UDP, I said FTP is based on TCP, and thunder is p2p does not need TCP so reliable transmission guarantee.
6 He said no, I said is it because of the cost of establishing a connection, he said no
7 I said that p2p sending nodes are many, so it is not so necessary to ensure all kinds of transmission, he said wrong.
8 I said TCP will automatically subcontract and TCP can define its own data length. He was still wrong.
Finally he said forget it. Let’s ask the next one.
9 OS deadlocks and how to avoid deadlocks.
10 Write an LRU cache, need to complete the timeout and LRU flush.
When I said LHM, he said LinkedList and HashMap.
So I’m going to put and GET, and I’m going to do head and tail.
He asked me whether the complexity of GET would be too high. I made up my mind for a long time and couldn’t find a way. He said that’s all.
11 execrable, obsolete processing I haven’t written, you said the end, feel cool ah, I said I want to finish the rest of the logic, he said no, the heart cool a big section ~
Then HR asked me to wait for the result. Slipped to slip
The last
Finally, the following points should be emphasized:
- 1. Be careful about what you put on your resume. Be very familiar with what you put on your resume. Because most of the time, the interviewer will ask based on your resume; It’s also important to have a project that’s on the table, and this is likely to be the place where the interviewer will ask a lot of questions, so take a good look at the projects you’ve worked on before the interview;
- 2. Talk to the interviewer about basic knowledge, such as the use of design patterns, the use of multi-threading, etc., based on specific project scenarios or how you use them in daily life;
- 3. Be aware of your open Source Github project. Interviewers may dig into your Github project and ask questions.
Personally, I think the interview is also like a brand new journey, failure and victory are common. Therefore, I advise you not to lose heart and morale because of the failure of the interview. Don’t be complacent because you passed the interview, you will be a better future, continue to work hard!
The above interview topic answer small series case organized into the interview document, the document has the answer in detail, as well as some other big factory interview questions.
How do I get organized Java interview materials?
Information acquisition method:
After attention + forwarding,Click here to get the document collection method
Answers to the interview