Recently, a friend went to Ali for an interview, but failed in the interview. He shared an algorithm interview question that he was not good at. So they’re going to look like this.

Title: Given a binary search tree (BST), find the KTH smallest node in the tree.

Author: Alibaba expert: Wen Jing/Ali Cloud CDN senior technical expert

Reference answer:

  • KaoChaDian
  1. Understanding and coding of basic data structures
  2. Use recursive

40 Tricks to Change your programming skills

1.Break up chunks of code into smaller functions

2,Never put off till tomorrow what you can do today. If you don’t put off till tomorrow what you can do today.

If the problem hasn’t been solved by the end of the day, all you need to do is turn off the computer and leave it for tomorrow. Stop thinking about the problem halfway through!

3,The principle of YAGNI

“You aren’t gonna need it!” The features you think are useful are not. Do not deploy anything other than the core functionality required. The core idea of this principle is to get the software up and running as quickly and easily as possible.

4,It is not necessary to know everything, but the foundation must be solid

Learn the basics, SOLID principles, how to write clean code, etc.

5,KISS principle

“Keep it simple, stupid.” or “Keep it stupid simple.” A programming principle. Most systems tend to be the “simplest”, the most efficient, but not the easiest to operate.

6,Don’t think too much

7,When stuck with a problem /Bug, Walk away!

But remember to come back.

While you’re walking to work, to the bathroom, or for a walk, you might be able to come up with a solution. This is especially true when you’re angry with clients, co-workers, or even your job.

Eight,Learn to write test code TDD

TDD is a software development process that relies on repeating a very short development cycle: write a test, run all the tests, see if new tests fail, write some code, run the tests, refactor the code, repeat.

9,Break down the problem before you start writing code

Don’t start coding without knowing what to do.

10,Don’t memorize code

Understand the logic.

11,Use Stack Overflow well

If you copy and paste a Stack Overflow solution, make sure you understand it.

12,Don’t “optics fail”

If you want to learn something, practice. Optics are not enough.

13,Review your code with a friend

Study other people’s code, and have them study yours frequently. Help each other and make progress together.

14,Don ‘t Reinvent The Wheel

“Don’t reinvent the wheel.” Make full use of existing experience and achievements to avoid unnecessary investment and waste.

15,Your code is the best documentation

16,Know how to search

You need experience and a lot of reading to know what to look for.

17,Write code with maintenance in mind

Your code will need to be maintained by you or someone else in the future. So write code with the reader in mind, not trying to be the smartest person, and make it read like a story.

18,Copy and paste

The best way to solve errors with Google and Baidu is to “copy and paste”.

19,Don’t give up

In the end, one way or another, the problem will be solved.

20,Rest, rest, rest

The best way to solve problems is to have a stable mind.

21,Learn software design patterns

Design patterns are solutions to common problems in software design. Each pattern is like a blueprint that you can customize to solve common design problems in your code. (Don’t reinvent the wheel.)

22,Using integration tools

Automate as much as possible.

23,Do code katas.

“Code Kata” is an exercise in programming that helps programmers improve their skills through practice and repetition.

24,Dependency injection is a requirement

Programming to an interface, not implementation. Dependency injection means that the dependency relationship between components is determined by the container during the running time of the application system, that is, the container dynamically injects the target object instance of a dependency relationship into each associated component in the application system.

25,Refactor – test – Refactor

Refactoring is the technique of reorganizing existing code to change and improve its internal structure without changing its external behavior.

26,Ask for Help in time

Don’t waste time.

27,Practice makes perfect.

Practice makes perfect.

28,Don’t pay too much attention to reviews

While reviews can sometimes help, don’t take them too seriously. They may be out of date.

29,Know your development environment

Know your development environment and invest in a robust one, such as IntelliJ.

30,Reusable components

31,Consider relevant constraints

Consider mobile first and associated power and bandwidth constraints when developing network applications.

32,Don’t optimize or refactor too early

It’s more important to have a minimum viable product as soon as possible.

33,Don’t cut corners

Don’t take inefficient shortcuts just to save a few minutes. “Every time you code, give your best!”

34,Follow prescribed standards

35,Users are not technicians

Keep this in mind as you develop your UI.

36,Stick to Github or Bitbucket

Small, frequent Git commits are possible.

37,Record all key parts

System logging is better than debugging code.

38,Be consistent in style

If you use one style, always use the same style. If you work with more people, use the same style for all teams.

39,Don ‘t stop learning

But rather than learning a new language or framework, focus on learning the basics of software development.

40,patience and love

Finally, be patient and passionate about what you’re doing.

The last

Below is the study route that arranges hard for everybody, have need okGet it for free here