Abstract

Mainly the iOS interview records of “Jinsan Yinsi” in 2021.

Almost mandatory: the project situation, not described below.

Meituan

  • What are the application scenarios of message forwarding?
  • Weak vs. ASign
  • How does a block hold a variable? What’s the difference between stack objects and static variables?
  • What is the difference between RTMP and RTC?
  • What does the App cold start process involve?
  • HTTPS 4 handshakes.
  • The difference between processes and threads.
  • What design patterns have you used?
  • Advantages and disadvantages of MVVM.
  • How does Swift constrain a subclass to comply with a protocol?

Algorithm:

  • Find the nearest public parent of 2 views.
  • In a one-way linked list, delete the target node. (Linked list operation, pay attention to special cases)

byte

One side

  • Encountered one of the most technically difficult problems.

  • What are the scenarios for memory leaks?

  • Multithreading problem, what does it print?

    { / / main thread
        NSLog(@ "1");
        dispatch_async(other_thread, ^{
            NSLog(@ "2");
        });
        dispatch_sync(other_thread, ^{
            NSLog(@ "3");
        });
        dispatch_async(dispatch_get_main(), ^{
            NSLog(@ "4");
        });
        NSLog(5 "@");
    }
    Copy the code

Coding implementation: window child view dyeing, different layers of different colors.

Second interview

  • The relation between virtual memory and physical memory, what is the virtual memory of iOS?
  • App cold startup process.
  • Event response chain hitTest.
  • What if I put a gesture on UIButton? (Difference between UIGesture and UIControl)
  • HTTPS 4 handshake process.
  • Disconnection with TCP in various scenarios (that is, to determine when disconnection is really happening).

Algorithm: Print an array of rings.

Leader face

Mainly the project situation, computer basis.

  • The underlying implementation of hash tables.
  • The difference between arrays and linked lists.
  • HTTPS 4 handshakes.
  • What is an HTTPS man-in-the-middle attack and how can it be prevented?
  • What is different about HTTP 2.0?
  • How do I optimize network requests?
  • The implementation of live push and pull flow scheme, relevant protocols are not understood.
  • When does a block copy?

Algorithm to determine whether a tree is a balanced binary tree.

HR side

  • What was your biggest growth in your last company?
  • Why do you want to change jobs?
  • Career planning.
  • Last year’s performance and existing offers.
  • How you feel about the first few rounds of interviews, how you rate your interview.
  • Is there anything you think you did well that the interviewer didn’t ask you in the first few rounds?

taobao

One side

  • Weak implementation principle.
  • How do we monitor Caton? What are the options?
  • Something that I personally find challenging.
  • Advantages and disadvantages of SVGA versus Lottie.
  • What is career planning?
  • What performance indicators will you focus on?
  • What is the process of App startup?

Algorithm problem

  1. Recursion realizes palindrome judgment.
  2. Implement a similar NSCache LRU cache class, you can set the upper limit of the number of cache, when the upper limit is reached, you can replace objects according to THE LRU rules, must be thread safety, when the memory alarm can automatically empty the cache.

Second interview

Look at projects and computer basics (operating systems, networks, algorithms), ask what you’re good at, and then ask specific questions.

Interviewers are more likely to focus on fundamentals and potential.

  • Share the most technical in-depth cases.
  • After working on iOS for so long, what do you think you are good at?
  • Open question: If there are two methods, how to lock, can cause deadlock?
  • How is RunLoop implemented? In particular, how do you wake up a thread? What primitives do you use? Operating system (OS)
  • In business development, what kind of statistics, technical indicators will be paid attention to, how will record?
  • It was urgent to change jobs at the previous company. Have you considered what to do if you continue to stay there? Has anything been tried?
  • Career planning.

Algorithm problem

  1. Offer 42. Maximum sum of contiguous subarrays – LeetCode
  2. Find the nearest common ancestor of a balanced binary tree.

Leader face

  • What would you like to grow in this company? Make a list of 3 points. How about the comparison before and after?
  • Have you ever known about the plan to count online code usage frequency? (Clang piling)
  • Componentalization is only one of the solutions to parallel development. Have you learned about further optimization, such as how to manage multiple warehouses and package them?
  • What will you do if you fail in the interview?
  • Why did you get this performance last year?
  • What are your strengths?
  • Career planning.
  • What are you studying in the last year or two? Is it used at work?

Sina weibo

One side

  • A case study of the state of the art.

  • I want to print something in viewDidAppear of VC_A, but do nothing to other VC’s. How can I do that? (Runtime related knowledge points)

  • To hook a method of a parent class, what do I do?

  • How to solve the lag problem of sliding list?

  • Multithreading problem, what does the following code print?

    dispatch_sync(dispatch_get_main() ^{
        NSLog(@ "1");
    })
    NSLog(@ "2");
    Copy the code
  • How is KVO implemented?

  • What is the download process of SDWebImage?

  • Event transfer chain, response chain.

  • How can a label respond to an event and its parent view respond to it?

Second interview

  • Give an example of a difficult business requirement. How is it designed? What are the classes?
  • Lottie versus SVGA.
  • How to optimize the network? What can be optimized from?

Well quickly

One side

  • How to set automatic calculation height in TableView?

  • How is the ObjC Protocol property implemented?

  • What’s wrong with KVO, and how exactly is it implemented?

  • What’s wrong with @synchronized(self) {}?

  • What are the options for optimizing the caton in TableView?

  • Multithreading problems, coding implementations, need to ensure that tasks are executed in the following order:

    A,B -> C, B,D -> F, C,F -> K

