1. Differences between classes and objects
A class is an abstraction of an object that is a concrete instance of a class.
Classes are abstract, do not occupy memory, and objects are specific and occupy memory space.
For example: The class is the fruit, the object is Apple.
2.SSL Handshake Process
- The client sends a ClientHello message to the server stating the maximum TLS protocol version it supports, the number of random numbers, the list of cryptographic algorithms, and the compression method.
- The server replies to the Serverhello message, which contains the TLS protocol version, the random number, the cipher algorithm list, and the compression method based on the client ClientHello message. The protocol version selected by the server is the highest version supported by both the client and the server.
- When both parties know the connection parameters, the server sends a certificate to the client.
- The client verifies the legality of the server certificate, including whether the server certificate expires, the CA that issued the server certificate is reliable, whether the public key of the issuing CA correctly unlocks the digital signature of the issuing CA for the server certificate, whether the domain name on the server certificate matches the actual domain name of the server. If the legitimacy verification is not passed, the communication will be disconnected, and if the legitimacy validation passes, the 5th step will continue.
- The client randomly generates a "symmetric password" for subsequent communication, encrypts it with the server's public key (obtained from the server certificate in step 3), and then passes the encrypted "pre-master password" to the server.
- If the server requires authentication from the client (optional during the handshake), the client can establish a random number and then sign the data to the server with the random number that contains the signature, along with the client's own certificate and the encrypted "pre-master password".
- If the server requires client authentication, the server must verify the legitimacy of the client certificate and the signature random number, including: Whether the client certificate expires, whether the CA that issued the client certificate is reliable, the public key of the issuing CA can correctly unlock the digital signature of the issuing CA for the client certificate, Check that the client certificate is in the certificate revocation list (CRL). If the legitimacy verification is not passed, the communication is interrupted immediately; if legitimacy is verified, the server will use its own private key to unlock the encrypted "Pre-master password" and then perform a series of steps to generate the primary communication password (the client will also generate the same master communication password in the same way).
- The server and client use the same master password as the "Call password", a symmetric key for the SSL protocol of Secure data communication encryption and decryption communication. At the same time in the process of SSL communication to complete the integrity of data communication, to prevent any changes in data communication.
- The client sends a message to the server indicating that subsequent data traffic will use the master password in step 8 as the symmetric key, and notifies the server client that the handshake process is complete.
- The server sends a message to the client indicating that subsequent data traffic will use the master password in step 8 as the symmetric key, and notifies the client server that the handshake process is complete.
- The SSL handshake part ends, the SSL secure channel data communication begins, the client and the server begin to use the same symmetric key for data communication, while the integrity of the communication test.
3. Heap and Stack differences
One, stack space allocation difference:
1, stack (operating system): automatically allocated by the operating system release, storage function parameter value, local variable value and so on. It works like a stack in a data structure;
2, Heap (operating system): Generally by the programmer assigned to release, if the programmer does not release, the end of the program may be recycled by the OS, distribution is similar to the list.
Second, the stack cache mode difference:
1, the stack uses a first-level cache, they are usually transferred in the storage space, the call is finished immediately released;
2, the heap is stored in the level two cache, the life cycle is determined by the garbage collection algorithm of the virtual machine (not once orphaned objects can be recycled). So the speed of calling these objects is relatively low.
Third, the stack data structure difference:
Heap (data structure): Heaps can be thought of as a tree, such as: heap sort. FIFO (Fifo-first in first out);
Stack (data structure): An advanced post-out data structure.
4.ios9 new Features
- Nonnull: Indicates that cannot be empty
- Generics: Specifying the class to get
- __KINDOF: Typically used in the return value of a method, representing the current class or subclass
- Https
5. How to override class methods
- 1. Implement a static method with the same name as the base class in the subclass
- 2. Do not invoke the class name at the time of invocation, but instead use the [Self class] method. Principle, calling with the class name is early binding, binding at compile time, using [self class] is late binding, deciding which method to invoke at run time.
Follow-up need to summarize iOS core framework
- Coreanimation
- Coregraphics
- Corelocation
- Avfoundation
- Foundation
iOS core mechanism
- UITableView Reuse
- OBJC memory management; auto-release pool, how arc is implemented
- Runloop
- Runtime
- Block definition, characteristics, memory area, how to implement
- Responder Chain
- Nsoperation
- GCD
Data
- 8 Large sorting algorithms
- Binary Tree Implementation
- Two-point lookup implementation
Object-Oriented Programming
Encapsulation, inheritance, polymorphism
6 Principles of Design patterns
Design the function of a class, how to divide granularity (single duty)
Interface isolation.
If there is a bird, there is the movement of the fly, an ostrich to inherit it is appropriate (Richter replacement)
How dependencies between classes depend on the least degree of coupling (dependency reversal)
High-level dependence on the lower level, low levels can not rely on. Depends on the interface and cannot depend on the specific class.
If a is to call the C function, but C is the member class of B, how should it be designed? (Dimitri)
How to design the class, can do only add code, without modifying the code, what experience (open closed)
Solved by design mode.
Computer
- Computer networks: TCP/IP, HTTPCDN, SPDY
- Computer security: RSA, AES, DES
- Operating systems: threads, processes, stacks, deadlocks, scheduling algorithms
New features and Technologies for iOS
- IOS7 uidynamic, Spritkit, new layout, flattening
- IOS8 application extensions, HealthKit, SceneKit, Corelocation, TouchID, Photokit
- IOS9
- Apple Watch
- Third party libraries: Sdwebimage, Afnetwork, Jsonkit, Wax
- Swift
Some of the conceptual facets of IOS questions