PHP programmers face 2019 Alibaba resolve questions and answers

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

Compare wrong 1.Memcache and Redis is?

A, after Memcache expired, do not delete the cache, the data will lead to the next problem to take data, Redis have a special thread, clear cached data;

B, Memcache and redis are only support a single-threaded; the CPU utilization and redis portion Memcache par

C, Memcache only support storage key value, the Redis support more types of data, such as Key value, hash, list, set, zset;

D, Memcache itself does not support persistence, Redis support persistence;

Answers: B

Answer Analysis:

Memcache support multithreading, redis support single-threaded; CPU utilization than Memcache redis

 

2.mysql5.7 concerning json description of the type, that is not right

A, JSON data can be done to check the validity of

B, json data, still need to traverse all strings to find data

C, JSON makes query performance upgrade

D, JSON supports part attribute index, the index can be part of the data in JSON virtual function column

Answers: B

Answer Analysis:

Native JSON following advantages: 1. Similar text storage, very large data can be stored. 2. JSON validity check: insert data must be JSON string type of job. 3. Compared to traditional forms, through all the strings do not need to find data. 4. Support Index: JSON data may be indexed by a portion of a virtual function of the column

 

3. Execute the following code for $ x will become what value it?

 

A、NULL

B、255

C、0

D、false

Reference answer: C

Answer Analysis:

The correct answer: C Answer Analysis: oxFF is a hexadecimal number, then do not turn integer comparison, will first hexadecimal number is converted to decimal numbers do compare. Using int function, PHP uses is_numeric_string determines whether a string contains the hexadecimal digits followed by conversion. 0 0xff found no later figures, it is zero.

 

4. Large difference data in the database (the NoSQL) and relational databases:

A, horizontal expansion and vertical expansion

B, whether transactional ACID

C, application of two databases complement each other

D, above all

Reference answer: D

Answer Analysis: None

 

5. 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.

 

6. The following description for the command is?

ps aux --sort -pcpu, + pmem | head -n 10

A, the top ten queries CPU program uses ranking

B, query access more than ten times the CPU program

Ten procedures before C, and the query cpu cache access

Top ten record D, query cpu and memory

Reference answer: D

Answer Analysis: ps -aux --sort -pcpu, + pmem | head -n 10 queries recorded top ten cup and memory by aux command

 

7. With regard to json argument is wrong:

A, json_encode can handle utf-8 encoded data

B, may be assembled or parsing json string sprintf

C, json_encode only encoded array

D, json_decode json string can be decoded into the target

Reference answer: C

Answer Analysis: json \ _encode can be encoded into arrays and objects

 

8. The following statement about the difference between processes and procedures, and the error is?

A, the program does not state, and the process is stateful

B, the program is an ordered set of static command, the process is the execution of a program

C, the program can be stored for a long, process is temporary

D, the program can only be run in the foreground, and the process can be run in the foreground or background

Reference answer: D

Answer Analysis: The program is a piece of executable code file, that file on linux. It is called the process of running, that process is running the state.

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

9.PHP object-oriented principles to understand the error is?

A, the interface separation principle

B, rely on the principle of

C, substitution principle

D, a number of the principles of responsibility

Reference answer: D

Answer Analysis: five basic principles of single responsibility principle SRP (Single Responsibility Principle) refers to a class of single function, not all-inclusive. As a people, the distribution of work can not be too much, otherwise all day long, although busy, but the efficiency is not high up. Open Closed Principle OCP (Open-Close Principle) a module in scalability should be open and the (need for more learning materials and face questions please join qun6 / 7/7/0/7/9/7/7/0) in terms of change it should be closed. For example: a network module, only the original server function, and now want to join the client function, then it should be in the code without modifying the server function of the premise, it is possible to increase the code that implements the client function, which requires early in the design, They should be separated from the server and the client, the public part of the abstract. Alternatively principle (the Liskov Substitution Principle LSP) should be replaced subclasses parent class and the parent class appear anywhere that can appear. For example: the company engage in an annual party, all employees can participate in the drawing, so whether it is new or old staff employees, regardless of headquarters employees or expatriates, all should be able to participate in the drawing, otherwise the company would discord. Principles dependent (the Dependency Inversion Principle DIP) particular abstract dependent, dependent on the lower layer an upper layer. Suppose B is lower than the module A, B but need to use the function A, this time, B should not be used directly in the concrete class A: and should define an abstract interface consisting of B, A to achieve this by the abstract interface, B using only the abstract interface: this achieves the object dependency inversion, B also lifted dependence of a, which in turn is dependent on the definition of a B abstract interface. Upper module by the lower module is difficult to avoid dependence, if B is also directly dependent on implement A, then it may result in a circular dependency. A common problem is the need to be included when compiling A module directly to cpp file module B, and B is also to be included when compiling cpp file directly to the A's. Interface separation principles (the Interface Segregation Principle ISP) through the abstract interface between the modules isolated, rather than through a specific class strongly coupled together.

 