Algorithm: singly linked lists find rings.

Second interview

  • A very impressive question.
  • How does RunLoop hibernate a thread?
  • What about self? For example, subclasses call alloc init, which is not implemented, but it can be created normally.

CollectionView Waterfall implementation logic.

Leader face

  • HTTPS handshake process?
  • TCP is different from UDP.
  • WebRTC is P2P, how to achieve multi-party voice?
  • Byte streams are different from data packets because they are binary streams at the network layer.

B station

There are many omissions in the records.

One, two

In addition to the project situation, there are some common iOS issues.

Algorithm: string deduplication.

Leader face

What have you accumulated in your last company?

HR side

  • Share work experience.
  • Personal learning methods.
  • What do you know about station B?
  • Some information about existing offers.
  • How would your colleagues, friends, or superiors describe you?

Netease – Yi Yuan

In addition to some common iOS issues, there are a few others:

  1. What is a Framework hard link?
  2. Whether static functions can be hooked (they are not messaged, so they cannot be exchanged)
  3. Render logic, why can only render UI in the main thread.
  4. GET is different from POST.
  5. HTTP is different from HTTPS.
  6. How do I speed limit HTTP Requests?
  7. What is the principle of rich text rendering YYKit?
  8. Which WebView property does a native listening JS request listen on?

tencent

Focus on technical basis.

The algorithm,

  1. Integer 0, 1, 2, there is a certain number, design a sorting algorithm, time complexity O(n), space complexity O(1).
  2. Enter a string with parentheses. The left and right pairs are valid. How to determine the validity?
  3. Following problem 2, find the maximum length of a valid substring.
  4. Find the integer part of the square root of a non-negative integer.

Second, the network

  • What is the TCP sliding window? How is congestion control implemented?
  • How does a request from a client reach the server? What is the overall process?

Third, design mode

What design patterns are commonly used? Can you tell me more about it?

BIGO

One side

  • Will vc.view subviews be removed after didDisappear?

Coding problem: Sort a large number of images by resolution size (note the IO bottleneck).

Second interview

Algorithm:

  • Single linked list inversion variant
  • The Hannotta problem leads to the general term formula

Enterprise WeChat

  • How does ObjC implement object orientation?
  • Does componentization have its own thinking?

Algorithm: Implement LFU cache logic.

Tiger tooth

  • Memory management, reference counting, when objects are destroyed?

  • Is SVGA rendering CPU or GPU?

  • What method of OBJ does NSArray containsObject call?

  • Dictionaries versus arrays.

  • Is there any Runtime interface that can tell if a module is referenced or not? Or do you know the proportions?

  • Multithreading problem

    • What locks do iOS use?
    • Is there no problem with recursive calls like @synchronized{}?
    • Understanding spin locks
    • How to limit the maximum number of concurrent requests using GCD?

Momo

One side

Most of the problems are project-related and scheme design.

  1. Event response chain.
  2. How to get a list of class methods (note where it is saved).
  3. Picture cache scheme design, can use NSCache.
  4. How is routing design implemented?
  5. On the reverse side, how do you defend a method?
  6. Common memory leaks.
  7. What have you done with Runtime methods?

Second interview

  • What is the technical problem you think you solved?

Algorithm:

  • 2G positive integers, how to find in small devices with easy memory comparison (integer bitmap algorithm)
  • Addition of large Numbers

Leader face

  • Know your resume.
  • In terms of projects, list 2 experiences with technical depth.

Leader face

  • Let’s take an example with technical depth.
  • What’s special about Swift versus ObjC?
  • What in-depth research has been done on new technologies emerging in the past two years?
  • Common architectural comparisons.

Cool dog music

One side

  • A little bit about ARC.
  • When do memory leaks occur?
  • Is there any way to avoid circular references caused by timers?
  • Some memory problems encountered daily
  • App startup optimization ideas.
  • Classification how to add attributes.
  • What are the considerations of singleton implementation?

Leader face

  • To the block, the delegate, kvo, notification of usage

Algorithm:

  • Given an array of integers and an object value, determine whether the sum of two numbers in the array equals the object value

Cross the interview

  • How would you do a code scan?
  • How to learn new skills? IOS14 is out. What are you looking at?
  • Theos principle
  • HTTP is different from HTTPS
  • TCP is different from UDP
  • Swift vs. ObjC

YY live

One, two

  • Memory allocation issues, what’s on the stack and what’s on the heap.
  • Block modifies variables with __block. How does this work internally?
  • How does weak work?
  • RunLoop process.
  • How is the event delivered after the click?
  • How a view is rendered to the screen.
  • Talk about understanding the observer model.
  • Several kinds of timer realization?
  • Look directly at the online crash to find the cause.

Leader face

In terms of the event response chain, how would you implement the hitTest method?

summary

Record of high frequency problems:

The main test points are the project, iOS related technology, computer foundation, personal feelings:

  1. ObjC doesn’t weigh much.
  2. The proportion of algorithms has increased, but they are mainly simple and medium difficulty in Leetcode.
  3. Computer basic compulsory examination.
  4. On the project, it is better to have cases that reflect technical depth and performance optimization examples.
  5. Familiarize yourself with all of the projects on your resume, even if they are older projects.