2019 Jingdong PHP parsing engineers face questions and answers

First, multiple choice (a total of 28 questions, each question 5 minutes)

1.Apache and performance Nginx great access description is correct?

A, epoll network I / O model is used very efficiently Apache

B, Nginx uses the latest kqueue and select the network I / O model

C, Apache process executes PHP, HTML output had to do, occupied more resources

D, nginx can not do reverse proxy server

Reference answer: C

Answer Analysis: 1, Apache used select network I / O model is very inefficient 2, Nginx uses the latest epoll (Linux 2.6 kernel) and kqueue (freebsd) network I / O model 3, Apache process of doing many things: execute PHP, HTML output all the work, the more resources consumed (CPU, memory)

 

2. Which of the following operating modes no longer support PHP after PHP5.3?

A、CGI

B、FASTCIG

C, COUNT

D、CLI

Reference answer: C

Answer Analysis: After PHP5.3, PHP is no longer ISAPI mode, after installation no longer have php5isapi.dll this document. To use the IIS6 high version of PHP, you must install the FastCGI extension, then the IIS6 support FastCGI.

3.yii widgets description of the error is?

A, widget object-oriented way to view code reuse

B, still need to follow the MVC mode to create widgets, the widget usually based logic code, display content in the view

C, small parts should be designed not independent, that is to say, when using a widget, it can not be discarded directly without the need for additional processing

D, when small parts need external resources such as CSS, JavaScript and other picture would be more difficult fortunate when Yii provides resource pack to solve this problem.

Reference answer: C

Answer Analysis: small parts should be designed to be independent, that is to say the use of a widget, they can discard it directly without the need for additional processing.

(Join the group 677 079 770 for more answers to interview questions.)

4. The following statement regarding structural model is wrong?

A, the structural model may not destroy the basis of the type of packaging, implement new features

B, structural model used to create a set of objects is mainly

C, structural model to create a unified interface to access a set of classes

D, the structural model may not destroy the basis of the type of packaging, so that the same class can never interact with the system to estimate

Answers: B

Answer Analysis: structure-type (Structural): a combination of processing between classes or objects.

 

5 is a PHP magic method is?

A、__function

B, __ to

C、__line

D、__invoke

Reference answer: D

答案解析:__construct __destruct __call __callStatic __get __set __isset __clone __unset __sleep __wakeup __toString __invoke __set_state

 

The role of 6.substr function is?

A, search string

B, replacement string

C, string interception

D, the length of the intercept

Reference answer: C

Answer Analysis: interception of the string part of the string.

(Join the group 677 079 770 for more answers to interview questions.)

7. Which of the following database products is the use of pureXML data server technology:

A、SQL Server

B、DB2

C、MySQL

D、JSON

Answers: B

Answer Analysis: No

 

8. As an administrator, you want to decentralization in every new user a directory file .bashrc, then you should place the file in which directory to create automatically copy the files to the new user's home directory own directory .

A、/etc/skel/

B、/etc/default/

C、/etc/defaults/

D、/etc/profile.d/

Answers: A

Answer Analysis: / etc / skel / directory is used to store the new user profile directory files when we add a new user when all files in this directory are automatically copied to the newly added user's home directory. All files in this directory are hidden files (beginning with Point file).

 

9. In MySQL, can be used to create a new database of SQL statement ()

A、CREATE DATABASE

B、CREATE TABLE

C、CREATE DATABASES

D、CREATE DB

Answers: A

Answer Analysis:

A correct option, create a library statement: CREATE DATABASE database name.

B option CREATE TABLE, is to create a table of the statement.

C and D option syntax error.

 

10. With regard to determine the file type, the following statements is correct?

A, according to the file extension can correctly determine the type of file

B, according to the characteristic value based on the file type of the file correctly

C, and the characteristic values ​​according to the size of the file based on the file type correctly

D, can not be 100% certain file types by any method

Reference answer: D

Answer Analysis: can fake any way, so we can only infinitely close by method, but can not fully guarantee the right judgment.

 

11. Establish a composite index a_b_c in mysql with a, b, c three fields, may I ask which of the following query efficiency worst?

A、select * from test where a=10 and b>50

B、select * from test where a=10 and b>10 order by c

C、select * from test where a=10 and b=10 order by a

D、select * from test where a=10 and b = 10 order by c

Answers: B

Answer Analysis: leftmost matching principle: the composite index contains a, a_b, a_b_c. When the composite index only in the front of the field for the precise inquiry, will spend a composite index behind, in the event inaccurate query will not use the composite index. A options, use a_b index. B options, use the a_b index, and there is order by c it is the worst efficiency. C option, using a_b index. D options, use a_b_c index.

 