10. Three people independently decipher a code, known to everyone probability can be translated respectively probability 1 / 5,1 / 4,1 / 3, the password can be deciphered as is?

A、1/60

B、3/5

C、59/60

D、13/30

Answers: B

Answer Analysis: Title, at least one can decipher passwords, and all three can not decipher the password is the opposite event. Therefore, a probability that at least one can unscrambled = no probability 1- three unscrambled = 1- (1-1 / 5) (1-1 / 3) (1-1 / 4) = 1-2 / 5 = 3/5.

 

11.PHP array type and other types of conversion, the following error is?

A, int, float, string, boolean, resource type (array) $ a is equivalent to the array ($ a)

B, (array) object key name is the name of the member variable objects, the object is a member of key attributes

C, array (false) = [] empty array

D, (array) null = [] empty array

Reference answer: C

Answer Analysis: int, float, string, boolean , resource type (array) $ a is equivalent to the array ($ a) (array) object key name is the name of the member variable objects, the object is a member of the key attributes (array) null =
empty array .

 

12. The following statement about the 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.

 

13. Wang's department heads to issued a task: Due to the large section of a website traffic, and therefore require special website url to a request to do load balancing, then the cluster software to achieve it through what?

A, LVS cluster software

B, oneproxy clustering software

C, haproxy clustering software

D, keepalived clustering software

Reference answer: C

Answer Analysis: slightly.

 

14. The following documents are referred to as a plain text file or an ASCII file is ().

A, residing in an .EXE file extension

B, with extension .TXT file

C, with BMP as file extension

D, to .DOC file extension

Answers: B

Answer Analysis: plain text file or ASCII file generally txt extension.

 

15. The following is able to remove a

A、alter table emp remove addcolumn

B、alter table emp drop column addcolumn

C、alter table emp delete column addcolumn

D、alter table emp delete addcolumn

Answers: B

Answer Analysis: drop list delete delete delete rows

 

16. Which of the following suffixes file type is not a text file?

A、word

B、Excel

C、txt

D, pdf

Reference answer: D

Answer Analysis: pdf is a binary file.

 

17. The results are output following code a.php?
a.php code is as follows:

 

 

 <B.php code is as follows:

 

A、foo in a

B, nothing output

C, error

D、foo in b

Reference answer: C

Answer Analysis:? The answer is C want you to think about is, why use the b inside the return, can still find the definition of foo function, and the error Can not redeclare foo () because php is before running to explain the implementation, in order to avoid ( For more information and to learn face questions please join qun6 / 7/7/0/7/9/7/7/0) inaccurate statements, accompanied by the original document: Note that because PHP processes the file before running it, any functions defined in an included file will still be available, even if the file is not executed.

 

18. The following statement on asymmetric encryption is wrong

A, encryption slow

B, safe

C, both sides need to synchronize key

D, can be digitally signed

Reference answer: C

Answer Analysis: asymmetric encryption that is not the same key encryption and decryption, the purpose is to improve security, natural speed may be reduced. Typical applications of asymmetric encryption digital signature.

 

19. With regard to Laravel middleware is wrong?

A, Artisan run the command make: middleware to create a new middleware

B, define front & rear intermediate

C, middleware proxy mode

D, middleware is an intermediary mode

Reference answer: C

Answer Analysis: Artisan run the command make: middleware to create a new middleware can be defined front & rear middleware

 

20. The following PHP variables can be serialized and saved to a file is?

A、serialize()

B、json_encode()

C var_export ()

D, above all OK

Reference answer: C

Answer Analysis: var_export () The second parameter to TRUE, you can return the variable representation.

 

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.

 

22. With regard to PHP array Bucket structure, saying the error is?

A、void *pData 指向value

B, void * pKey key points

C, void * pDataPtr pointer value pointing

D, struct bucket * pLast stored on an element within the same Bucket

Answers: B

