More than 500 algorithmic interview questions from Byte, Tencent, Baidu, Ali, Meituan

Insert picture description here

If you want to see more algorithm questions, you can scan the QR code above to follow my WeChat official account " Data Structure and Algorithms ". Up to now, I have updated more than 500 algorithm questions in the official account , some of which have been sorted into pdf documents. , As of now, there are more than 800 pages in total (and will continue to increase), you can reply to the keyword "pdf" in the official account to download.


Byte, Tencent, Baidu, Ali, Meituan algorithm questions, a total of more than 500, all have detailed analysis and answers, the list is as follows

1. Dynamic programming
493, dynamic programming to solve the house robbery III
492, dynamic programming and greedy algorithm to solve the best time to buy and sell stocks II
490, dynamic programming and two-pointer to solve the best time to buy and sell stocks
486, dynamic programming to solve the maximum sub-sequence and
477 , Dynamic programming solves the longest appointment time of a massage therapist
465. Recursive and dynamic programming solves the triangle minimum path sum
430, the sword refers to Offer- dynamic programming to find regular expression matching
423, dynamic programming and recursive solution minimum path sum
413, dynamic programming asks The longest ascending subsequence
411, dynamic programming and recursive search for different paths II
409, dynamic programming for different paths
407, dynamic programming and sliding window to solve the longest repetitive sub-array
395, dynamic programming to solve the wildcard matching problem
376, the edit distance of dynamic programming
370, the longest common substring and subsequence

2. Backtracking algorithm
498, backtracking algorithm solution movable type printing
491, backtracking algorithm solution splits the array into Fibonacci sequence
478, backtracking algorithm solution word search
451, backtracking and bit operation solution subset
450, what is backtracking algorithm, one You can read it, and you will discard
448 as soon as you write it . Combination of several solutions
446, backtracking algorithm to solve the gold miner problem
442, the sword refers to the offer-backtracking algorithm to solve the binary tree neutralization path
420, the sword refers to the offer-backtracking algorithm Solve the path
391 in the matrix , the backtracking algorithm to find the combination problem

3. Greedy algorithm
501, greedy algorithm for distributing biscuits
489, lemonade for change
4. DFS and BFS related algorithms
473, BFS solution word solitaire
470, DFS and BFS unmerging binary tree
455, DFS and BFS solutions are surrounded by area
453, DFS and BFS solve the sum of the numbers from root to leaf node
445, BFS and DFS solve the number of islands
422, sword finger Offer-use DFS and BFS to solve the robot's range of motion
417, BFS and DFS two methods to find the largest area of ​​the island

5. Double pointer correlation
497, double pointer verification palindrome
466. Use fast and slow pointers to convert ordered linked list into binary search tree
449, fast and slow pointers to solve circular linked list
447, double pointers to de-rotate linked list
398, double pointers to find no repeated characters The longest substring
397, the dual pointer seeks to catch the rain problem
396, the dual pointer seeks to hold the most water container

Six, binary tree related
488, Morris middle order and preorder traversal of binary tree
485, recursive and non-recursive ways to solve the same tree
483, the number of nodes in a complete binary tree
474, multiple solutions to flip the binary tree
471, binary search Insert operation in the tree
464. BFS and DFS solve all paths of the binary tree
458, fill the next right node pointer II
457 of each node, the nearest common ancestor
456 of the binary search tree , and solve the right view of the binary tree in two ways
444, the serialization and deserialization of binary tree
441, the sword refers to Offer-the post-order traversal sequence of the binary search tree
440, the sword refers to Offer-prints the binary tree from top to bottom II
439, the sword refers to Offer-prints the binary tree from top to bottom
435, the sword refers to the Offer-symmetric binary tree
434, the sword refers to the mirror image of the Offer-binary tree
433, the sword refers to the substructure of the Offer-tree
414, the sword refers to the Offer-rebuild the binary tree
403, the binary search tree
401 is verified, the binary search tree is deleted Node
400 in, the zigzag level traversal of the binary tree
399, the binary tree
388 is constructed from the pre-order and middle-order traversal sequences , the binary tree
387 is constructed by the pre-order traversal , the maximum path in the binary tree is
375, and the maximum value of
374 is found in each tree row . The minimum depth
of the binary tree is 372, the nearest common ancestor of the binary tree
367, the maximum depth of the binary tree

