Baidu interview question Summary

Source: Internet
Author: User

On the afternoon of June 14, Baidu shared all the questions. There were two rounds in total, and the offer was not aware of them yet. They felt very general.

1. Linux Process Communication Method
2. Thread Synchronization (I pulled the difference between signal and criticalsection)
3. Binary Tree, finding the distance between the two nodes with the maximum distance
4. the madman got on the plane:
5. How to classify webpages (I answered the question based on the keyword library, and then KMP for retrieval, and then pulled for a moment). Question 2: int longest_road (node_t * root ){
If (root = NULL) return 0;
Int left_depth = longest_road (root-> Lc );
Int right_depth = longest_road (root-> RC );
Longest = max (longest, left_depth + right_depth );

Return max (left_depth + right_depth) + 1;
} Two sides 1. Self-Introduction
2. self-developed projects
3. Introduce a sort that you are most familiar Algorithm I will talk about heap sorting, how to build and how to sort, and how to illustrate when it is not stable
4. Differences Between Stack, stack, and global data (including lifecycle and allocation rules)
5. It is proved that N can be expressed as a combination of N = 3 ^ K +/-3 ^ x .. n can be expressed as a power of 3. For example, 4 = 3 ^ 1 + 3 ^ 0 5 = 3 ^ 2-3 ^ 1-3 ^ 0. That is to say, the coefficient can only be 1 or-1, and cannot be other. Write an algorithm to prove the uniqueness of this representation. 6. N number, the minimum number of times can be used to find the maximum number of two
7. How to calculate a-B for a 1 billion-size URL set a and B (I just gave the rough Implementation of the hash algorithm, and I feel that he is not very satisfied with it)
8. Open Question: If content quality is evaluated for the website, such as assessing the website health. Let's add another example: An array is provided to determine whether the elements in the array are the result of BST root traversal. Classic Code As follows:
 bool postordertraversal (INT data [], int low, int high) {If (low> = high) {return true ;} int split =-1; int I; bool found = false; // to see if the data can be splited as ABC where c is the last one, all members in a 
    C for (I = low; I 
     data [High]) {If (split =-1) {split = I; found = true ;}} if (data [I] 
     C; {return postordertraversal (data, low, high-1);} else // recursive way {return postordertraversal (data, low, split-1) & postordertraversal (data, split, high-1) ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.