The company uses algorithms to evaluate programmers, which is linked to performance. If the performance is too poor, will it be eliminated?

During this period of time, a fan friend said something:

The company's development efficiency is low. The boss who is a programmer has looked at the code of some employees and found that it can be done with two lines of code, and some people use more than a dozen lines. What's even more funny is that there is a newcomer who has coded out 100 situations of an event line by line. The boss almost smashed the computer with anger, but then I thought about it. When recruiting people during the interview, he didn't pay attention to the evaluation of algorithms, and some did not have evaluation algorithms at all.

So recently, the boss downloaded a bunch of algorithm questions for interviews with big Internet companies such as Baidu, Tencent, and ByteDance from the Internet, giving programmers across the company a unique assessment.

It also stated publicly that if you want a salary increase, it depends on the results. In addition to raising the base salary, those with excellent results also increase the performance salary. However, employees with poor grades will be trained in a unified manner. After the training period, they will be assessed again. Employees who are still unqualified will be dismissed.

Hearing this, Xiaotian instantly broke into a cold sweat, I hope my company will not do this kind of thing!

However, the algorithm is indeed a technical ability that programmers can't miss, which will determine whether your development and writing code will be easy. In addition, the interviews of many big companies such as Bytedance and Baidu all independently investigated the algorithm.

Xiaotian compiled a set of learning materials related to data structure and algorithms, as well as a learning roadmap:

Data Structures and Algorithms

Consensus algorithm

Paxos

1. Three roles of Paxos

  • To propose
  • Acceptor
  • Learner

1.1.2. Paxos algorithm is divided into two stages

  • Phase 1 (the quasi-leader is determined)
  • Phase 2 (leader confirmation)

Zab

1. Crash recovery: mainly the leader election process

2. Data synchronization: Leader server synchronizes data with other servers

3. Message broadcast: Leader server sends data to other servers

Raft

1. Role

· Leader (Leader-Log Management)

· Follower (follower-log synchronization)

· Candidate (candidate-responsible for voting)

2. Term (term of office)

3. Election

  • Election timer

4. Safety

5. The difference between raft protocol and zab protocol

NWR

  • N: How many copies of backup data are there in a distributed storage system
  • W: represents a successful update operation requires at least w data to be written successfully
  • R: represents a successful read data operation requires at least R pieces of data to be successfully read

Gossip

Consistency Hash

1. Consistent Hash features

2. Principle of Consistency Hash

  • Construct circular hash space
  • Map the content (object) that needs to be cached to the hash space
  • Map the server (node) to the hash space
  • Map objects to service nodes
  • Check changes in cache
  • Virtual node

2. JAVA algorithm

Binary search

Bubble sort algorithm

Insertion sort algorithm

Quick sort algorithm

Hill sorting algorithm

Merge sort algorithm

Bucket sorting algorithm

Base sorting algorithm

Pruning algorithm

Backtracking algorithm

Shortest path algorithm

The largest sub- array algorithms

Longest Common Subsequence Algorithm

Minimum spanning tree algorithm

3. Data structure

Stack

Queue

Link

Hash Table

Sorted binary tree

  • Insert operation
  • Delete operation
  • Query operation

Red black tree

  • Characteristics of red-black trees
  • Left hand
  • Right hand
  • Add to
  • delete

B-TREE

bitmap

4. Encryption Algorithm

  1. AES
  2. RSA
  3. CRC
  4. MD5

Information: Algorithm learning content, algorithm and data structure brain map, interview questions with answers , I have packaged them, scan the QR code on the left side of the homepage or click the hyperlink below the QR code to receive it for free!

Dachang algorithm interview questions

Baidu

1. Duduxiong wants to buy a hat at the mall. There are N hats in the mall, and some hats may have the same price. Dudu Xiong wants to buy a hat with the third cheapest price. What is the price of the third cheapest hat?

2. There are N points on a number line. The coordinates of the first point are the current position of Duduxiong, and the N-1th point is the home of Duduxiong. Now he needs to walk from coordinate 0 to coordinate N-1 in sequence.

However, in addition to the 0th coordinate and the N-1 coordinate, he can select a point from the remaining N-2 coordinates and ignore this point directly. How far does Du Xiong go home at least?

3. There are N points in the three-dimensional space, and each point may be one of three colors. The three colors are red, green and blue, which are represented by'R','G', and'B' respectively.

Now we need to find three points and form a triangle to maximize the area of ​​this triangle.

But the triangle must satisfy: the colors of the three points are either all the same or all different.

4.

Tencent

1. Niu Niu and Yang Yang are playing a card game. There are n cards in this game, and the number ai is written on the i-th card.

The bull and the sheep draw cards in turn. The bull draws first. Each time they draw a card, they can choose any one from the card pile until the cards are drawn.

Their score is equal to the sum of the card numbers they draw.

Now suppose that both the cow and the sheep adopt the optimal strategy. Please calculate the score of the cow after the game is over minus the score of the sheep.

2. Little Q's parents are on a business trip for N days. Before leaving, they left M pieces of chocolate for Little Q. Little Q decides to eat at least half of the chocolate that he ate the day before, but he doesn't want to eat without chocolate one day before his parents come back. May I ask how many chocolates he can eat on the first day.

3. …the

above information: algorithm learning content, algorithm and data structure brain map, interview questions with answers , I have packaged them, scan the QR code on the left side of the homepage or click the hyperlink below the QR code to receive it for free!

Guess you like

Origin blog.csdn.net/EnjoyEDU/article/details/107671933