Current location - Education and Training Encyclopedia - Resume - Python back-end development engineer interview
Python back-end development engineer interview
Step 1: Introduce yourself.

Step 2: Company introduction

Step 3: Technical Foundation

Step 4: Project Introduction

treat

Introduce yourself, simple and direct, name, native place, university, work experience.

Examples are as follows:

Interviewer: Hello, my name is XX, and I'm from XX. I graduated from XX, with a bachelor's degree, majoring in XX, and have X years of working experience. I worked as a python back-end development engineer in my last company.

The company name is XX. The company specializes in outsourcing software, including software customization/mall customization, 2 front-end and 2 back-end operation and maintenance 1.

Mainly based on the skills filled in your resume and the contents written on my resume, I can sum up the following points:

The query process of the dictionary:

Immutable objects can be hashed, str, fronzenset, tuple, and self-implemented classes, and the __hash__ method should be overloaded.

Dict consumes a lot of memory, but the query speed is fast. Custom objects or objects inside python are wrapped in dict.

The storage order of dict is related to the addition order of elements, which may change the order of existing data.

Set: A variable unordered mapping set that can store any data type.

Set is similar to dict, and the core of set is also a hash table, but the table element only contains references to values. Because of the characteristics of hash table, the elements of set cannot be repeated and out of order. Hash is used internally, and the time complexity of search is O( 1), so the performance is very high. The magical function __contains__ has been realized and can be searched in in. The deduplication of set is realized by two functions __hash__ and __eq__.

(1) shallow replication

Definition: A shallow copy is just a copy of the memory address of another variable, pointing to the variable value of the same memory address.

Functions of shallow copy:

(2) Deep replication:

Definition: Copy the value of one variable to another.

The function of deep copy:

Python GC mainly uses reference counting to track and recycle garbage. On the basis of reference counting, the possible circular reference problem of container objects is solved by "marking and cleaning", and the garbage collection efficiency is improved by "generation collection on".

The full name of GIL is global interpreter lock, which is interpreted as global interpreter lock in Chinese. It is not a feature of python, but a concept introduced in the implementation of the mainstream Cpython interpreter in Python. GIL is essentially a mutex, which turns concurrent operations into serial operations, thus controlling that shared data can only be modified by one task at the same time and ensuring data security.

GIL protects interpreter level data, but users need to lock their own data.

Because of the existence of GIL, only one thread can be executed in a process at the same time, and the multi-core mechanism of cpu cannot be used, resulting in multi-thread being used for I/O-intensive and multi-process being used for calculation-intensive, such as financial analysis.

Deadlock: A phenomenon in which two or more processes or threads wait for each other for resources during execution. Unless there is an external force, they will always be blocked. These waiting processes or threads are called deadlocks.

The solution is to use recursive locks (RLock)

There is a lock and a counter variable in this RLock, and the counter records the times of acquisition, so that resources can be acquired multiple times. Until all the gains of one thread are released, other threads can get resources. If the above example uses RLock instead of Lock, deadlock will not occur.

It can be directly thought of as linux, after all, most people in the back end deal with linux.

So how to avoid the problem of package sticking? In the final analysis, it is a word that defines the boundary between two packages.

There is no packet sticking problem in UDP, because UDP is not optimized by Negal algorithm when it is sent, and multiple packets will not be sent at one time. In addition, at the receiving end of UDP protocol, the chain structure is used to record every arriving UDP packet, so that the receiving application can only receive one packet from the socket receiving buffer at a time. In other words, the sender has sent several times, and the receiver must receive several times (no matter how large the buffer is specified when recv).

Storage may include rdbms, nosql and cache. I take MySQL and Redis as examples * *