Lee215, The Algorithm Journey of A Programming Artist

© 2021 Overseas Rabbit. All rights reserved.

Hey everyone, I’m Lee215, an ordinary hobbyist of algorithm. I hope to bring pleasure and surprise to you through my code and I would like to thank Windson for this interview. Welcome all of you to follow my YouTube and Bilibili or know more on my Wechat Official Account “Lee215的Code”. I will update occasionally.

Interview

“Hello, Lee215, you are the user with the most reputation score on Leetcode now. People are curious about your computer competition experience, so when did you start to take part in such competitions?”

I took part in the math competition in my middle and high schools but I never took part in any computer competition in college. When I graduated from college, I even never heard of ACM ( Association for Computing Machinery). In 2018, I started to participate in the competition on Leetcode regularly and shared my solutions. Later on, I knew more about the other competitions like Google Kickstart, CF, etc. Different from the others, I competed on Leetcode, which was still a small platform at that time, not for an interview. It’s more like a platform for riddling or working on math problems for me.

“Did you still remember how many problems you solved the first time in the competition on Leetcode? How many times after participation will you be able to complete four problems?”

I finished two or three problems for the first time, not quite sure. After two or three times, I feel I could finish four questions. But I was not familiar with the programming languages at that time so I don’t have enough time. At that time, not so many people participated in the competition and the questions might be easier.

“Why did you spend some much time writing question analysis after the competition? Which one are you most satisfied with in hundreds of your analysis?”

I once wrote a sentence on my Wechat official account that I considered myself an ordinary hobbyist who tried to be an entertainment host online and an artist. It might be boastful to regard myself as an artist, but algorithm and art do share something in common. I didn’t write the analysis just to show you how great my algorithm is, but to share some of my ideas, just like sharing a good TV drama, nothing but via algorithm.

I have three favorite posts, the first post is 1130. Minimum Cost Tree From Leaf Values. Alex was responsible for all the solution on Leetcode and he applied the DP solution of O(N^3) for this question. But I found an O(N^2) solution and an O(N) solution based on stack. I got good feedback as I had given a very specific and detailed solving process. The second one is 877. Stone Game. Someone asked me about it at that time and then I think this question is very interesting so I share this question on Leetcode. Although the solution is easy, it is not a very stereotypical question. It required some deliberation. The last one is 1190. Reverse Substrings Between Each Pair of Parentheses. Almost everyone’s solution is O(N^2), but actually the O(N) solution is easier to understand which requires a bit of imagination. Particularly, after watching Noman’s new movie “Tenet”, I recalled this question again and I highly recommend you to see this movie and get inspiration.

“So for, how many algorithm questions have you solved? What do you learn most from that?”

Over 1000. But I don’t think the number matters. As a matter of fact, my ability grew fastest when solving the first 200 questions. However, solving the next 800 questions didn’t help me improve or grow a lot. I even felt myself not as quick-minded as before as my mind was trapped by all these existing and fixed solutions which I had known them well before. The biggest lesson I learned on Leetcode is not the improvement of algorithm analysis, but the familiarity with coding. As long as you’re familiar enough with coding, you will have more time to solve the questions instead of wasting extra time on programming language details.

“What kind of questions do you find the most challenging?”

There’re two kinds I consider the most challenging. One is the Graph theory question because it’s not so direct to figure out its solution and there’re lots of existing theorem for it. If you never learn it before, it will be difficult. The other is the NP problem. especially the one that needs to use search. In fact, these two types of questions share one thing in common: brute force search. The most challenging question is the one without testcases. Although we can optimize them by pruning, we still need to try all the possible solutions and I don’t think I can solve them well.

“When I first practice at Leetcode, @StefanPochmann was far ahead of the other users and ranked the first. I’ve never thought someone will surpass him but now you did that. What special things did you do?”

