Located in the corner of north China, many companies did not come to the site for spring recruitment this year, so most of them were online interviews approved in advance. The whole March was rather tired, so I should not participate in the school recruitment in April, or dangdang Xianyu, and then went to practice.

Although I had been resisting to recite and brush questions before, I found that my foundation was really poor after experience, so it was really necessary to lay a good foundation.

Companies participating in the interview (online pre-approval + offline recruitment) : Time order: 3.1~4.10

1, today’s headlines :(hanging on three sides)

2, Homework help (offline school recruitment), offer get

3, Guazi (offline school recruitment), offer get

4. Offer get for Beijing netease Open courses

5, We should get the offer

6, wechat Guangzhou, offer get

7. Alibaba Hangzhou (Technical rating A), offer get

Shanghai Meituan, offer get

.

1. Summary of questions asked:

Runtime&runloop & Performance optimization (runtime&Runloop & Performance optimization)

  • Asynchronous rendering & Off-screen Rendering &CPU rendering & GPU Rendering
  • UIView life cycle, UIViewController life cycle
  • What locks are available in iOS (Principle + App + Optimization)
  • How to deal with audit rejection
  • Runloop puts a task into the second runloop: do something with socket/port (encapsulate a source)
  • Have a look at the UIKit framework architecture
  • Difference between ID and InstenceType
  • Use of instrument plug-ins (as much as possible)
  • IMP and SEL and the operations performed
  • When do you choose to use GCD and when do you choose NSOperation in your project? (Depending on the size of the project and the policy decisions of the interface and the complexity of thread operations)
  • Can you see which selector of which object is currently being called when the application crashes inside objc_msgSend? (Yes, you can look up the call stack information. You can also dump the stack.)
  • NSString property is often copied
  • How to convert asynchronous threads into synchronous threads for unit testing
  • Autoreleasepool usage scenarios and principles: Answer based on runloop and mention the implementation of Autoreleasepage (based on bidirectional linked lists)
  • What do you think are objective-C’s greatest strengths and weaknesses? For the deficiencies, is there a way to bypass these deficiencies to fulfill the requirements available now?
  • Xcode has two methods for analyzing app memory (there are differences: whether it is included in the image cache)
  • Memory usage and optimization considerations
  • How to use performSelector to pass in three or more arguments, one of which is a structure.
  • Nsstring retainCount problem
  • IsMemberOfClass and isKindOfClass connections and differences
  • To achieve accurate timer:
  • What protocols NSObject implements
  • Message forwarding mechanism (Runtime based on all points)
  • Do objects associated with the Runtime Associate method need to be released when the main object dealloc is used
  • Can I add instance variables to the compiled class? Can you add instance variables to classes created at run time
  • The priority and processing of gesture response and touch event propagation

1.2 Basic Computer (network + Data structure + Programming + operating system)

Database did not ask how not Po…

1.2.1 Computer Network:

  • NSURLConnection improves NSURLsession:
  • In what way does AFN implement multithreading
  • TCP is based on streaming transmission, how to design the protocol, protocol analysis?
  • How to implement upload/download task resumable breakpoint
  • Send network request, when to connect IP, when to connect domain name
  • Do you know about socket programming? Where is it used in the project?
  • When the client program, the client send succeeded, but the server did not receive it. What is the possible cause
  • How to design the chat protocol using ONLY TCP?
  • The difference between HTTP and scoket communication.
  • How many steps does CFSocket use? What methods of manipulating sockets are provided in Core Foundation?
  • HTTPS process, 7 handshakes, and how to prevent man-in-the-middle attack
  • Common status codes (application level)
  • URL redirection
  • TCP, UDP features and specific applications
  • Sliding window understanding as well as slow start measures

1.2.2 Data Structure:

  • Hash table implementation (thinness) : what optimizations happen when the zip length exceeds the threshold (see JDK handling ideas)
  • Common linked list algorithms (see “Finger Offer”)
  • Stack&queue algorithm (see “Finger Offer”)

