Python Interview Summary

Source: Internet
Author: User

Gold * Python Development engineer:

1. String connection + and join differences:

This paper mainly investigates two ways of memory management:

The string object is immutable, and after Python creates a string, you cannot change a part of the character. any operation on the string includes the ' + ' operator, each time ' + ' connection will request a memory space, create a new string object to deposit, instead of changing the original object.

join ([]), using the list concatenation, the list can be changed, so use ". Join ([]) concatenated into a string, requested a memory space, built once, save a lot of resources and time.

Note: The string immutable phenomenon is also a workaround, you can use the _strlist=list (str) This built-in function to change the STR to a single character as a member of the list, so that can be used _strlist[3]= ' A ' change the value and then use '. Join (_strlist) to revert to a string.



2. How to determine if an SQL query hits a defined index:



3. Differences between InnoDB and Myiasm engines (main question index):

The data structures are all B+tree

MYIASM, the content stored in theb+tree data structure is the address value of the information, that is, the index is separate from the actual data, and the index is used to point to the data, which is called a nonclustered index .

Innodb, the actual data stored in the b+tree data structure is called a clustered index .

The fundamental difference between clustered and nonclustered indexes is that table records are arranged in the same order as the index, and the order of the clustered Index table records is the same as the order in which the indexes are arranged. The insertion is slower than the nonclustered index and the query is faster;

4. The implementation of the adorner:


5. Ask Docker, no understanding, no answer.


6.contentmanger


Bean * Python Development engineer:

    1. Specifies the number of the oldest string in a string that is equal to numbers.

Def get_str (s, n):    i = n    _start =  0    _list =[]    while true:         if i <= len (s)  and _start <= len (s):             _str = len (Set (S[_START:I))              if _str == n:                 _list.append (S[_start:i])                  i += 1             elif _str < n:                 i += 1             else:                 _start += 1                 i = _start + n         else:            break     _list = sorted (_list, key=lambda x:len (x))      RETURN&NBSP;_LIST[-1]


    1. function implementation? , * wildcard characters.

    2. design article, user recommendation Information table structure:

      i. Write out an article all the recommended user SQL query statements.

      ii. Write down all the recommendations of a user and sort the statements in reverse chronological order.

      III. Delete the content of the conspiracy and related recommendations.










Python Interview Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.