First, also the most important one, persistence. I have kept participating in the competitions for a long time and giving solutions quickly after that. Now many participants can give their solutions after the competitions too, but maybe they’re not as persistent enough as me. Second, I require a high standard for my solution. First of all, I will make sure it’s 100% correct. If I find any mistake, I will revise it in time. And then, I read all my comments and keep updating my solution. The comments I receive every day is much more than the likes. Last but not least, I will give solutions in several languages, like Java,C++,Python. I also want to say thank you to people who support me.

“Does as the number one user on LeetCode helps your career? What has been the most challenging project you have worked on yourself at work?”

I suppose not. I never talk about this to my colleagues and they know little about that. We can choose our hobbies but we don’t have so much chance to choose our work. We need to make things done one by one. Different from others’ expectations, I don’t have a chance to participate in the launch of a rocket or a self-driving car’s manufacture. As a programmer, I only spend about 20% of my time in programming and 80% on other things.

“Next question is also the one people want to know most. If you write down your Leetcode’s ID @Lee215 on your resume, will the interviewers be more nervous than you?”


(Laughing) I never mention my Leetcode’s ID so they probably don’t know.

“When you interview others, how do you judge the competence of the candidate? If you know that he/she is good at the competition, will you treat him/her in a special way?”

I will focus more on his/her thinking process because I will not give a very difficult question to embarrass the interviewee. If the interviewee can’t solve the question, I will give some hints, and then I will hope you can figure out the solution step by step with my hints. At least you should let me know that you are well-prepared for the questions. On the contrary, you may have no preparation or you have never heard of this algorithm, but you have the ability to explore further with my hints. I am not professional in computer competition, yet my company doesn’t think much higher of the competitors. Interviewers also seldom want to stump the candidates just because you are a competitor. Most of the interviewers will give you a normal question and hope you can solve it skillfully and communicate with them clearly.

“Do you think it’s useful to use algorithm to interview? Do you have any comments and suggestions?”

It is good. After all, it’s effective and easy to prepare. Although it’s believed that the inspecting threshold of big tech companies is generally relatively high, our company’s inspection is quite clear. Some companies will ask you lots of details instead of giving a specific question, which is hard to prepare both for graduate students and experienced programmers. Hence, algorithm is actually pretty easy to prepare. Some other companies, not necessarily tech companies, are only interested in your “first degree”, in other words, the level of your undergraduate university. They believe that is the most effective way for them to hire. Compared with such companies, solving algorithm questions in the interview is much humanistic, at least you have a chance to try.

“Some companies ask questions about particularly complex data structures or algorithms named with others during interviews, such as balanced binary search tree and Prim’s algorithm. How should we prepare for this kind of question? ”

Usually, I will use some good tools or skills to solve algorithm questions. I didn’t learn some special data structures either, but I think you need to know the fundamental of them. For example, when I was interviewed by phone with my current company, I met a segment-tree question, but the problem is good, you do not have to use segment-tree to get a suboptimal solution, I rewrote my solution after finished the suboptimal solution with segment-tree method, but I didn’t implement it, just imagine the API, and explain the principle. I think the interviewer will not check your code line by line. What matters is that you should be able to know the theory, explain it clearly and use it flexibly. That’s much more important than the code itself. As for the algorithms named with others, it might not impress you a lot for the first time, but later on, as it appears a few more times, you will notice it, learn actively and digest it finally. To be frank, if a specific algorithm named after people is used in the interview, it’s a pretty straightforward problem and it would not be an obstacle for you.

“Have you suffered any obstacles when solving algorithm questions? Like you have done one question a couple of times, but you still can’t figure it out after a while. How do you address such a situation?”

I did encounter some obstacles. Even until now, I knew I can’t solve some questions for the first sight and the others, I thought I can, but actually, it’s hard for me to figure out the right solution. In fact, the obstacles vary from person to person, most of which I believe are due to lack of practice. At least, you need to accumulate to a certain point that you can use code to fulfill the thought in your mind, and that’ great if you can do that. To get improvement, I think we can learn from others’ solutions and see how it’s achieved or you can just try hard on your own if you believe you are very close to the answer, even though it might take a longer time. Alex once said some dynamic programming questions on Leetcode are not that good, and I agree with that. We can overcome dynamic programming by accumulation, yet for some stack questions, it’s more difficult and we need to spare more effort.

