background

Some time ago, something happened to my family, so I resigned and stayed at home for a while. After dealing with my hometown affairs, I returned to Guangzhou to continue to look for a job. About a few days before the National Day, I had an interview with a company named Bigo(YY’s subsidiary) for the position of Java development for 3-5 years, and finally I fell into the third round of technical field. Although some regret and frustration, but I still want to write a blog to record their interview process good, but also to the majority of programmers compatriots to share, I hope to your future learning and interview can help.

Personal circumstances

Let’s start with LZ’s personal details.

Graduated in 17 years, two books, currently located in Guangzhou, is a very ordinary Java development programmer, calculated to have more than two years of development experience.

In fact, this stage is a little awkward, a little better than the junior programmer, but not to the advanced degree. In addition, nowadays, the IT industry is nearly saturated, and many jobs require at least 3-5 years of development experience, so the demand for about two years of development experience is relatively small, which LZ deeply experienced in the process of job hunting. The most sad is that this year’s environment is not good, many companies continue to lay off staff, let alone recruit people, the cruel situation is worse for job seekers, I believe many job-seeking students also have experience. Therefore, less than the last resort, do not suggest naked resignation!

Bigo interview

Interview position: Java background development

Experience required: 3-5 years

Since I interviewed Bigo before The National Day, it has been more than a month now. Although I still have an impression, I also forgot a lot of interview questions, so I can only try to describe the interview process according to my own memories, please forgive me if I don’t understand!

One (wechat phone)

