The paper

Due to the large number of questions, this article is just for the questions, I hope to play the reader’s hands-on ability, to explore the next, you can also comment below to reply to your answer or ask a higher quality question!!

Runtime Related Issues

  1. What is the message mechanism of OC?
  2. What is themethod swizzling
  3. useruntime AssociateMethod associated with the object that needs to be in the main objectdeallocWhen they were released?
  4. runtimeHow to implementweakAutomatic setting of variablesnil? knowSideTable?

Structural model

  1. Introduce runtime’s memory model (ISA, object, class, metaclass, structure storage information, etc.)
  2. Why design Metaclass
  3. class_copyIvarList & class_copyPropertyListThe difference between
  4. class_rw_tclass_ro_tThe difference between
  5. categoryHow is it loaded, two categoriesloadThe order in which methods are loaded, the order in which methods of the same name in both categories are loaded
  6. category & extensionDifference, can I add an Extension to NSObject? What’s the result
  7. Message forwarding mechanism, the advantages and disadvantages of message forwarding mechanism and other language message mechanisms
  8. When the method is called,Method Query -> Dynamic resolution -> Message forwardingWhat did you do
  9. IMP,SEL,MethodThe differences and usage scenarios
  10. load,initializeWhat’s the difference between methods? What’s the difference in the inheritance relationship
  11. Talk about the pros and cons of message forwarding

Memory management

  1. weakThe implementation principle of?SideTableWhat is the structure of psi
  2. Application of associated objects? How does the system implement associated objects
  3. How is the associated object memory managed? How does an associated object implement the Weak property
  4. AutoreleasepoolThe principle of? What are the data structures used
  5. ARCThe implementation principle of?ARCUnder theretain & releaseWhat optimizations have been made
  6. ARCWhat can cause a memory leak

other

  1. Method SwizzleMatters needing attention
  2. Attribute modifieratomicWhat is the internal implementation of? Is it thread safe
  3. What are the methods of introspection in iOS? What is the internal implementation
  4. Class, objc_getClass, and object_getClassWhat’s the difference?

NSNotification related

  1. Implementation principles (structural design, how notifications are stored,name&observer&SELBetween, etc.)
  2. Are notifications sent synchronously or asynchronously
  3. NSNotificationCenterAre receiving and sending messages in the same thread? How do I send messages asynchronously
  4. NSNotificationQueueIs it sent asynchronously or synchronously? Which thread responds
  5. NSNotificationQueueandrunloopThe relationship between
  6. How do I ensure that the notification receiving thread is on the main thread
  7. Will the notification crash if the page is destroyed without removing it
  8. What happens when you add the same notification multiple times? Multiple removal notifications

Runloop

Runloop is a familiar feature for any standard iOS developer. Here are a few typical problems

  1. How does the app receive touch events
  2. Why only the main threadrunloopIs open
  3. Why only refresh the UI on the main thread
  4. PerformSelectorandrunloopThe relationship between
  5. How do I keep threads alive

KVO

As with Runloop, this is standard, and a few typical problems are listed

  1. Realize the principle of
  2. How do I manually close kVO
  3. Does KVO trigger when a property is changed through KVC
  4. Under what circumstances will KVO crash and how to prevent it
  5. Advantages and disadvantages of KVO

Block

  1. blockWhat does the structure look like
  2. Is block a class? What are the types
  3. aintVariables are__blockEmbellished or not? Block
  4. blockIn the modifiedNSMutableArray, whether it needs to be added__block
  5. How does memory management work
  6. blockYou can usestrongModified?
  7. Why use it when solving circular references__strong, __weakmodified
  8. blockhappencopyThe timing
  9. BlockTo access the object typeAuto variableWhen theThe ARC and MRCWhat’s the difference

multithreading

Mainly the COMMUNIST Party

  1. iOSHow many types of threads are there in development? Respectively compared
  2. GCDWhich queues are available and which queues are provided by default
  3. GCDWhat are the method apis
  4. GCDThe relationship between main thread and main queue
  5. How do you do it, and in as many ways as you can
  6. dispatch_onceRealize the principle of
  7. Under what circumstances does a deadlock occur
  8. This section describes the types of thread locks and their application scenarios
  9. NSOperationQueueIn themaxConcurrentOperationCountThe default value
  10. NSTimer, CADisplayLink, dispatch_source_tThe advantages and disadvantages of