1.2.3 Programming Basics

  • Why can’t floating point types be exact
  • Query and insert efficiency of several containers
  • How mutable containers are implemented
  • How does C++ implement a class that cannot be inherited
  • C compilation process
  • The difference between dynamically linked and statically linked libraries
  • C++ and OC
  • Comparison between GC and ARC (GC is runtime)
  • Implementation of singletons (locking and performance optimization)
  • Five regions of memory
  • Code file compilation is what the generation process does

1.2.4 Operating System

  • How is thread switching implemented in the operating system? How do you throw the parameters of a function called by one thread to another thread
  • The concept of assembly line
  • Page Replacement Algorithm of Virtual Memory (Programming Implementation)
  • Four necessary conditions for deadlocks
  • The way in which processes communicate
  • Buffer concept
  • Deadlock prevention algorithms

1.3 Algorithm basics:

1.3.1 Figure: Pay attention to the flexible application of the algorithm

  • Minimum spanning Tree (Prime algorithm, Kruskal algorithm)
  • Shortest Path Algorithm (Floyd, Dijkstra)
  • Is there a ring in the diagram
  • DFS&BFS application: maze problem more
  • A topological sort

1.3.2 Tree: Basically all algorithms are 2-tree

This refers to the “sword finger Offer” + self-line Baidu common binary tree algorithm

1.3.3 Sorting Algorithm:

We must deeply understand the principle of three kinds of sorting and optimization methods: for example, the optimization of large file sorting algorithm, using the characteristics of fast sorting and merging, using the characteristics of two kinds of sorting, mixed use.

  • Heap sort
  • Quick sorting: Recursive & non-recursive
  • Merge: Recursive & non-recursive
  • Inner sort and outer sort

1.3.4 DP: There are many questions, but the types are limited

1.3.4.1 LCS class:
  • Longest common subsequence of a string
  • Longest monotonically increasing subsequence: sort first and then convert to LCS problem
1.3.4.2 Backpack Problems:
  • 0-1 Backpack problem:
  • The array is divided into two sums and subarrays as equal as possible: knapsack capacity =sum/2, which translates to 0-1 knapsack problem
  • Multiple backpacks problem: n backpacks, seeking the maximum sum
  • Complete knapsack problem:
  • Coin combination problem:
1.3.4.4 The number of all combinations
  • How many different combinations of the 1 cent, 2 cent and 5 cent coin?
  • A person can go up steps one, two, or three at a time, and ask the person how many ways to go up n steps
1.3.4.5 Minimum Paths and Problems:
  • The minimum sum of paths of a matrix
  • The minimum sum of paths of a triangle

1.4 Programming thought & Design mode, etc. :

  • Refer to “The Way of iOS Programming” for programming ideas
  • Design patterns are primarily MVC&MVVM&MVCS understood
  • Componentization is something to know
  • Common methods of decoupling
  • Design ideas of the design module:

    1. How does the operation queue encapsulate GCD to achieve the maximum number of concurrent Settings (semaphore realization) 2. Design of NSNumber (class cluster design idea) 3

2 Recommended Books:

  • Sword refers to the offer (3, corresponding to the niuke.com on the question all brush up);
  • Interview treasure book (C++ version) again
  • The operating system is roughly a look;
  • Data structure again, mainly hash, usually do not pay attention to the place, understand some principles.
  • Computer networks [HTTP/HTTPS, TCP, UDP, TCP/IP protocol clusters] are basically these
  • Database:
  • Leetcode brush questions, easy brush all + part of the medium questions or niuke.com brush questions can be

Here are a few books that don’t quite make sense (probably because I’m a bit of a sucker) :

  • Objective-c advanced programming (multithreading and memory management);
  • The Effective Objective – C 2.0;
  • Principles of iOS programming
  • Proficient in Objective – C

Gold-digging techniques: links to 👉 juejin.cn/post/1