12. constraints on PHP array key and value, the statement is correct?

A, key only int or string type, value can be made of any type

B, key may be any type, value can be any type

C, key can be of any type, value can only be int or string type

D, key only int or string type, value can be a string type or int

Answers: A

Answer Analysis: key can only be int or string type, value can make any type ..

(Join the group 677 079 770 for more answers to interview questions.)

13. The following code has loopholes?

 

 

 

A, no loopholes

B, with appropriate server rules to delete all files

C, appropriate rules can be obtained by any of the contents of the file you want

D, with appropriate rules can change the administrator password

Reference answer: C

Answer Analysis: If we submit demo.php dir = | cat / etc / passwd you can get all the administrator account information on the server?.

 

14. The following shell code description is correct?

read -p "please input ip:" IPping $IP -w &> /dev/null && echo $IP is up || echo $IP is down

A, checks the local ip

B, find ip access the server

C, find access files via ip

D, determining whether the shutdown by entering the IP host

Reference answer: D

Answer Analysis: read -p "please input ip:" IP prompts you to enter judgment ip ping $ IP -w host &> / dev / null && echo $ IP is up || echo $ IP is down: ping to determine whether the ip It has been shut down.

 

15. Which of the following model is the use of an object, quickly generate a number of objects?

A, abstract factory (Abstract Factory) mode

B, Synthesis of (Composite) mode

C, prototype (the Prototype) mode

D, Bridge (Bridge) mode

Reference answer: C

Answer Analysis: prototype model: the use of a prototype examples to "clone" to create a new object.

 

16. One Chinese characters stored inside the computer code is?

A, area code

B, GB code

C, machine code

D, machine code

Reference answer: C

Answer Analysis: the machine code is stored inside a Chinese character computer code.

 

17. Which is not what PHP mode of operation?

A、CGI

B、FastCGI

C、apache2handler

D、apache

Reference answer: D. Answer Analysis: The first three are commonly used mode of operation, apache web server software.

 

18. With regard to PHP mode modifier statement is wrong?

A, i case-insensitive match

B, m ^ beginning of the string will only match

C, x blank and # comments will be ignored

D, and the replacement string as php execution code evaluator

Answers: B

Answer Analysis: m is an enhanced line anchor mode, the front and rear \\ n will be considered as the beginning and end.

 

19. singled out a unique command

A: vi

B、vim

C、ll

D、nano

Reference answer: C

Answer Analysis: vi, vim and nano are editor for editing documents, and ll are files in the directory display.

 

20. Which of the following is not a function of PHP file pointer operation?

A、ftell()

B、fseek()

C、file()

D、feof()

Reference answer: C

Answer Analysis: ftell () returns the file pointer position fseek () locate the file pointer feof () tests whether the file pointer at the end.

 

21. With regard to errors php configuration options are

A, open short_open_tag allows the use of PHP code begins the short form (<??>)

B, if the magic_quotes_runtime enabled, most functions return any form of external data, including databases and text segments will escape quotes with a backslash

C, because of the configuration options can be set using ini_set at runtime, so you can always turn on display_errors

D, PHP safe mode is an attempt to solve the shared server (shared-server) and the establishment of security issues

Reference answer: C

Answer Analysis: Although the display \ _errors also be set (using ini \ _set ()) at runtime, but the script appears set any run-time when a fatal error are invalid. Because the operation is expected to run it will not be executed in this case. This will expose sensitive information.

 

Different title elements 22 6.3 push sequentially with () different Stack Sequence

A、A、4

B、B、5

C、C、6

D、D、7

Answers: B

Answer Analysis: for n different elements into the stack, the stack number of the sequence is 6 \ 5 * \ * 4/4 \ 3 * \ * 2 \ 1 * 5, i.e. the number of Cattleya.

 

23. Compared with the HTTP1.0, the advantage of not including HTTP1.1 ()

A, reducing the number of RTTs   

B, supports persistent connections 

C, reducing the number of TCP slow start   

D, improves security

Reference answer: D

Answer Analysis: HTTP 1.1 HTTP1.0 optimized disadvantages, which can support the persistent connection, the TCP connection may transmit a plurality of HTTP requests and responses, reducing consumption and closing a connection establishment delay and a reduction of the number of TCP slow start while allowing the client without a request to wait for the results returned, you can issue the next request, reducing the number of time RTTs and download process required, HTTP 1.1 also provides information on the identity, status management and cache caching mechanism request headers and response headers. However, the characteristics of safety performance is not HTTP1.1, but using HTTPS HTTP address security issues, namely secure hypertext transfer protocol (SHTTP).

 

24. The following related kernel threads and user threads statement is wrong?