“Because many companies will pick out questions from Leetcode, many programmers will practice on it just for the interview, which is quite different from you. How do you think about that?”

It’s like test-oriented education. For example, in high school, some students like sciences very much but they may not do well in the test while others can get a high score but they don’t have so much interest in it as they just want to pass the university entrance exam. This is quite normal and I would not judge them. However, many people ask me how to be good at algorithms but I can’t give them a good answer. Deep in my mind, I will question myself if I’m not good enough to give them a satisfactory answer. Someone thought I hid some secret skills, which are not true. Lots of people just want a shortcut from me but I don’t have one. I will only tell them two things: first, you don’t practice enough yet; second, maybe you don’t have so much interest in it. If you don’t have enough interest, you won’t do it well.

“Many interviewees still can’t perform well even if they have done so much exercise on Leetcode, what skills do you think they lack? On the contrary, some people only figure out 200 questions and then they are admitted by big companies, what do you think is the reason behind this? ”

Many people will say how many questions he did for the interview. But in fact, the whole process from 200 questions to 2000 questions, they may just repeat the same thing over and over again. Therefore, the number of questions you do does not reflect your level and ability. Everyone has his own way to solve the questions. Some people are good at math or clever, then he/she can learn from the questions and apply solutions to the others. This can help them deal with the interview and pay more attention to the other things. As other people may not learn so fast, they need to be more diligent and hard-working. The algorithm itself is not so difficult as imagined, and it is even simpler than the college entrance exam. You can do well in an algorithm as long as you spend enough time in it. On the other hand, admitted by big a company does not necessarily mean you are excellent in algorithm. I know that many people are not very good at it, but they are still admitted. Interviewing requires some luck but your previous efforts will surely make you have a greater chance for success. In fact, the algorithm ability follows you all the time. Once you have that ability, you can apply it to other places in the future, not only to solve algorithm questions but to work and in the next job-hopping, so it’s worth it.

“How do you think about the algorithm training class popping up in the market?”


Programmers spend money learning how to get an offer from big companies. I think that’s a good investment because programmers in North America can get a high salary monthly. For interviewees from this region, they can enjoy the same learning cost worldwide with their high salaries. For those people who open the algorithm class, they can make lots of money and I am envious of that.

“Do you plan to open your own training class? Have you been contacted by algorithm classes to record a course?”

I started doing algorithms for interests, not for money and had been giving free lectures in algorithms groups with other people by turn, but I’ve never recruited students or make fortune with my reputation in a big way. For training classes, if there is a particularly good opportunity, I think I will be willing to do it; a one-to-one teaching algorithm is also possible. I never contact the other training courses so few people ask me to record the course. We all teach algorithms; different teachers may emphasize on different aspects. It should have differences between my class and others, and students may also gain differently from the classes but actually, the difference is not so obvious. Maybe that’s due to my limited ability.

“Should we let more people know about Chinese projects or videos by subtitling videos in English if we want to help China speak louder in programming? Or maybe you think that’s not important, you just be willing to share your knowledge as I also notice you encourage other people to learn Chinese in your post.”

On my Youtube Channel, many people asked me to post English videos or videos with English subtitles because they believed the number of my followers would surge in that way. However, I didn’t mean to become popular or be a vlogger to make money at the beginning. It’s better to express my whole thinking process in Chinese as I can’t explain myself well enough in English. I feel more comfortable, more accurate in Chinese and we can have fun. But now I’m at home, I might not make videos, not to mention in the English version. That’s enough for me. If I need to subtitle my videos in English, I might quit.

“Currently, Chinese people developed and maintained a few open-source projects, of which the most famous one is Vue. How do we encourage young programmers to participate in these projects?”