Seven, linked list related
463. Three ways to determine the palindrome linked list
462. Find the first common node of the two linked lists
461. Exchange the nodes in the linked list in pairs
460. Quick and slow pointers to dissolve the circular linked list II
459. Delete the reciprocal of the linked list 3 ways
432 for the Nth node , sword refers to Offer- 3 ways to reverse the linked list
431, sword refers to Offer- the kth node from the
bottom of the linked list 429, sword refers to Offer- deletes the node
410 of the linked list , sword refers to Offer- Print the linked list
386 from the end to the beginning , the next larger node
381 in the linked list, merge the two ordered linked lists (easy)

Eight, stack related
500, verification stack sequence
438, sword refers to Offer-stack push and pop sequence
437, sword refers to Offer-stack
416 containing min function , sword refers to Offer-implement queue with two stacks

Nine, other classic algorithms
426, what is recursion, through this article, let you thoroughly understand recursion
394, the classic eight queens problem and the N queen problem
389, the addition of two super large numbers
371, the knapsack problem series-basics Knapsack problem
366, Joseph ring
362, Hanoi Tower
356, frog jumping stairs related problems

Ten, bit operation is related to
499, the number III
495 where the bit operation solution appears only once, the number of different methods such as bit operation is
494, the number
476 where the bit operation solution only appears once , is sorted according to the number of 1 in the digital binary,
469, bit Calculate the smallest 2 to the power of
425, the sword refers to the number of 1 in Offer-binary
383, do not use "+", "-", "×", "÷" to achieve four arithmetic
361, alternate digit binary number
364 , The number series of bit 1 (one)
385, the number series of bit 1 (two)
402, the number series of bit 1 (three)
357, exchange the values ​​of two numbers

Eleven, common data structure
348, data structure-1, array
352, data structure-2, linked list
359, data structure-3, queue
363, data structure-4, stack
368, data structure-5, hash table
373, data Structure-6, tree
378, data structure-7, heap

Twelve, common sorting algorithm
101, sort-bubble sort
102, sort-selection sort
103, sort-insertion sort
104, sort-quick sort
105, sort-merge sort
106, sort-heap sort
107, sort-bucket sort
108 , Sort-Cardinality Sort
109, Sort-Hill Sort
110, Sort-Count Sort
111, Sort-Bitmap Sort
112, Sort-Other Sort

Thirteen, common search algorithms
201, search-sequential search
202, search-binary search
203, search-interpolation search
204, search-Fibonacci search
205, search-block search
206, search-hash search
207, Find-Other Find

Fourteen, other algorithms
496, the first unique character in the string
487, the reconstruction string
484, the house robbery II
482, the rising and falling string
481, use the least number of arrows to detonate the balloon
480, move zero
479, recursively solve robbery
475, effective mountains array
472, the insertion section
468, two solutions Timo attack
467. the sum of the non-recursive and recursive solution path problem
454, ectopic letter word packet
452, Jumper
443, the maximum value of the sliding window
436, The sword refers to Offer-print matrix
428 clockwise , the sword refers to Offer-prints from 1 to the largest n-digit number
427, the sword refers to Offer-the integer power of
424, the sword refers to Offer-cut the rope
421, and the element is searched in the sorted array The first and last positions of
419, the sword refers to Offer- the smallest number of the rotating array
418, the sword refers to Offer- Fibonacci sequence
415, the best sightseeing combination
412, the judgment subsequence
408, the sword refers to Offer- replace the space
406 , Sword refers to the lookup
405 in the Offer- two-dimensional array, the wine exchange question
404, Sword refers to the repeated number
393 in the Offer- array , parentheses are generated
393, parentheses are generated
390, the smallest sub-array
384, the integer inversion
382, the 5 ways to solve the problem of daily temperature
380, the missing first positive number (medium)
379, the largest rectangle in the histogram (difficult)
377, adjust the array Order the odd number in front of the even number
369, replace the integer
365, eliminate the game
360, divide the arithmetic sequence
358, remove the K-digit number
355, add the two numbers II
354, lexicographically rank
353, scramble the array
351, and minimize the number of moves Make the array elements equal II
350, the K- th smallest element in the ordered matrix
349, the combined sum IV
347, guess the number size II
346, find the smallest K pair number
345, super power
344, the largest divisible subset
343, kettle Question
342, calculate the number of digits with different digits

There are too many, so I won't list them one by one. I put them in pdf format and put them on the Baidu network disk. The download address and extraction code are as follows. You can also follow me on WeChat and follow "data structure and algorithm" and reply to the keyword " pdf " to get the download link

Link:
https://pan.baidu.com/s/1hjwK0ZeRxYGB8lIkbKuQgQ
extraction code: 6666

Guess you like

Origin blog.csdn.net/abcdef314159/article/details/114438109