Recently, I went to several companies interview intended on just how to take a look at your own level, arrived at what level, what do I have to do in the next stage, and then in the process of talking to several interviewers, think about some problems, these problems is also I need to pay attention to the next stage, you want to see the article, these problems can give you a little inspiration.


1. What is the difference between Swift and Objective-C?

It’s a very simple question it’s a very simple question, but the point is not the question itself, but the interviewer actually said that when you’re programming with Swift, you can’t use Swift in objective-C, you need to know what the features of Swift are, not just for OC, It’s a feature of the language itself. Indeed, after listening to this answer, I was really shocked because I used it in objective-C way and ignored the unique features of the language!!

I’ve taken a few features from Swift’s official website:

- Closures unified with function pointers
- Tuples and multiple return values
- Generics
- Fast and concise iteration over a range or collection
- Structs that support methods, extensions, and protocols
- Functional programming patterns, e.g., map and filter
- Native error handling using try / catch / throw
Copy the code

In fact, in the use of SWIFT, if you really want to use it well, you have to think about the characteristics of SWIFT in the process of using, have you used these characteristics, if you do not use, then you and make OC is different? This is something I need to think about, and I hope you can think about it too

I feel there are two ways to take full advantage of Swift’s features: first, its syntactic features (as described above: closures; A tuple; Rapid iteration; Structures that support methods, extensions, and protocols; Functional programming; Native error handling); Then what is the use of the programming thought, Swift, the core of the programming thought, I think there are two is a functional programming thought, is a protocol oriented programming ideas, and of course, a kind of thought is AOP (aspect oriented programming), and of course there are many other thoughts, but I know these three should be one of the most common, want to me, And I want you to think, when you’re using Swift, are you using these Swift features? Have you used these programming ideas? If you don’t consider these things, it’s time to self-censor

2. In each scenario, be sure to consider whether your algorithm is optimal. Is there a better solution?

Indeed, many times, when considering solutions, even basic business logic, the same problem, there must be a better solution! But at present, I do not think about better algorithms to solve problems, but in most cases, I use very basic process-oriented programming thinking, which is not desirable or correct.

Then I may have to spend time to study the algorithm carefully in the next stage. Isn’t algorithm itself a basic skill that programmers must master?

3. Speaking of componentization methods, you mentioned the idea of implementing iOS project componentization through routing, protocol, target-action, etc., talk about them?

Of course, this is a question THAT I deal with abstractly, but actually, what did the interviewer actually say?

You say you know the three ways. You think the target-action way is the best. What about the other two ways? Have you used it? They must be built to solve some problem, and how can you know which solution to use in a particular situation without knowing enough about it?Copy the code

Each approach has its own benefits, and it does not mean that one approach is optimal. Based on this problem, there are a lot of knowledge points that can be derived, so I hope we can all study the architecture and write code with low coupling and high cohesion.

4. About the architecture of the project, what are MVP,MVVM and MVC respectively and what are their advantages?

Different software architectures are tailored to different projects, and no architecture is perfect. When we get used to the ARCHITECTURE of MVVM, is it necessarily the best? What are you using it for? Are you making full use of MVVM, or are you just using a simple folder hierarchy? MVC has its drawbacks, but do you really understand the architecture of MVC well enough?

5. Know why and know why, SDWebImage library, have you read the source code, when you use it, its process you can say, but each asynchronous download picture frame is this process ah, where are its advantages? How does it compare to other frameworks?

Ah, don’t ask don’t know, ask to feel very dish, in the process of using the third party library didn’t go to carefully think about these problems, so how can you improve? It seems that the use of third-party libraries, to look at the source is also a very worthwhile thing to do ah!

6. Go home and wait for news.

This is also a very deep topic, and there is a lot to talk about if we expand on it…