Well, this problem is too big for me to solve but it should have something to do with competition. There’re many programmers in China, if people still can’t have satisfying salaries, it will be difficult to establish the community. Here we can learn from the Indians. I think a lot of Indian programmers, let’s not say their level, are willing to create a website or Blog for whatever they do. I sometimes feel like they don’t do it that well, but they love it. People often posted links to their YouTube videos at the bottom of my post where they recommended people to watch their videos if they still have questions. They are good at performing themselves; I think this is worth learning for Chinese.

“Can you recommend some resources for learning algorithms?”

I haven’t read many algorithm books so I can’t recommend a lot. But I can recommend many interesting math books, like One Two Three . . . Infinity from George Gamow. You can also read my posts if you have some algorithm knowledge.

“Who do you admire most? Like a celebrity or a scientist?”

Hard to say. Normally, I will say I like Yangmi (laughing), an outgoing Beijing actress.

“If you could pick any place in the world, where would you like to work?”

If I don’t take political identity and security into consideration, I would choose to work in the USA. Because there are more opportunities and projects in it, both the salary and the work-life balance are better, which are all very important. I am thinking carefully to work in Japan, Singapore or Europe. Life experience is also very important. Apart from personal development, it’s good to have a change of workplace once in a while. The world is so big that I would like to go anywhere if I don’t need to work.

If there is a second chance, do you consider any other career?

If I could choose again, I would not necessarily study computer. I originally wanted to study economic management in my undergraduate study, but later I learned computer by accident. I feel that mathematics and physics are to guide the whole objective world, and the economy will study some decisions and some laws of human society, which is quite interesting. But even if I do not learn computer science, I can still solve algorithm problems. In fact, I want to be a headteacher who teaches P.E. in high school so that I can substitute for a sick math teacher.

“Any other tips for your fans and our readers?”

Algorithm is only a part of the interview, if you like it, you can do it more. I also prefer to communicate with such like-minded friends. If you’re using algorithms as a stepping-stone, find the most efficient way to get the thing done, regardless of why someone else is doing it better than you. The advice for readers is not to go to graduate school. I went to graduate school, sort of a detour. There is not much difference between the salary of graduate and undergraduate students in the workplace and other aspects. It is better to go directly to the company you like after graduation from undergraduate school. Working for two years may bring you more benefits than studying for two years. It’s meaningful to go to graduate school in the USA or change careers through graduate school. These do not include here. No matter what choice you make, it’s not a detour, it’s just a long way, and you can see some scenery on it.


 Acknowledgments

I would like to express my gratitude to my friends in my algorithm journey. They influence me a lot and witness my growth from a green hand to an old hand. 


Thank you Yiyan. His classic voting question, just like a yummy dessert, satisfies our appetites. He enlightens me and lets me perfectly know what is algorithm. The only pity is that we could not meet earlier. 


Thank you Haowen. He helps me know LC’s weekly competition and you will get a time penalty by submitting debug. He also lets me know what is DFS and BFS. Even now, I still think DFS and DP are pretty much the same things. It’s hard to find a close friend in your life. Hope your Dota will achieve higher ranks with my help. 


Thank you Awice. He holds much blame for LC. People ask me what books I see for algorithm, your python always comes to my mind. I miss our days playing stone game together. I want to say more but you can’t read Chinese

Thank you Huifeng. You ditch our first Google HashCode so that I got the best score ever. There are a thousand Hamlets in a thousand people’s eyes, but you told me by your actions that we could gain what we want by being righteous and diligent. Once we came across a lot, now I reach a certain level but find no one waiting. 


Thank you cuiaoxiang. We attract and appreciate each other. You are like a walking algorithm dictionary which cites the reference for me, encouraging me to get improvement. Even if you are smart enough, you can still spare no efforts. That is more valuable than anything. May our friendship last forever like verdant mountains and running water. Not to say much for far wishes, I wish you won the top three in the autumn match.

There are plenty of like-minded people to who I don’t express my gratitude to. I look forward to seeing you in the future. Thank you.

updatedupdated2021-02-102021-02-10