当前位置:网站首页>IOS interview preparation - other articles
IOS interview preparation - other articles
2022-07-29 04:42:00 【smallcatlei】
iOS Interview preparation - ios piece
ios Interview preparation - objective-c piece
ios Interview preparation - Online
IOS Interview preparation - C++ piece
iOS Interview preparation - Other articles
Design patterns
Factory mode
The singleton pattern
Builder pattern
Use multiple objects to make a step-by-step type . Become a simple object . The design pattern of type belongs to the creation pattern , It provides the best way to create objects
One Builder Class will construct the final object step by step . The Builder Class is independent of other objects .
Adapter pattern
As a bridge between two incompatible interfaces . This type of design pattern belongs to structural pattern , It combines the functions of two independent interfaces .
Chain responsibility mode
Usually each recipient contains a reference to another recipient . If a recipient cannot process the request , Then it will send the same transmission request as the next sender , And so on .
Observer mode
One to many mode , When an object is modified , Objects that depend on it are automatically notified .
MVC and MVVM Pattern
MVC Pattern - View - controller . Controller control mode and view .
MVVM view viewMode mode . call chaining
Algorithm
java Common functions
Introduce the toolkit
import java.util.*;
list Turn array
String[] array2 = testList.toArray(new String[testList.size()]);
Array rotation list
ArrayList<String> arrayList = new ArrayList<String>(Arrays.asList(arrays));
Array copy
int[] arr = Arrays.copyOf(sourceArray, sourceArray.length);
int[] right = Arrays.copyOfRange(arr, middle, arr.length);
Quick sort
Objective-C Realization Quick sort :
https://blog.csdn.net/htwhtw123/article/details/125347823?spm=1001.2014.3001.5501
data structure
Trees
Binary search tree ( Binary sort tree , Binary search tree )
It could be an empty tree , Or a binary tree that has the following properties : If its left subtree is not empty , Then the value of all nodes in the left subtree is less than the value of its root node ; If its right subtree is not empty , Then the value of all nodes in the right subtree is greater than the value of its root node ; Its left 、 The right subtree is also a binary sort tree .
AVL Trees ( Balance tree )
A binary search tree , And the absolute value of the height difference between the left and right subtrees of each node ( Balance factor ) At most 1
The order of traversing the tree
The former sequence traversal Around the middle
In the sequence traversal Left middle right
Subsequent traversal Right and left
other
git Realization principle
Every time we run git add and git commit On command , Git The essential work is to save the rewritten file as a data object , Update the staging area , Record tree object , Finally, create a submission object that indicates the top-level tree object and the parent submission . These three main Git object —— Data objects 、 Tree object 、 Submit to —— Initially, they are kept in the form of separate files .git/objects Under the table of contents .
Git The core of is its object database , Which holds git The object of , The most important one is blob、tree and commit object ,blob Object realizes the recording of file content ,tree Object implements the file name 、 Record of file directory structure ,commit Object implements the version submission time 、 Version author 、 Version sequence 、 Records of additional information such as Version Description . These three types of objects , It's perfect git The basic function of : Record of version status .
Git Reference refers to git object hash Pointer like file of key value . adopt Git quote , We can more easily locate the submission of a certain version .Git Branch 、tags And other functions are based on Git Reference to the implementation of .
UNIX Common commands
Instructions | meaning |
---|---|
cat | Display file contents |
cd | Change the directory to the specified directory |
ls | List the files under the current path |
cp | Copy the source file to the destination |
file | Determine the type of document |
find | Find files |
mkdir | Create directory |
mv | Move ( rename ) file |
pwd | Print current directory |
rm | Delete file |
rmdir | Delete folder |
vim | open VIM Text editor |
gzip | Compressed files .gz file |
gunzip | Unzip the file |
User mode switches to kernel mode
trigger
system call
interrupt
abnormal
technological process
User mode can directly read and write registers , User mode operation CPU, Save the state of the register to the corresponding memory , Then call the corresponding system function , Pass in the corresponding user stack PC Address and register information , Convenient for subsequent kernel method calls , Restore the user method execution site
take CPU The field of is changed to kernel mode , Write the code address corresponding to the kernel segment to PC In the register , Then start executing kernel methods , The corresponding method stack frame is saved in the kernel stack .
When the kernel method is executed , Will CPU The field of is changed to user status , Then use the previously written information to recover the execution of the user stack
frame
SDWebImage
https://www.jianshu.com/p/e5d583e81ac0
MLeakFinder
YYModel
Setting and getting the value of the attribute are both through objc_msgSend Function implementation
边栏推荐
猜你喜欢
网络之以太网
Dasctf2022.07 empowerment competition
WebRTC实现简单音视频通话功能
Christmas tree web page and Christmas tree application
Make a virtual human with zego avatar | virtual anchor live broadcast solution
MySQL - clustered index and secondary index
如何避免示波器电流探头损坏
Detailed comparison of break and continue functions
mujoco和mujoco_py安装以及解决libXcursor.so.1:NO such dictionary
Deep analysis of data storage in memory (Advanced C language)
随机推荐
Configure st-gcn environment record [Google lab]
Shell string segmentation
Auto.js脚本开发环境搭建
谷歌浏览器 打开网页出现 out of memory
leetcode 763. Partition Labels 划分字母区间(中等)
mpc5744p简介与OpenSDA固件更新
On the use of pyscript (realizing office preview)
OpenCV环境搭建
Mujoco and mujoco_ Install libxcursor.so 1:NO such dictionary
[c language] PTA 7-51 sum the first n terms of odd part sequence
如何避免示波器电流探头损坏
I++ and ++i details
[c language] PTA 7-48 find the number of combinations
6. Pytest generates an allure Report
[c language] PTA 7-63 falling ball
Log configuration logback
Leetcode (Sword finger offer) - 53 - I. find the number I in the sorted array
Delete blank pages in word documents
Leetcode 686. KMP method of repeatedly superimposing strings (implemented in C language)
String, array, generalized table (detailed)