A, user thread because <br> I / O is in a wait state, the whole process will be handed the opportunity to wait for the state, not the other threads running dispatchers

B, Effect kernel thread in kernel mode only, not the user mode context

C, the user kernel thread scheduling and thread have to go through kernel mode

D, kernel threads that will help concurrent advantage of multiple processors, but it takes up more system spending

Reference answer: C

Answer Analysis: Users do not need threads, or golang meaning there is no existence of.

 

 

 

25. The following statement regarding references is wrong?

A, C is not a reference pointer

B, references are not permitted to use two variables point to the same content

C, reference can pass variables

D, a variable can be passed to the function by reference, so that the function can modify the value of its argument.

Answers: B

Answer Analysis: reference is allowed to use two variables to point to the same content.

 

26. The following code output result is?

 

 

 

A、1

B、2

C、3

D、4

Answers: A

Answer Analysis: Investigation operator precedence, entitled $ a = (2> 2) 2: 3 ++ $ a: - $ a; equivalent to $ a = (2> 2) 2:???? (3 + + $ a: - $ a); first calculating operation result obtained in the parentheses 1.

27. The following code execution result?

 

 

 

A、0

B、1

C、2

D、3

Answers: B

Answer Analysis: If you answer 2, congratulations, you fall into the trap. This question is in fact the main test points, the first point is static static type. This value is always static, the first call statement is equal to 0, and the increment is equal to 1. The second call, and then increment equals 1 2. But in fact there's a trap, and that is the difference with a ++ ++ a, a front ++ is to increment after ++ return value is the first increase since then, so the result is equal to 1.

 

When the process has executed 28.PHP performed as follows: Scanning (Lexing) - Compilation - Execution - Parsing, meaning respectively:

A, PHP code into the language fragment (Tokens), converted into Tokens simple and meaningful expression, the Opcodes performed sequentially, the expression compiled into Opocdes

B, and convert the language code fragment PHP (Tokens), compiled into an expression Opocdes, sequentially executed Opcodes, Tokens will be converted into a simple and meaningful expression

C, PHP code into the language fragment (Tokens), converted into Tokens simple and meaningful expression, the expression compiled into Opocdes, sequentially executed Opcodes

D, and convert the language code fragment PHP (Tokens), compiled into an expression Opocdes, be converted into Tokens simple and meaningful expression sequentially executed Opcodes

Reference answer: C

Answer Analysis:

The correct answer is C

1.Scanning (Lexing), converting the fragment PHP language code (Tokens)

2.Parsing, Tokens will be converted into simple and meaningful expression

3.Compilation, the expression is compiled into Opocdes

4.Execution, performed sequentially Opcodes, one at a time to perform the functions PHP scripts.

 

Second, multiple-choice questions (questions of 1 per 5 points)

1. In MYSQL, regarding HASH index, the following description is correct?

A, if the table was changed to a MYISAM MEMORY HASH index table, will not affect the efficiency of queries

B, using only the equation or = Comparison operators <=>

C, the optimizer can use the index to HASH accelerator operation Order By

D, can only use keywords to search the entire row

Answer: B, C, D

Answer Analysis:

A efficiency will be reduced. Simply put, hash index is to use a certain hash algorithm, the key terms of the new hash values, similar to a B + tree does not need to look like step by step from the root to the leaf node is retrieved with a single hash algorithm It can be positioned immediately to the appropriate location, very fast. B + tree index significantly different and hash index is: If it is the equivalent of a query, then the hash index obviously has an absolute advantage, because only after one algorithm to find the appropriate key; of course, this premise is key It is unique. If the key is not unique, we need to first find the key location, and then according to later scan the list until you find the appropriate data; can be seen from the diagram, if the range query, this time to hash indexes entirely useless, because originally ordered key, after hashing algorithm may become discontinuous, and no way to re-use an index complete range query; the same token, there is no way hash index complete sequencing using the index, and like 'xxx%' this part of the fuzzy queries (queries that partially obscured, in fact, the essence is the range query); hash indexes do not support the left-most column joint multi-matching rule index; B + tree index keyword search efficiency is average, not a B-tree as large fluctuations in a large number of duplicate keys, the hash index of efficiency is very low, because there are so-called hash collision. reference:

 

 

 

Share content limit from time to time :( join the group 677 079 770 for more answers to interview questions and learning materials.)

 ★ Tencent Senior PHP Engineer written questions 

 ★ one hundred million PV high concurrency scenarios order handling 

 ★ laravel development Lynx mall Component Services 

 ★ banners TV video broadcast infrastructure project combat 

 

 

 

Guess you like

Origin www.cnblogs.com/993089249a/p/11613404.html