当前位置:网站首页>2021 the latest Android written examination topic, 50 big factory interview ten thousand words essence summary

2021 the latest Android written examination topic, 50 big factory interview ten thousand words essence summary

2021-10-14 08:15:05 mb6128e77bb3cd5

The second floor

The interviewer is not satisfied with my cheating , He needs me to speed up , This speed is not good .

What?? Is there anything with lower time complexity ? No no no , This is a core problem, which is actually a multi-threaded problem .

  1. take 10 Billion pieces of data , The first processing of data through divide and conquer thinking .
  2. Start multithreading, and then perform priority queue operations on the segmented data .
  3. Then each sub thread filters out the largest k Number
  4. When all threads are executed, merge data

I guess the third layer

  1. Consider how many pieces of data are divided into pieces , Then how to improve the efficiency to the highest ?
  2. How many threads to build is the most efficient ?

This is what I didn't expect , If you have ideas, you can talk about it .

Topic two : The number of words in an article

At first glance, this problem seems not difficult ,foreach When the loop encounters a space or punctuation sum++, Is it possible to solve this problem .

However, things are not as simple as thought . What is the most difficult question in an interview , It may be a reflection on the real boundary problem of this topic .

  1. What if this article is very big , Will you run out of memory ?
  2. How to remove repetition from words ?

Can we consider reading line by line ?

Turn it into IO flow , Read stream line by line , Then perform a count operation on the input content , Can we solve this problem .

The problem of word repetition

Oh my god , This is so simple HashSet ah !!!! So if I blow up massive data again ?

Oh my god , Death spiral . Maybe we can consider using hash To solve the problem , Keep only words hashcode, Is it possible to solve it .

Similarly, this can also be optimized using multithreaded sharding

The way is basically the same as above , Just slice the data , Then multithreading scheduling , Then merge the results .

Last

For programmers , What to learn 、 There's too much technology , If you want not to be eliminated by the environment, you have to constantly improve yourself , It's always us to adapt to the environment , Not the environment to adapt us !

Last , I repeat , If you want to be a good Android Developer , Please focus on , Do in-depth research on basic and important things .

For many primary and intermediate Android For Engineers , Want to improve skills , Often is oneself gropes for growth , Unsystematic learning is inefficient, long and helpless . I hope that these architecture technologies can be applied to Android Development of friends have reference and less detours , The point of this article is whether you have gained and grown up , The rest is unimportant , I hope readers will keep this in mind .

In order for everyone to smoothly advance to middle and advanced level 、 Architects , I've specially prepared for you A set of master learning source code and framework, video and other products Android Architect tutorial , Make sure you learn to make sure your salary goes up to a higher level .

Here are some exclusive dry goods to share with you today :

2021 newest Android Written test questions ,50 Summing up the essence of interview _ interview

This article has been  CODING Open source project :《Android Summary of learning notes + Mobile architecture video + The real interview question of Dachang + Project source code 》 Included

版权声明
本文为[mb6128e77bb3cd5]所创,转载请带上原文链接,感谢
https://chowdera.com/2021/10/20211002153919925r.html

随机推荐