A summary of the essence of interviews with 50 major factories. Let’s finish this 1307-page Android Interview Collection. A summary of interview questions from major factories

The new year of 2021 will start a new journey. Looking back on 2020, it is really "Southern".

From the beginning of the year, the layoffs of major factories turned out to be a matter of course, and in April the "996.ICU" on GitHub aroused everyone's resonance. Even if we are conscientious in "996", it is still difficult to resist the "heart confusion" at the age of 35.

However, anxiety and anxiety are things the weak do. The strong always maintain a learning attitude, and build their own knowledge system in the first 5 years of career development, and they can be fearless.

I know a lot of good Android engineers, they are not at all anxious, because they know clearly their weaknesses and strengths.

During the communication with them, I summarized 3 points of experience and shared with you

Scudo is a user-mode allocator designed to provide additional mitigation to prevent heap vulnerabilities while maintaining good performance. It is open source and part of LLVM's editor-rt project.

Scudo is currently the default allocator in Fuchsia, which has been enabled in some components of Android and used in some Google production services. Although it was originally implemented on top of some components of sanitizer_common, it is now rewritten to be standalone without relying on other compiler-rt components, making it easy to use (and other performance and security advantages).

Scudo consists of the following components:

Primary distributor

This is a fast allocator for handling smaller requests (configurable at compile time). It is "isolated", for example: blocks of the same size are ultimately located in the same storage area and separated from other areas (the 64-bit separation is stronger, and the storage area is reserved for the main area); the master node allocates The blocks are randomly allocated to avoid predictable address sequences (note that the larger the size, the higher the predictability of the addresses to each other).

Secondary distributor

Packaging platform memory allocation primitives are therefore slower and used to service larger allocations. The allocation completed by the auxiliary server is surrounded by a protected page;

Local cache

These are thread-specific storage and hold pointers to free blocks to reduce contention on the global free list. There are two modes: exclusive mode and shared mode. Using the exclusive model, each thread has a unique cache, which will take up more memory, but there is almost no contention. Using the shared model, threads can share a certain number of caches, which can be dynamically reallocated at runtime based on competition-it uses less memory compared to the dedicated model and can usually better meet the needs of the end user platform .

quarantine area

It can be equivalent to the delayed release list in the heap range. Before releasing it to the system, the recently released block is reserved for a period of time until the condition is met (usually reaching a certain size). There are threaded isolation areas and a global isolation area. In terms of memory usage and performance to a certain extent, this is the most influential: even a small isolation area can have a big impact on the process RSS. Therefore, it is disabled by default and can be enabled on a per-process basis (and adjusted according to the needs of the process).

safety

Enforce maximum size and alignment values, but also check that the provided pointers are properly aligned; these are cheap checks to avoid integer overflow and catch low pending allocation errors (or abuse);

Before each block, there is a header, which stores basic information about the distribution and check code, and is checked and checked to be able to detect whether the memory is damaged.

The checksum of the header, the pointer to be processed and the content of the header-this does not mean that the cryptography is strong. As for the data stored in the header file, it saves the allocated size, the state of the block (available, allocated, isolated), its source (malloc, new, new []) and some internal data. The header is operated atomically to detect competing attempts between threads running on the same block.

Ensure that the release function is consistent with the allocation function of the returned target block (for example: free / malloc, delete / new); we will randomly allocate everything to reduce predictability as much as possible; one of the side benefits of thread caching is that if an attacker uses Allocation primitives in different threads, they make it more difficult for an attacker to get the required block in the required state.

Let’s take a look at some typical benchmarks of Google’s production services, which involve many asynchronous threads, protobuf, RPC and other advantages, all of which run on a 72-core Xeon machine with 512GB RAM (not for the most rigorous comparison, but Is to keep you updated.) The first metric is the number of queries per second, and the second metric is the peak RSS of the program (reported by /usr/bin/time).

Learning welfare

[Android detailed knowledge point mind map (skill tree)]

In fact, there are so many knowledge points in Android development, and there are still a few things to ask in interviews. Therefore, there are no other tricks for the interview, just to see how well you prepare for these knowledge points. So, when you go out for an interview, it is good to see which stage you have reached in your review.

Although Android is not as hot as in previous years, the era of finding high-paying jobs with four major components has passed. This can only show that the positions below the intermediate level of Android are saturated. Now senior engineers are still relatively lacking . Many senior positions give very high salaries (you may not be able to find a suitable one if you have more money), so I strive to become a senior engineer. is the most important.

Attached here are dozens of sets of ByteDance related to the above-mentioned interview questions, interview questions from JD.com, Xiaomi, Tencent, Toutiao, Ali, Meituan and other companies in 19 years. The technical points are organized into videos and PDFs (in fact, a lot of effort was spent than expected), including knowledge + many details.

Due to limited space, I will show you a small part in the form of pictures.

The detailed arrangement can be seen on GitHub;

Android architecture video + BAT interview topic PDF + study notes

There are a lot of materials for learning Android on the Internet, but if the knowledge learned is not structured, and when you encounter problems, you just taste it and stop studying it in depth, then it is difficult to achieve real technological improvement. I hope that this systematic technical system will provide you with a direction reference.

If the knowledge learned is not a system, and when you encounter a problem, you just taste it and stop studying it in depth, then it is difficult to achieve real technical improvement. I hope that this systematic technical system will provide you with a direction reference.

Guess you like

Origin blog.csdn.net/fjfdhduuffududu/article/details/112939865