Bigo’s first interview was a wechat phone interview, originally intended to be a phone interview, but the interviewer said he needed to write algorithm questions, so he changed it to a wechat phone interview.

  • To introduce myself

  • Let’s take a look at Java basics. What are memory leaks and memory spills? (An overflow is when too many objects are created and there is not enough memory. A leak is when useless objects are not collected.)

  • How does the JVM determine that an object is useless? (Root search algorithm, starting from GC Root, the object is considered useless if there is no reference)

  • What objects can the root node be in a root search algorithm? (Class object, virtual stack object, constant reference object)

  • What’s the difference between overloading and overwriting? (Overloading occurs in the same class, with the same method name and different argument lists; Overrides are actions between parent and child classes, with the same method name and argument list, and different programs in the method body.

  • Are there any restrictions on rewriting?

  • What synchronization tools are available in Java? (synchronized and Lock)

  • Java concurrent programming: Synchronized, Lock, ReentrantLock, ReadWriteLock

  • What’s the difference between ArrayList and LinkedList? (ArrayList is based on an array, which is fast to search, but slow to add and delete elements. LinkedList is based on a LinkedList, which is fast to add and delete, and search is inefficient because it traverses elements.)

  • Which of these two sets takes up more memory? (Depending on the case, an ArrayList can waste a lot of memory if it is expanded and the array is not full, but in general LinkedList takes up a lot more memory because each element contains Pointers to the front and back nodes.)

  • Let’s talk about the underlying structure of HashMap (array + list, if the list becomes too long, it becomes a red-black tree)

  • HashMap is not thread safe, what is the problem with HashMap before 1.7?

  • Do you know ConcurrentHashMap? Talk about how it’s thread safe (with segment locking)

  • Which methods need to lock the entire collection? (When reading size)

  • It says in your resume that you know RPC, can you tell me the whole process of RPC? (The client initiates the request, sends it to the socket, and then the server processes the message, and how to serialize it.)

  • How does the server find the corresponding implementation class after obtaining the interface information to be invoked by the client? (Reflection + note, here is also not very understand)

  • How many algorithms does Dubbo use for load balancing? (Random, polling, minimum active requests, consistent hash)

  • What do you mean by the least active number algorithm? (The service provider has a counter that records the current number of simultaneous requests. A smaller value indicates a lower load on the server and the router will preferentially select the server.)

  • How does the server know which algorithm the client is going to call? (The socket passes the algorithmic policy to the server when passing the message.)

  • You used Redis for distributed locks, right? Did you write your own tool class? (No, we use Redission for distributed locking.)

  • How does the thread guarantee unlockable once it gets the key? (Add an expiration time to this key)

  • What if the expiration date is up but the business has not finished processing? (the forehead… Idempotency is guaranteed in business logic.

  • Is there a better way to ensure idempotency for each business if distributed locks are used by multiple businesses? (the forehead… Thinking under temporarily no clue, the interviewer said that first skip it. I later learned that Redission itself has a watchdog that monitors the thread and resets the expiration time if it detects a key being held.)

  • If you have a pen and paper over there, write an algorithm that simulates queue entry and queue exit with two stacks. (Because I had an impression of this question in my review before, I wrote it quickly. It took about five minutes, then I took a picture of it and sent it to the interviewer. After reading it, the interviewer said there was no problem and ended the interview.)

The first question is not difficult, the questions are partial basic and so on, although not perfect answer, but the process is relatively smooth. A few days later, Bigo’s HR invited me to their company for an on-site interview.

Second interview

After arriving at Bigo Company, an HR girl invited me to a conference room. After waiting for about half an hour, a middle-aged man came in and said very politely that HE was sorry to keep me waiting for so long, and introduced himself as the technical manager. Then we started our conversation.

  • As usual, he asked me to briefly introduce myself while he looked at my resume.

  • Tell me about the project you’re most familiar with. (I will start with an e-commerce project recently done by my previous company, from a simple project description to the main functions of the project and the functional modules I am mainly responsible for,…………..)

  • You are so familiar with the project, then draw your project structure diagram according to your understanding, and explain what part you are involved in. (This topic is quite troublesome, after all, I left the job for a long time at that time, and the structure of this project is also a little vague. Start from the front end, then through the Nginx gateway layer, and finally to the specific services, etc., and mark the service module that you participate in.)

  • Your project uses the Spring Cloud GateWay. Why use GateWay when you already have Nginx as a GateWay? (Nginx is for load balancing, as well as for client access gateWay, gateWay is access to the business layer gateWay, and also integrated fuse Hystrix)

  • What is the main function of fuse Hystrix? (Prevents service avalanche caused by service invocation failure, can degrade)

  • Your project uses Redis. How is your Redis deployed? (Er… Seems to be sentinel mode deployment.)

  • What is your understanding of the Sentinel model? (I don’t know much about Sentinel mode, but I’ve talked about Sentinel monitoring, the heartbeat mechanism like ping, and how to tell if a master is offline…)

  • So why did you use sentry mode? Why not deploy in a cluster? When he couldn’t get his point at first, he explained that sentinel itself was multi-instance deployed, referring to the deployment solution of Redis-Cluster. (the forehead… The environment of Redis is built with specialized operation and maintenance personnel deployed, which should be a priority of high availability………. I’m starting to panic, because I don’t know why)

  • Oh, so you don’t think clustering can be high availability? (not… No, I just think sentinel mode may be more secure to master/slave replication…….. I don’t know what I’m talking about)

  • Clustering also ensures high availability. Do you know how it ensures master-slave consistency? (Ok, here really don’t know, can only skip)

  • You must have wechat, if let you design wechat circle of friends, how would you design its attribute members? (well… You need a list of users, a list of friends, a list of friends, something like that.

  • Well, as you know, there are nearly 1 billion wechat users, so there must be a sub-database sub-table. If you are the one, how to design the sub-database sub-table? (This question is a relatively large point of investigation, but my answer is not very good, and the interviewer continued to fire questions during the process, which led to the topic for nearly 20 minutes, I will not elaborate here due to space limitation)

  • So that’s pretty much it. And finally, you write an algorithm, you take an unsorted array of integers, you design an algorithm that pairs the elements of the array, and then outputs the logarithm of the maximum absolute value difference and the minimum absolute value difference.

    (hear this question, my first idea is to use a HashMap to save, the key is the difference in the absolute value of two elements, the value is the number of pairs, if you have the same add 1, no assignment is 1, and then finally do sort of map, the output value of maximum and minimum values, after finish the interviewer said that while the result is right, but not efficiency, Because the traversal time is order n^2, and that reminds me to think about sorting. It is faster to sort the array, then do the absolute value difference between the first element and the second element, which is called num. Then loop through the first element and the following elements until the absolute value difference is not equal to the num position.

After the interview, the technical officer asked me if I had any questions for him. I asked about the responsibilities of the position and the technology stack used in the project, and then asked me to wait while he informed the technical officer on the third side. To be honest, 2 face gave me the feeling is the most comfortable, because the interviewer is very cordial, the interview process has been actively guide me, and give me a lot in terms of career planning advice, let me benefit a lot, although the interview time has an hour and a half, but not too long, the whole interview process chat very comfortable, but because time is long, I don’t remember many of the questions.

On three sides

Half an hour after the second interview, three surface technology the interviewer began to come in, from his forehead hair amount distribution can guess is Daniel, few people malicious words, didn’t let me to introduce myself, sat down directly open q, the whole process I answer is not good, and the interviewer’s question formulated some not too clear, often need to repeat and confirm with him.

  • Do you know the business? What are the isolation levels for a transaction?

  • Suppose there are two services A and B that operate the order and inventory table respectively. After saving the order, A fails to call B to reduce the inventory. At this time, A also needs to roll back. (The destocking method of service B does not throw exceptions. The caller, namely service A, throws exceptions.)

  • Read and write separation? (Er… Write into master library, read into slave library)

  • If a thread writes to and reads from the User table in a transaction scope, then it writes to and reads from the User table in a transaction scope. If a thread writes to and reads from the User table in a transaction scope, then it reads from the User table in a transaction scope. (After hearing this, I was confused and couldn’t answer the question for a while. Later, the interviewer said that it was necessary to ensure that all reads and writes in a transaction were in the same library.)

  • Your project uses RabbitMQ, what is the processing of the mq consumer side? (That is, after receiving the message, the consumer will first save the message to the database, and then periodically run the message from the database)

  • So your MQ is stored in the database, and the business logic reads the message from MQ and processes it? (yes)

  • So your information is unique? (Yes, unique constraint)

  • How do you guarantee that messages will be consumed? Or how do you make sure it’s stored in the database? (here I start to panic because I have only seen some of the logic of mq access, but have not participated in it myself, so I will answer with my knowledge of MQ, it should be the ack mechanism of RabbitMQ.)

  • Ok, please sort out the whole processing logic flow of your consumer side, and then tell me where your ACK is returned (my heart is cold at this point, I did not participate in the mq access part, bravely draw the flow according to my own understanding, but it is full of loopholes).

  • The way you draw it, if the database suddenly goes down, how do you confirm that your message has been received? (the forehead… It is ok to deposit messages when sending messages……… Answer the heart of ten million grass mud road across…….. Come on, we’re done.

  • What if the sending service is deployed on multiple servers? The database keeps reporting unique errors when you save messages? (Ok, you win… Finally just suppress out 1, you say is, this design is really bad…)

  • The main thread adds and deletes elements from the map at a high speed, and an asynchronous thread periodically deletes data from the map that the main thread hasn’t deleted in 5 seconds. What would you do?

    (I did not do well in this question. After some simple thinking, I said that I could add the timestamp mark to the map key, and delete the elements less than 5 seconds before the current timestamp when traversing. The interviewer was obviously not satisfied with this answer, saying that traversing would affect efficiency. If you have any ideas on this topic, you can say it in the comments section!

. There are other questions, but that’s all I remember and I’ll leave it at that.

After the last question, the interviewer said the interview process was over and told me to go back and wait for news. At this point, I know this is basically the end of the story. In retrospect, my performance of this round of interview is really very general, plus the long time, from 2:30 that day to more than 6 o ‘clock interview, mentally also showed fatigue. Sure enough, a few days later, HR informed me through wechat that I had failed the third round of technical interview and this interview ended in failure.

conclusion

The above is the general process of the interview. I have to say that the interview of the big factory is very technical. I have learned a lot in this process.

1. Foundation! Foundation! Foundation! Important things to say three times, no matter what stage of the programmer, the foundation is the most important. Every company’s interview will definitely involve the basic knowledge of the question, if you do not have a solid foundation, often the first interview may be eliminated.

2. Your resume needs to be properly packaged. To be honest, my resume must be packaged, which is also the important reason why I didn’t have enough years of working experience, but I was able to get an interview with Bigo. Therefore, it is necessary to package my resume properly. However, it is important to remember that I should not be divorced from reality, for example, I only have two years of experience, but I just write three years. Small companies can still get away with it, but big ones have a hard time because many companies do background checks before entering the company.

3. Be familiar with the technical points on your resume. This is fine, but be sure you are familiar with the technical points on your CV. For example, if you have written a simple RabbitMQ demo, don’t write “familiar” as many interviewers will ask you a lot of questions about a particular skill point.

4. Be familiar with the items on your resume. Generally we write resumes are the need to do certain procedures for their own projects packaging and beautification, a good project can add a lot of points to the resume. But must be very familiar with the project, unfamiliar modules had better not write up. My resume has an e-commerce project that uses RabbitMQ to process orders. Although I have a little understanding of the processing logic of that part of the order, I have not been personally involved in the in-depth understanding, so the interview was forced to the end of this part of the Bigo interviewer.

5. Improve your architectural thinking. For intermediate programmers, daily work is fundamental to add and delete, the function implementation is finished, can’t say this kind of thinking is not good, just want to to the next level, business time under the need to increase their own architectural thinking ability, for example, if let you take over a project, you can consider how to design the project, from the overall architecture, to the introduction of some components, To the design of specific business services, these are the design of a project must be considered, for improving our thinking is a good exercise, which is also an important part of the interview of senior programmers in many large factories.

6. Don’t quit naked. This also is my most guileless proposal, big environment is bad, and go and cherish, alas ~~~~

In general, this interview Bigo or harvest quite a lot, although a little regret, but there is no regret, after all, before the interview is also very fully prepared, some questions are not good that I still have a lot of technical blind spots, do not understand is not understand, and then blowing can not blow out. This reminds me that you are still young, so practice your internal skills well. After all, vegetables are original sin.