doc
Last updated
Last updated
1. String to Integer
2. Lc20, lc 27
3. 找到全部最长的连续偶数或者奇数,输出list集合。
4. Max path sum
5. Design twitter
6. LRU Cache (lc 146)
7. Meeting room 1, meeting room 2
8. Lc 323, lc 735, lc 347
9. 一个string是不是全都是distinct char
10. 给一个 list of list, 返回长度最长的list的第一个元素
11. Hashmap是怎么实现的, 数据太多内存放不下怎么办
12. 如何实现heap
13. 设计一个迷宫游戏
14. 设计类似Linux的find命令,支持flexible的参数传入(getopts实现)
https://www.mkyong.com/java/search-directories-recursively-for-file-in-java/
15. Count prime
16. Java factory design, create interface, inheritance, override, overload, ood. Such as search file based on file name.
17. Java gc collections, abstract class, interface,
18. OOD设计思路
19. Parking lot, 用到哪种数据结构,如何实现OOD
20. Lucene internals, elasticsearch internals, inverted indexes
21. Autocomplete system design
22. tinyURL
Some general questions:
Why Amazon?
Because I know Amazon is a top internet retailing company with a strong focus on customer experience. And there are a lot of talented people in amazon creating amazing products to make people’s life easier. They are always showing strong ownership to their projects and they always want to make things perfect. Those spirits do touch my heart. I remember when I just started to lead smart log analyzer project, everything is new to me. And I’m so passionate about creating great services for customers to save their precious time and money. They could have people hired to sit there watching the visuals we provide, and trying to do treat hunting, to see if there are malicious events among them. But we want it to be more convenient. We want our system to take care of all the stuff automatically. It will detect the malicious stuff, evaluate them, report them and provide suggestions and solve them automatically. The customer only needs to do clicks on the website to make simple decisions based on the suggestions system provide and they can focus more on their own things. That is really similar with Quilt. Quilt also does a great job to help customers focus on their codes. It will take care of patching automatically for hosts. That’s really amazing for customer. So, we have similar spirits. That’s one big reason why I want to join Amazon.
Secondly, the growth of amazon is so impressive, it is not only an online retail shop, it also has a wide range of products like Alexa, kindle, fire tablet and TV, Amazon web service, etc. There are so many fantastic technologies and products here. I will never feel boring if I am in amazon. And I’ll be excited about all the amazing things around me everyday. I can learn a lot of new technologies here. Beside that, I can also learn to work with solutions with full-stack point of view, by engaging requirements, front-end, back-end, storage and all the other stuff. I can understand the problems and solutions thoroughly.
Why you choose this position?
The job I applied is Software development engineer in Amazon web service quilt team. The reason why I choose this job is I have the similar experience. I remember when I just started to lead smart log analyzer project, everything is new to me. And I’m so passionate about creating great services for customers to save their precious time and money. They could have people hired to sit there watching the visuals we provide, and trying to do treat hunting, to see if there are malicious events among them. But we want it to be more convenient. We want our system to take care of all the stuff automatically. It will detect the malicious stuff, evaluate them, report them and provide suggestions and solve them automatically. The customer only needs to do clicks on the website to make simple decisions based on the suggestions system provide and they can focus more on their own things. That is really similar with Quilt. Quilt also does a great job to help customers focus on their codes. It will take care of patching automatically for hosts. That’s really amazing for customer. So, we have similar spirits. That’s one big reason why I want to join Amazon.
Another big reason is amazon. the growth of amazon is so impressive, it is not only an online retail shop, it also has a wide range of products like Alexa, kindle, fire tablet and TV, Amazon web service, etc. There are so many fantastic technologies and products here. I will never feel boring if I am in amazon. And I’ll be excited about all the amazing things around me everyday. I can learn a lot of new technologies here. Beside that, I can also learn to work with solutions with full-stack point of view, by engaging requirements, front-end, back-end, storage and all the other stuff. I can understand the problems and solutions thoroughly.
The biggest mistake you made and what did you learn from it? (earn trust, customer obsession)
Case 1: The biggest mistake I’ve made happened when I led the smartloganalyzer project for the first time. The original schedule is week, but I suddenly received a message from my manager says that he will show a smartloganalyzer demo to one customer after two days. And at that time I was working on building the alerting system, that will be an important part of the demo. But I paid too much attention on details, I want to make everything perfect. I didn’t notice that I don’t have enough time to finish all the details. Last day before the demo day, my manager pointed that out. I apologized to him and then we started to figure out if there is a way to keep the demo the same as what we want it to be, but sacrificing some backend performance that customer won’t notice, cause it is just a demo. After the demo, I can rewrite the code to meet my requirements. Fortunately, the demonstration was not affected in the end. But from this mistake, I learnt that details are definitely important, but I also need to pay attention to the whole schedule, I need to always keep good communication with my teammates when I have my plan. I need to make sure that my schedule won’t affect other’s schedule.
Case 2: I remember that after we first delivered the 5.1 version of SLA to customer, which is the version that first with machine learning feature and alerting feature. But the customer reported that they can not see the alerts. It is very weird cause after all the checks, all the features are running smoothly in the dev machine, but when it comes to the sensor, the alerting part will fail. After tracking the logs and error message, I found that the alerting system was not able to start at the very beginning. It seems that it doesn’t have the proper environment to run. Then I noticed that all the python related stuff in the system are based on python 3, except elastalert, which is based on python 2. So I double checked the document, I didn’t document the detail in the documentation. So the sensor doesn’t have python 2 environment. It is definitely a silly mistake. I apologized to my manager and the customer. And we added the python 2 envrionment to a new sensor as soon as possible and sent it to customer again. So, after that, I learnt that I should pay attention to each small detail during the development process, and document them in time so that we won’t forget. I need to make sure that all the things I delivered are fully qualified.
Most challenging project
The most challenging project is my current smartloganaylzer project. It is challenging because I need to implement all the new features on my own. It requires me to build machine learning tools for network threat hunting, I haven’t done anything related to threat hunting before. And It also requires me to build RESTful APIs for the tools. I haven’t developed any RESTful API before either. It also requires me to build alerting system and But the time is not unlimited, so I started to devote more time on the project, even my private time. I googled a lot of papers related to threat hunting, like malicious url, dnstuneling, network behavior. When I came up with some ideas, I would discuss with my manager to make sure the plan is feasible. And then I learnt Go as quick as possible so that I can design and implement all the RESTful APIs on time. Finally, all the new features have been implemented on time and we received positive feedbacks from the customer. So through this process, I learnt that it is so important to be curious and keep learning, the more you read and learn, the more problems you can solve. The feeling of ownership is really really important, the product is just like your own child. So “I don’t know how to do it” will never be the excuse.
Couldn’t finish tasks before deadline
I remember last time I was building the alerting system, my original schedule is one week, but my manager suddenly sent me an email said that he needs to show a demo to a customer two days later. One core feature of the demo is the alerting system. So I was asked to realize the function before two days deadline. If I still follow the original schedule, I definitely can not finish that. My original schedule is to let the alerting system generate rules automatically based on dynamic data. But I can not finish that in such a short time. So I figured out another temporary solution with my manager, is to make it a fake automation temporarily, to preset all the parameters and processes. If you run it, it will behave like generating rules automatically, so for the demo, the customer will have exactly the same experience. And I can also finish that before deadline. After that, I can make it real automation.
If I couldn’t finish tasks before deadline, I will discuss with my colleagues, trying to figure out a way that can improve the efficiency and If necessary, I will use my private time to keep working on the task. After all, finishing the task with high quality as soon as possible is what we want. I’ll never sacrifice the customer experience or the quality of the product because of that. Customer experience is always the most important. We must make sure that the product we are gonna deliver is qualified. We can sacrifice our own time to try to finish the tasks. If we still can not finish the tasks, we will communicate with customers and related people, to tell them why and earn their trust. At the same time, we will try our best to finish the tasks as soon as possible.
1. Customer Obsession
Leaders start with the customer and work backward. They work vigorously to earn and keep customer trust. Although leaders pay attention to competitors, they obsess over customers.
Case 1: When I led the smartloganalyzer project at the first time, it is very challenging to me. Cause I have no idea how to build the threat hunting structure. In order to understand it better, I googled a lot of papers and learnt a lot of basic concepts about network threat hunting. Based on that, I started to work with customers to figure out what kind of problems that customers concerned the most. Cause most customers who are using our products are not professional network developer. We need to use their language to tell them the story. They just need to know if they are under specific threats, they don’t care about how we find the threats. All they need to do is just make easy decisions based on the suggestions we provide. The system will take care of all the other stuff. Like if there are brute force password attacking, the system will bubble up an alert and send an email to customer to let them know, and also providing them the links to the detailed dashboards. They can choose the suggestions provided by system, like putting the ip into the banlist.
So, finally, after the delivery, we get positive feedbacks from customers. We are always trying our best to listen to our customers and provide the best experience for them.
• Who was your most difficult customer?
• Give me an example of a time when you did not meet a client’s expectation. What happened, and how did you attempt to rectify the situation?
• When you’re working with a large number of customers, it’s tricky to deliver excellent service to them all. How do you go about prioritizing your customers’ needs?
• Tell the story of the last time you had to apologize to someone.
2. Ownership
Leaders are owners. They think long term and don’t sacrifice long-term value for short-term results. They act on behalf of the entire company, beyond just their own team. They never say “that’s not my job.
Case 1: When I worked on the SLA project, I was required to deploy elastalert and create few rules for the alerting system. Our alerting system is based on various elasticsearch indexes, and the situations and requirements for each index are definitely different. Since I was the person who was leading SLA project, I want my customers to always have the best experience. So I started to think about automate the generation. After the agreement from my manager, I categorized the current rules and the future rules based on different scenarios and requirements. Then I wrote a bunch of shell scripts to do the automation. I also created the APIs for those alerts, so if the customer doesn’t want the rule to be enabled, he can just click on website to turn it off. After delivery, we had strong positive feedbacks from customer.
• Tell me about a time when you had to leave a task unfinished.
• Tell me about a time when you had to work on a project with unclear responsibilities.
3. Invent and Simplify
Leaders expect and require innovation and invention from their teams and always find ways to simplify. They are externally aware, look for new ideas from everywhere, and are not limited by “not invented here”. As we do new things, we accept that we may be misunderstood for long periods of time.
Case 1: When I worked at CCG, we have a ticketing system to record the development process, keep tracking all the tasks, bugs. But you know the ticketing system is a little bit crowded. It only shows a long list of tickets. With the first glance, you can hardly know current process of development. So to simplify it, I used a vis timeline to show all the tickets. Then we can see the whole process clearly through the timeline. With the timeline, we can schedule the tasks more easily. Everyone is happy with that.
• Tell me about a time when you gave a simple solution to a complex problem.
• Tell me about a time when you invented something.
4. Are Right, A Lot
Leaders are right a lot. They have strong judgment and good instincts. They seek diverse perspectives and work to disconfirm their beliefs.
Case 1: When I was building the alerting system through elastalert, I was asked to create rules for monitoring all the processes in the system. I have my initial plan to track the unique value of process names based on different sensors. But I don’t quite understand the behavior of system index, so I discussed with my manage, and he disagreed with plan. Actually we want to see the alert when the system is down, or nearly down. What we really care about is the count of processes. We want to alert when there is a significant drop in process numbers. So, after that I changed my design and everyone is happy.
• Tell me about a time when you were wrong.
• Tell me about a time when you had to work with incomplete data or information.
5. Learn and Be Curious
Leaders are never done learning and always seek to improve themselves. They are curious about new possibilities and act to explore them.
Case 1:
• Tell me about a time when you influenced a change by only asking questions.
• Tell me about a time when you solved a problem through just superior knowledge or observation.
My manager asked me if there’s a way to export and import kibana dashboards, visuals more easily. Cause through the GUI side, it has the number limit and it is hard to manipulate from back end. So I came up with an idea we can utilize the REST apis kibana and elasticsearch provide. We can write scripts to automate the loading process according to our own needs. I know that’s feasible. So finally I wrote the scripts and all the stuff in kibana can be exported and imported automatically in back end.
6. Hire and Develop The Best
Leaders raise the performance bar with every hire and promotion. They recognize exceptional talent and will move them throughout the organization. Leaders develop leaders and take seriously their role in coaching others. We work on behalf of our people to invent mechanisms for development like Career Choice.
Case 1: Few months ago, there was an intern assigned to my project. He was helping me build the alerting system. But I found that he gets lost about what we are doing and what he is going to do. So, I told him that it is not as complex as what he is thinking about. I explained the alerting concepts to him one by one and categorized the things what we are doing and what we are going to do. After he is getting comfortable of the whole environment and what I need him to do, I started to assign him the specific task. And he is doing pretty well. So when someone comes to a new environment, getting lost is quite normal. We need to have patience to make him get comfortable of the while environment. Otherwise the efficiency will be very low. And that will also help him get used to the working environment quickly and increase his enthusiasm and devote more to the work.
• Tell me about a time when you mentored someone.
7. Insist on the Highest Standards
Leaders have relentlessly high standards – many people may think these standards are unreasonably high. Leaders are continually raising the bar and driving their teams to deliver high-quality products, services, and processes. Leaders ensure that defects do not get sent down the line and that problems are fixed so they stay fixed.
Case 1: When I was building the alerting system, one of the important features is to generate alerting rules automatically. But I found that if the indexes are in a large scale, or we meet some edge cases, the efficiency of the process will be very low. Cause we are generating a lot of duplicate rules. So I built the cache to story the previous status, if there are new alerts happening or new indexes, then the system will create corresponding new rules for them. Otherwise it will only update them or do nothing. Also if there are old rules that we do not need anymore, we will remove them. And I also created links for those rules, so that we can save some disk space. It turned out that the efficiency was improved a lot.
• Tell me about a time when you couldn’t meet your own expectations on a project.
• Tell me about a time when a team member didn’t meet your expectations on a project.
8. Think Big
Thinking small is a self-fulfilling prophecy. Leaders create and communicate a bold direction that inspires results. They think differently and look around corners for ways to serve customers.
• Tell me about your proudest professional achievement.
My proudest professional achievement is the SLA project I owned. I tried my best to make it look perfect and make my customers have best experience. I build the machine learning tools for network threat hunting, each network anomaly and malicious event will be reported to the system. And I also created the alerting system, so that we don’t need people to sit there monitoring the boring data and create rules by hands. The alerting system will do all the stuff automatically. Customers love that, cause it really saves them a lot of time and money.
• Tell me about a time when you went way beyond the scope of the project and delivered.
When the first version of SLA that with machine learning feature was delivered, I was starting to think about moving the machine learning platform to tensorflow. Cause one of our core features is to analyze the behavior of network. But each network has its own environment and their behaviors are definitely different, so we need to build specific judging rules and awarding rules to let it train itself. So that it can always have good performance regarding to each environment. And I’m still working on that.
9. Bias for Action
Speed matters in business. Many decisions and actions are reversible and do not need extensive study. We value calculated risk taking.
• Describe a time when you saw some problem and took the initiative to correct it rather than waiting for someone else to do it.
• Tell me about a time when you took a calculated risk.
• Tell me about a time you needed to get information from someone who wasn’t very responsive. What did you do?
10. Frugality
Accomplish more with less. Constraints breed resourcefulness, self-sufficiency, and invention. There are no extra points for growing headcount, budget size or fixed expense.
• Tell me about a time when you had to work with limited time or resources.
11. Earn Trust
Leaders listen attentively, speak candidly, and treat others respectfully. They are vocally self-critical, even when doing so is awkward or embarrassing. Leaders do not believe their or their team’s body odor smells of perfume. They benchmark themselves and their teams against the best.
• What would you do if you found out that your closest friend at work was stealing?
• Tell me about a time when you had to tell someone a harsh truth.
12. Dive Deep
Leaders operate at all levels, stay connected to the details, audit frequently, and are skeptical when metrics and anecdote differ. No task is beneath them.
• Give me two examples of when you did more than what was required in any job experience.
Create elastalert rules, not only the rules, but also automate them.
Create a vis timeline to visual the tickets.
13. Have Backbone; Disagree and Commit
Leaders are obligated to respectfully challenge decisions when they disagree, even when doing so is uncomfortable or exhausting. Leaders have conviction and are tenacious. They do not compromise for the sake of social cohesion. Once a decision is determined, they commit wholly.
• Tell me about a time when you did not accept the status quo.
• Tell me about an unpopular decision of yours.
• Tell me about a time when you had to step up and disagree with a team members approach.
• If your direct manager was instructing you to do something you disagreed with, how would you handle it?
14. Deliver Results
Leaders focus on the key inputs for their business and deliver them with the right quality and in a timely fashion. Despite setbacks, they rise to the occasion and never settle.
• By providing an example, tell me when you have had to handle a variety of assignments. Describe the results.
• What is the most difficult situation you have ever faced in your life? How did you handle it?
• Give me an example of a time when you were 75% of the way through a project, and you had to pivot strategy–how were you able to make that into a success story?