There are a thousand Hamlets in the eyes of a thousand readers, and a thousand advanced iOS interview questions in the eyes of a thousand iOS programmers. Here are some of the questions I think you can use to interview a senior iOS programmer.
The topic of this set of questions has nothing to do with the company and the business, and also does not represent the author himself can answer these questions very well, the author just feels a part of the better questions from the interview questions collected inside pulled out just.
The interview questions were collected from three sources:
- I have collected and sorted out the interview questions in the process of preparing for the interview.
- I thought about the new questions in the process of preparing for the interview.
- I encountered in the interview process feel better questions.
This paper is divided into three parts:
- The interview questions
- What do you like and what don’t
- You are advised to prepare data structure and algorithm questions
The first part is the interview questions; The second part gives the author likes and dislikes to investigate the question and the reason; The third part is why I suggest you prepare data structure and algorithm questions.
The interview questions
IOS based questions
- What’s the difference between classification and extension? What can they be used for? What are the limitations of classification? What are the members of the structure of classification?
- Let’s talk about the implementation mechanism of atomic; Why can’t it be absolutely thread-safe (preferably in context)?
- What happens to a weak modified object when it is released? How does it work? Do you know sideTable? Can you draw the structure inside?
- What are the applications of associated objects and how does the system manage associated objects? Does it need to be freed by manually setting all the associated object Pointers to null?
- Underlying implementation of KVO? How do I cancel the system default KVO and trigger it manually (condition the KVO trigger: if the changed value meets a certain condition, then trigger KVO)?
Autoreleasepool
What are the data structures used?AutoreleasePoolPage
Do you know about structures?- What about objects, class objects, metaclass, and metaclass structures and how they relate to each other? Why are object methods not stored in the object structure, but in the class object structure?
class_ro_t
和class_rw_t
The difference between?- How many ways to introspect in iOS?
class
Methods andobjc_getClass
What’s the difference? - The method that creates the class at run time
objc_allocateClassPair
Why is the end of the method name pair? - An int variable is
__block
Embellished or not? - Why use outside of blocks
__weak
It needs to be used internally while decorating__strong
Modified? - What does RunLoop do? Do you know the inner workings of it? (Preferably in conjunction with thread and memory management)
- Which scenes can trigger off-screen rendering? (Say what you know)
IOS practical problem
- How to slim down the AppDelegate?
- What is reflection? Can you name some application scenarios? (Say what you know)
- What scenarios are NSOperation easier to implement than GCD? (or the points NSOperation is better than GCD, tell as many as you know)
- App startup optimization strategy? It is better to talk about the process of starting main() before and after the execution of the function.
- Do you understand the idea of non-trace burying point of App? What characteristics do you think an ideal non-trace buried point system should have? (Say what you know)
- What do you know about app crashes and how to block and resolve them? (Say what you know)
- What situations do you know will lead to app shutdown, and what methods can be used to avoid it? (Say what you know)
The network problem
- What are the optimization strategies for the App network layer?
- Why does TCP need three handshakes and four waves?
- What is the difference between symmetric encryption and asymmetric encryption? What algorithms are implemented?
- HTTPS handshake process? Why do you need asymmetric encryption for key delivery? Do you understand two-way authentication?
- How does HTTPS implement authentication and authentication integrity?
- How to catch HTTPS packets with Charles? What is the principle and process?
- What is a man-in-the-middle attack? How to avoid it?
Computer system problems
- Do you understand the compilation process? What are the steps?
- What about static links? What’s the difference between a static library and a dynamic library?
- What are the functions of several areas of memory?
- What’s the difference between static and const?
- Do you know inline functions?
- When do deadlocks occur? How to avoid it?
- What is your understanding of thread safety?
- List the thread synchronization strategies you know?
- What kinds of locks are available? How do they work? What’s the difference between them? It is best to combine it with the usage scenario
Design Pattern questions
- What design patterns do you know besides singletons and observer design patterns? To introduce each of them
- Which design pattern do you like best? Why is that?
- What design patterns are practiced in the iOS SDK?
- ** What problems are design patterns designed to solve?
- ** What is the composition of the design pattern and how it works?
- ** What are the pros and cons of the design pattern?
Architecture & Design questions
- The difference between MVC and MVVM? What’s the difference between MVVM and MVP?
- Do you know several principles of object-oriented design? The best way to think about it is in context.
- Can you tell me some refactoring tips? When do you think refactoring is appropriate?
- What do you think is the difference between frameworks and design patterns?
- Which third-party frameworks have you seen and how are they designed? Where is the design good, where is the design bad, how can it be improved? (The last three questions in this question are already too difficult, and companies that aren’t too busy don’t recommend exploring them.)
Data structure & algorithm problem
- What’s the difference between a linked list and an array? What is the time complexity of insert and query?
- How is a hash table implemented? How do I resolve address conflicts?
- Sort problem: bubble sort, choice sort, insertion sort, quicksort (2 way, 3 way) can write what?
- Linked list: how to detect whether there is a link in the list? How do I delete all nodes in a linked list that are equal to a value?
- Array problem: How to find two elements in an ordered array whose sum is equal to a given value? How do I merge two ordered arrays and maintain order?
- Binary tree problem: how to reverse a binary tree? How do I verify that two binary trees are exactly equal?
Likes and dislikes
It’s easy to see that the iOS portion of the interview questions is actually not that large (one-third), because I think:
Advanced iOS Development = Advanced development + (Advanced) iOS development.
The advanced development part should be considered as a priority, and the purpose is to first verify whether the candidate has the basic qualities necessary for advanced development. This level of knowledge directly affects a developer’s research and design abilities, both horizontal and vertical. In my opinion, the following ** (advanced) iOS development ** section only examines the understanding of iOS itself (APIS, systems, development tools, etc.).
Some of my personal favorites are:
- What design patterns are practiced in the iOS SDK?
- What is your understanding of thread safety?
- What do you know about app crashes and how to block and resolve them?
- Which third-party frameworks have you seen and how are they designed?
- Can you tell me some refactoring tips? When do you think refactoring is appropriate?
- This question kills two birds with one stone. It not only examines the interviewers’ understanding of the general knowledge of design patterns, but also examines their familiarity and thinking degree with the iOS SDK. Here can be briefly mentioned: singleton: UIApplication; Observer mode: KVO; Class cluster: NSNumber; Decorator mode: classification; Command mode: NSInvocation; Enjoy element mode: UITableviewCell (reuse of UITableview). For more, you can check out the Book “The Tao of Objective-C Programming,” which describes many of the design patterns used in the iOS SDK.
- There is only one thread accessing at a time. However, if this definition is followed, then constants that cannot be changed are not considered thread-safe, so obviously this definition is wrong. So learning things to have critical thinking, especially when reading blogs, a lot of circumstances need to think about, take the initiative to authenticate, to think.
- There are many reasons why an app crashes, such as sending a method to an object that it cannot respond to, array out of bounds, adding nil objects to a collection class, string access out of bounds, KVO improperly removing associated keys (this is not the only reason KVO crashes), etc. Crashes are very disruptive to the user experience, so I think a senior iOS developer should have the ability to avoid them, or at least be aware of the scenarios that lead to them.
- Looking at some excellent open source framework code, combing the implementation ideas and details can help us improve the ability to design systems in similar scenarios. In fact, the truth is very simple, what is the way to learn to write a composition when I was young? – It’s just a recitation. Since writing is a kind of output, if you don’t have the accumulation of good words and sentences (input), naturally you can’t write a rich article. The same goes for writing code
- The ability to refactor is one of the abilities I value very much. In fact, I personally believe about refactoring technique which can learn early and writing the code “as possible behind one pace reachs the designated position. (if the scheduling permits), but also help improve the ability of design code: how to design a low coupling, high cohesion, easy extension, easy to modify the system? There is a book devoted to refactoring: Refactoring improves the Design of Existing Code.
Here are the questions I like to examine. Here are the questions I don’t:
- How do I query online crashes?
- Do you understand the release process? How many certificates are there?
- Have you ever done payment/map/share?
- What is a DYSM file and what does it do?
There are two reasons why I did not examine such questions:
- These questions fail to examine the basic qualities of a programmer because they are limited to iOS itself.
- This kind of problem is often “do it know”, there is no way to quantify ability. Encountered in the actual development has done; Even if you haven’t, I believe a good programmer will do it efficiently the first time.
You are advised to prepare data structure and algorithm questions
At the end of this article, we will talk about data structures and algorithms.
This type of question is something that big companies like to test, which means most companies don’t actually test it (but it’s a plus if you know it). However, I personally think that if time permits, it would be better to prepare some. In addition to the interview, the learning of algorithms is helpful to the improvement of programming ability, which I have deep experience:
In the process of preparing for the interview, the author drew some questions on LeetCode, among which there were about 30 questions about linked list, array and binary tree, and put these questions into the personal warehouse: awesome-algorithm-question-solution. Welcome to PR Swift, Java algorithm questions and answers ~
In the process of brushing questions and learning gradually can feel the understanding of the code to improve a lot, especially the list of questions can strengthen the understanding of pointer operation, and the execution of the condition of the inspection, the boundary problem processing ability has also improved some ~
Well, this set of questions to share here, in the article after also suggest that you usually pay attention to the learning of data structure and algorithm. As with the last post, this blog is a little more subjective, and I hope readers can communicate with me more
This post has been synchronized to personal blog: A set of advanced iOS interview questions
The author recently opened a personal public account, mainly to share programming, reading notes, thinking articles.
- Programming articles: a selection of my previous technical articles, as well as subsequent technical articles (mainly original), will gradually move away from iOS content and focus on improving programming capabilities.
- Reading notes: Share your reading notes on programming, thinking, psychology, and workplace books.
- Thinking articles: share my thoughts on technology and life.
Because there is a limit to the number of messages published on the official account every day, so far we have not published all the selected articles in the past on the official account, and will be published gradually in the future.
And because of the various limitations of the major blog platform, later will be published on the public account some short and concise, to see the big dry goods articles oh ~
Scan the qr code below and click follow, looking forward to growing together with you ~