View & image correlation

  1. AutoLayoutThe principle, performance how
  2. UIView & CALayerThe difference between
  3. Event response chain
  4. drawrect & layoutsubviewsCall time
  5. UI refresh principle
  6. Implicit animation & Show animation difference
  7. What is off-screen rendering
  8. ImageName and imageWithContentsOfFile
  9. Will the same image be loaded repeatedly
  10. When was the image decoded and how was it optimized
  11. How to optimize the picture rendering
  12. If the GPU refresh rate exceeds the 60Hz refresh rate of the iOS screen, what is the problem and how to solve it

Developer certificate

  1. What does Apple use certificates for
  2. Certification process for app installation in AppStore
  3. How do developers install apps on devices in debug mode

Architecture design

Learning typical source code

Just list some iOS more core open source libraries, these libraries contain a lot of high-quality ideas, source learning must pay attention to each framework to solve the core problem is what, as well as their advantages and disadvantages, so as to truly understand and absorb

  1. AFN
  2. SDWebImage
  3. JSPatch, Aspects(although one is not available and the other is not maintained, both libraries are neat enough to learn)
  4. Weex/RN, the author believes that it is necessary to know the principle of this library which is closely related to the front end and the client
  5. CTMediator, other router libraries, these are common routing libraries, development will be basically used
  6. More pleaseThe readerAdd in the comments below

Architecture design

  1. Manual burial point, automatic burial point, visual burial point
  2. MVC, MVP, MVVMDesign patterns
  3. Common design patterns
  4. The downside of singletons
  5. Common routing schemes and their advantages and disadvantages
  6. If the stability of the project is guaranteed
  7. Designing an Image Caching Framework (LRU)
  8. How to design agit diff
  9. Designing a thread pool? Draw your architecture diagram
  10. What is your app architecture, what are the pros and cons, why, and how to improve it

Other problems

  1. PerformSelector & NSInvocationAdvantages and disadvantages compared
  2. ocHow to implement multiple inheritance? How to face the section
  3. What are thebugWill cause a crash, how to prevent the crash
  4. How to Monitor crashes
  5. app(Look at LLVM compilation, static linking, dynamic linking, runtime initialization)
  6. The role of each folder partition in the sandbox directory
  7. Briefly describes thematch-oFile structure

System Basics

  1. The difference between processes and threads

  2. HTTPS handshake process

  3. What is a man-in-the-middle attack? How to prevent

  4. TCP handshake process? Why three handshakes and four waves

  5. The difference between heap and stack? Who takes up more memory space

  6. Encryption algorithm: The difference between symmetric encryption algorithm and asymmetric encryption algorithm

  7. What are the common symmetric encryption and asymmetric encryption algorithms

  8. MD5, Sha1, and Sha256 are different

  9. Charles Packet capture process? How to capture packets on 4G without Charles

Data structures and algorithms

For mobile developers, generally do not encounter very difficult algorithms, mostly based on data structures, I listed some of the necessary algorithms, of course, there is time to go to LeetCode brush questions

  1. Eight Sorting algorithms
  2. The stack and queue
  3. String processing
  4. The list
  5. Operations related to binary trees
  6. Deep search search
  7. Basic dynamic programming, greedy algorithm, binary search

Original: [iOS development interview, commonly asked interview questions (set) – Jane books (jianshu.com)] (www.jianshu.com/p/4dd8d26ea)…

Portal:

IOS Interview Collection + Answers (1-5) (Juejin.cn)

IOS Interview collection + Answer (1) (juejin.cn)

IOS Interview collection + Answer (2) (juejin.cn)

IOS Interview collection + Answer (3) (juejin.cn)

IOS Interview collection + Answer (4) (juejin.cn)

IOS Interview collection + Answer (5) (juejin.cn)

(qq.com)