Answer Analysis: void \ * pData point value void \ * pDataPtr pointer to a struct bucket value of \ * pNext store the next element in the struct with a Bucket bucket \ * pLast stored on an element within the same Bucket.

 

Jiaoyou 23. The performance of relational schema design is called normalization, standardization of the main theoretical basis is ().

A, the relationship normalization theory

B, relational operator theory

Algebraic theory C, relationship

D, mathematical logic

Answers: A

Answer Analysis: A.

 

24. The input from the user in the URL in your browser and press Enter to see the full page, in the middle we have gone through what process?

A, Browser -> url-> dns-> ip-> port-> nginx-> tcp-> server name-> php-fpm / fast cgi-> php

B, Browser -> url-> dns-> ip-> tcp-> port-> nginx-> server name-> php-fpm / fast cgi-> php

C, Browser -> url-> dns-> ip-> port-> tcp-> nginx-> server name-> php-> php-fpm / fast cgi

D, Browser -> url-> dns-> ip-> port-> tcp-> nginx-> server name-> php-fpm / fast cgi-> php

Reference answer: D

Answer Analysis: A PHP Web requests:

The browser sends a URL request 2.DNS begin to resolve the domain name 3. Obtain IP access after the start IP and TCP Port 4. Development sent a request to the Nginx 5.Nginx resolve server name, and then sent to the php-fpm management process 6.php- fpm to a specific request to the PHP final execution.

 

25. Read the following PHP code, and select the output ()

 

 

B、1

C、2

D、3

Reference answer: D

Answer Analysis: static properties of permanent memory.

 

26. Which of the following is not a characteristic strip PHP language?

A, open source

B, free

C, based on the client

D, convenient and efficient

Reference answer: C

Answer Analysis: features of PHP language are: open source, free and convenient and efficient.

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

27. 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

 

Second, multiple choice (total of three questions, each question 5 minutes)

1 was assumed that the current screen are 1024 × 768, define a center accounted for half the size of the screen is the statement of the form

A、<TABLE ALIGN=”CENTER” WIDTH=”50%”></TABLE>

B、<TABLE ALIGN=”CENTER” WIDTH=”512″></TABLE>

C、<DIV ALIGN=”CENTER”><TABLE WIDTH=”512″></TABLE></DIV>

D、<CENTER><TABLE WIDTH=”50%”></TABLE></CENTER>

Answer: A, B, C, D

Answer Analysis: center tag HTML5 is not recommended for use ... this is not purely semantic style tags is incompatible with the w3c standard, there are instructions on MDN.

 

2. The following regular expression can not match "www.innotechx.com" are:

The following regular expression can not match "www.innotechx.com" are:

A、^w+.w+.w+$

B、[w]{0,3}.[a-z]*.[a-z]+

C、^w.*com$

D、[w]{3}.[a-z]{11}.[a-z]

Answers: A, D

Answer Analysis: A first look at the options, ^ indicates the beginning of the string matching, and w and there is no special meaning, do not be mistaken as "\ w (match letters or numbers or an underscore or Chinese characters)", and. + denotes repeated one or more times, $ matches the end of the string. Therefore, this option will match [www.www.www] (http: //www.www.www) (wherein w may be repeated more than once).

Option B, [w] {0,3} qualifier, w represents a repeating 0-3 times. "" No special significance, * indicates repeated any number of times, including zero, [AZ] which matches the letters a to z , it is applied repeatedly to a match of a letter z. This same meaning behind, is the + sign is repeated more than once. Even together, can match options.

Option C, the same as the above options, the first matching ^ start of the string, and comprising a w, and "." Is repeated any number of times, finally ending com. This positive match will contain a "wcom" string, but w If it starts, com and if at the end, so you can match option, you can try it for yourself.

D option, repeated three times w, and a ".", But later is repeated 11 times where a to z in a letter, a number of options under the title only nine letters, later do not Kanla been re wrong ~ (For more information on learning and face questions please join qun6 / 7/7/0/7/9/7/7/0)

A little more than nonsense roar, there is wrong, please point out, is not just learning how to understand ~.

 

3 Why large sites to use message queue?

A, decoupling

B, asynchronous

C, clipping

D, large data processing

Answer: A, B, C

Answer Analysis: Message Queuing common usage scenarios are many, but there are three more central: decoupling, asynchronous, clipping large data processing, there is a corresponding approach, and message queues have little.

 

 

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/11612726.html