This year has experienced several internship, school recruitment interview, for everyone who is looking for a job or has found a job, preparing for the interview questions is a chance to improve themselves. But fortunately, I encountered several interview questions are relatively simple, there is not too much to improve their content, and the spread of the interview questions on the Internet now seems to be nothing too new. So I decided to write my own interview questions, really difficult interview questions.

For me personally, I don’t like those who check can get answers to questions, such as how to use an API, or how to write a data structure, etc., because these topics are muscle memory, actually even if it’s good on behalf of the person ability is very strong, can only say that he do better preparation. The questions I put forward below are questions that require certain practice or certain experience to be solved smoothly. If these questions are so easy for you, it means that you have a certain breadth of knowledge and like to explore the questions in depth. Of course, if you feel that some problems are a little difficult, there is no great relationship, can say a general idea is OK, and then slowly explore the later is also a great improvement on their own.

Let’s have a look at my question.

Body of knowledge covered

  • The basics of UIKit
  • C++ and Interoperability with Objective-C (skip this for those of you who are not familiar with C++)
  • Program links and loading knowledge
  • Swift
  • Objective-C runtime
  • Computer Networking (Basic)
  • Operating System (Basic)

The interview questions

  1. Describe it in detailUIViewCALayerThe relationship between,drawRectDoes it necessarily affect performance?UI DynamicsUIKit AnimationWhat is the essential difference between?
  2. How to useUIImageViewDisplay super-high-resolution graphics? What if you want to support scaling?
  3. Know anything about Fishhook? Tell me why Fishhook can’t modify symbols in non-dynamically connected libraries.
  4. What is the difference between C++ calling virtual methods and Objective-C sending messages?
  5. Know placement New? How do you implement this in Objective-C?
  6. How to manage Objective-C objects in an ARC environment using C++ standard library containers?
  7. id,self,superHow are they grammatically different?
  8. What is ISA? Is pointing toClassA pointer to the object itself?
  9. Block modifies capture variables in addition to using__blockWhat else can you do? What are the limitations?
  10. NSDictionaryNSHashTableWhat’s the difference? What are their usage scenarios?
  11. Have you ever used Swift? How do you evaluate the String Index design?
  12. Suppose there is a TCP connection between the iPhone and the server, and the iPhone is suddenly disconnected, can the server notify the iPhone offline within a short period of time?
  13. Why cannot Wireshark capture raw SSL data directly?
  14. backtraceIs it implemented in user mode? Can you give us the general idea of how to do that?
  15. mallocWhat is the difference between an exception generated by a pointer double Free and an exception generated by accessing a FREED pointer? Why does accessing a FREED pointer not necessarily generate an exception?
  16. Is RunLoop an endless loop that never stops running? Why is that?
  17. Have you seen the runtime source code? Common in source codefastpath,slowpathWhat is?
  18. In the runtimeSideTables(notSideTable) What is the meaning of existence?
  19. Why are we not allowed to call in ARC[super dealloc]?
  20. How does Objective-C ensure ABI stability after a system is upgraded?
  21. What’s wrong with the following pseudocode? How can it be improved?
int main(int argc, const char * argv[]) { // ... NSUInteger threadCount = [NSProcessInfo processInfo].activeProcessorCount; NSCondition *cond = [NSCondition new]; for (int i = 0; i < threadCount; i++) { [NSThread detachNewThreadWithBlock:^{ while (YES) { [cond lock]; while (/* Queue is empty */) { [cond wait];  } // Dequeue an item. [cond unlock]; // Handle the item. } }]; } while (YES) { // Enqueue something when it comes. [cond broadcast]; } / /... } Duplicate codeCopy the code

Although only 21 problem, but the problem is many, many, in the future I may also write an article to solve all problems, of course I more hope that we can complete these problems by themselves, don’t try to search the answer directly, a lot of questions maybe haven’t found the answer, so their explore process must be indispensable, come on!