How difficult is the 2023 interview? Why do big factories pay attention to algorithms? How should we respond?

At the beginning of the article, let's take a look at a byte algorithm question to see if it can be done:

  • Given the head node head of a singly linked list, implement a function to adjust the singly linked list, so that every K nodes are reversed in a group, and start from the tail of the linked list, and the number of remaining nodes at the head is not enough for a group. Reverse order is required. (Cannot use queue or stack as auxiliary)

Do you all feel dumbfounded? ( I won't either )

There used to be a saying that program = data structure + algorithm. This is highly respected in the era of procedural-oriented programming languages.

However, with the development of the times, the emergence of various programming languages, the invention of various programming models, and the concept of object-oriented, design patterns, frameworks, models, etc., the statement is no longer highly respected.

But I think it is necessary to learn data structure and algorithm well, because first of all, aside from the question that must be asked in the interview, from the perspective of programming, data structure and algorithm are almost the simplest basic knowledge. The only way for programmers, whether you want to learn C or JAVA, whether you want to learn process-oriented or object-oriented, whether you want to be an architect or a DBA (a person without a good algorithm foundation) DBA is almost half disabled).

Second, in programming practice, data structures and algorithms can be seen everywhere and have a great impact.

Some people say that data structures and algorithms are not used in work, which is a misunderstanding. It does not mean that you are required to implement a linked list to use a linked list. It is to apply it in programming practice, not to reinvent the wheel and reinvent it again (of course, there are also a few people who continue their studies in the field of algorithms and make new contributions, so I won’t talk about it here). Next, I will show you a data structure and algorithm document, which collects classic programming interview questions from well-known IT companies and gives ideas for solving them, which can provide useful guidance for fresh graduate interviews and software developer interviews.

Not much nonsense, let’s take a look at the catalog first

Catalog overview

first part

  • Chapter 1 Introduction

  • Chapter 2 Recursion and Backtracking

Mainly describe the abstract data types, give the basic concept of the algorithm and the complexity analysis and evaluation methods, and discuss the recursion and backtracking techniques that are almost used.

the second part

  • Chapter 3 Linked Lists

  • Chapter 4 The Stack

  • Chapter 5 Queues

  • Chapter 6 Trees

  • Chapter 7 Priority Queues and Heaps

  • Chapter 8 Union Check ADT

  • Chapter 9 Graph Algorithms

It mainly introduces basic data structures, including linked list, stack, queue, tree, priority queue, heap, union search and graph, and uses multiple examples for each data structure to demonstrate in detail.

the third part

  • Chapter 10 Sorting

  • Chapter 11 Finding

  • Chapter 12 Selection Algorithm (Median)

  • Chapter 13 Symbol Table

  • Chapter 14

  • Chapter 15 String Algorithms

It mainly introduces the technology of data processing, including sorting, searching, selecting, symbol table, hashing and string algorithm.

fourth part

  • Chapter 16 Algorithm Design Techniques

  • Chapter 17 Greedy Algorithms

  • Chapter 18 Divide and Conquer Algorithms

  • Chapter 19 Dynamic Programming Algorithms

  • Chapter 20 Types of Complexity

  • Chapter 21 Miscellaneous Talk

Mainly introduce some commonly used algorithm design techniques and applications, including greedy algorithm, divide and conquer algorithm, dynamic programming algorithm, complexity type, and discuss some useful topics for interviews and exams.

Let's take a look at the 50 real algorithm interview questions, check for omissions and fill in vacancies .

  • 1 Index calculation problem

  • 2. Specify the prime numbers contained in the range

  • 3. Number of daffodils

  • 4. Decompose the prime factor

  • 5. Use of conditional operators

  • 6. Common divisors and common multiples

  • 7. Count the number of types in the string

  • 8. Find the value of s=ataataaataaaata...a

  • 9. The complete number of the specified range

  • 10. Inverse index calculation

  • 11. Combination

  • 12. Gradient calculation

  • 13. Find the unknown

  • 14. Date calculation

  • 15. Sort

  • 16. Bubble sort

  • 17. Reverse calculation

  • 18. Array calculation

  • 19. Print out the following pattern (diamond)

  • 20. Sequence summation

  • 21. Find the combination of 1 +2!+3+...+20!

  • 22. Use the recursive method to find 5!

  • 23. Recursive calculation

  • 24. Print in reverse order

  • 25. Palindrome number

  • 26. Match words

  • 27. Find prime numbers within 100

  • 28. Sort 10 numbers

  • 29. Find the sum of the diagonal elements of a 3*3 matrix

  • 30. Compare and sort

  • 31 Output an array in reverse order

  • 32 Take an integer a from the right end of the 4-7 bits

  • 33. Print out the Yang Hui triangle (it is required to print out 10 lines as shown in the figure below)

  • 34 Input 3 numbers ab, c, output in order of size

  • 35. Selection Sort

  • 36. Swap places

  • 37. Sorting Problems

  • 38. Calculate the total length of the string

  • 39. Summation

  • 40. String sorting

  • 41. Recursion

  • 42.80977=8007?+9*77+1

  • 43. Find the odd numbers that can be formed from 0-7

  • 44. An even number can always be expressed as the sum of two prime numbers

  • 45. Determine how many prime numbers are divisible by how many 9s

  • 46. ​​Two string concatenation programs

  • 47. Print exercise

  • 48 encryption algorithms

  • 49. Count the number of times a substring occurs in a string

  • 50. Find the average

Guess you like

Origin blog.csdn.net/SharingOfficer/article/details/130133559