Xiaomi interview Record

Source: Internet
Author: User

1, WINDOWS32-bit machine and 64-bit machine sizeof (int), sizeof (int *), sizeof (void *), sizeof (long), sizeof (long long) what is the number of each?

2. Can virtual functions in C + + be private? Why?

3. Where are static data members in the C + + class initialized?

4. Can the parameters of virtual functions in C + + class be template parameters?

5. What is the state of memory when the program is running?

6, binary sorting tree, how to find the current node of the successor node?

7. Find out if the array of unordered positive integers has two numbers and is the given integer target?

8, multi-process and multi-threaded differences and contact?

9, put a stone directly into the deep enough water, and put a stone on the boat floating on the water, which situation is higher water level?

7. Find out if there are two numbers in the array of unordered positive integers and a given integer Target?class solution {public:    vector<int> twosum (vector<int> & numbers, int target) {     vector<int> res;     Map<int,int> Numbersmap;     Map<int,int>::iterator iter;     for (int i=0;i<numbers.size (); i++)     {         iter=numbersmap.find (target-numbers[i]);         if (Iter!=numbersmap.end ())         {             res.push_back (iter->second);             Res.push_back (i+1);             break;         }         else         {             numbersmap[numbers[i]]=i+1;         }     }     return res;    }};

  

  

Xiaomi interview Record

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.