Hello, are you the one who came for the interview yesterday? These questions are mainly to test your familiarity with the language and framework, and they need to be accumulated slowly. Even if you understand these questions through here, there will definitely be other different questions in the next interview. I suggest you pay more attention to your daily accumulation. The fact that you can remember so many interview questions shows that you are quite smart. I see that there is a lot of content in your blog. I think it will be greatly improved if you review all the content of your blog.
First of all, it is recommended that you use a search engine to solve the problem before asking a question. If you really can't solve it, ask again.
Secondly, don’t ask multiple questions together, otherwise no one will be willing to answer.
Let me answer the first question simply: all variables (including function parameters) in Python are references to objects, strings are immutable objects, and lists are mutable objects, which means that string parameters are modified within the function body. , will not affect the outside of the function, but modifications to the list parameters may affect the outside of the function.
What is the difference between string and list in the parameters passed by the function? What about modifications?
Strings are immutable and cannot be modified. Modifications to list elements are propagated to the caller.
How to write views using classes in Django? What is the difference between it and function writing view?
Overloading__call__method makes a class callable. The types are different but there is no difference in usage
There are two tables in Django’s module. A is related to the external structure of table b. How can I delete table a without affecting table b?
Add a media table, and two foreign keys point to a和b,删除a和没媒介表不影响b respectively.
Tornado asynchronous, how is it implemented?
The bottom layer of OS provides an asynchronous IO interface, which is not a commonly used synchronous interface. Using a synchronous interface to achieve asynchronous implementation is impossible to achieve anyway.
What’s wrong with multi-threading?
There are two aspects (1) Concurrency model (2) How to avoid deadlock. See Wikipedia for details.
The difference between the init method and the new method in the class
new返回分配的空间。initCall on allocated space.
Describe the singleton pattern
https://zh.wikipedia.org/wiki...
Garbage collection mechanism in Python
Python’s GC is not generational like Java, but reference counting. GC is just one application layer of reference counting, and there is a lot of information on it.
Hello, are you the one who came for the interview yesterday? These questions are mainly to test your familiarity with the language and framework, and they need to be accumulated slowly. Even if you understand these questions through here, there will definitely be other different questions in the next interview. I suggest you pay more attention to your daily accumulation. The fact that you can remember so many interview questions shows that you are quite smart. I see that there is a lot of content in your blog. I think it will be greatly improved if you review all the content of your blog.
First of all, it is recommended that you use a search engine to solve the problem before asking a question. If you really can't solve it, ask again.
Secondly, don’t ask multiple questions together, otherwise no one will be willing to answer.
Let me answer the first question simply: all variables (including function parameters) in Python are references to objects, strings are immutable objects, and lists are mutable objects, which means that string parameters are modified within the function body. , will not affect the outside of the function, but modifications to the list parameters may affect the outside of the function.
Strings are immutable and cannot be modified. Modifications to list elements are propagated to the caller.
Overloading
__call__
method makes a class callable. The types are different but there is no difference in usageAdd a media table, and two foreign keys point to
a
和b
,删除a
和没媒介表不影响b
respectively.The bottom layer of OS provides an asynchronous IO interface, which is not a commonly used synchronous interface. Using a synchronous interface to achieve asynchronous implementation is impossible to achieve anyway.
There are two aspects (1) Concurrency model (2) How to avoid deadlock. See Wikipedia for details.
new
返回分配的空间。init
Call on allocated space.https://zh.wikipedia.org/wiki...
Python’s GC is not generational like Java, but reference counting. GC is just one application layer of reference counting, and there is a lot of information on it.