Baidu 2015 school recruited Beijing machine learning/data mining engineers for a written test (location: Tianjin University)

Source: Internet
Author: User

Note: memory-based writing may be incomplete or incorrect.

 

I. Short answer

1. Differences between new and malloc.

2. What does hash conflict mean? How can this problem be solved? Two methods are provided to describe the process and its advantages and disadvantages.

3. The probability of hit is 0.25. How many times does it take to hit at least one time if the probability of hit is no less than 0.75?

 

Ii. Algorithm Design Questions

1. Use C/C ++ to write a merge order.

The data structure is struct node {int V; node * Next };

The interface is node * merge_sort (node *);

2. design an S-type layered tree traversal algorithm. For example, the root node is the first layer, the second layer is traversed from left to right, the third layer is traversed from right to left, and the fourth layer is then traversed from left to right, and so on.

For example, 1 2 3 6 5 4 7 8 9 should be output in sequence.

3. Each line of a URL file is a URL address, which may be duplicate.

(1) Calculate the frequency of each URL and design the function implementation.

(2) There is a 1 billion URL with an average length of 20. Now the machine has 8 GB of memory. How can this problem be solved.

Iii. System Design Questions

Forward maximum matching algorithm (FMM) for Chinese Word Segmentation in natural language processing ).

Note: The example explains the basic idea of FMM.

(1) design the data structure struct dictnote of the dictionary.

(2) Use C/C ++ to implement FMM. The optional interface is

Int FMM (vector <string> iletters, dictnode * iroot, vector <int> * oresults );

Here, iletters is the sentence to be segmented, such as {"small", "Ming", "today", "day", "buy", "now", "I ", "P", "O", "N", "E", "6 "},

Iroot is the dictionary, and oresults stores the output result, that is, the location of word segmentation. You can also design your own interfaces.

(3) collected dictionaries of some mobile phone brands, such as {iPhone, Nokia }.

Search for webpages containing these mobile phone brands, such as iPhone 6 and Nokia 9973.

You can write pseudocode to modify FMM to implement this function.

 

September 20, 2014

Baidu 2015 school recruited Beijing machine learning/data mining engineers for a written test (location: Tianjin University)

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: info-contact@alibabacloud.com 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.