Home  >  Article  >  Backend Development  >  Two sets of test papers suitable for PHP development engineers

Two sets of test papers suitable for PHP development engineers

小云云
小云云Original
2017-11-10 15:03:101523browse

After you learn PHP, the next step is to find a job. We all know that PHP development engineers need a written test and an interview to find a job. So before the interview, we must be fully prepared. So here are two sets of test questions for PHP development engineer interviews compiled by the editor. I hope it will be helpful to you.

The first set of test papers
1. PHP development part

1. There are several ways to merge two arrays. Try to compare their similarities and differences

2. Please write a function to check whether the data submitted by the user is an integer (regardless of data type, it can be binary, octal, decimal, or hexadecimal numbers)

3. PHP's strtolower() and strtoupper() functions may cause Chinese characters to be converted into garbled characters on servers with non-Chinese systems installed. Please write two alternative functions to achieve string case conversion compatible with Unicode text

4. PHP's is_writeable() function has a bug and cannot accurately determine whether a directory/file is writable. Please write a function to determine whether the directory/file is absolutely writable

5. There is a bug in PHP's chmod() function and the setting cannot be guaranteed to be successful. Please write a function to create a directory/file under the specified path and ensure that the permission mask can be set correctly

6. The file type $_FILES['type'] in the PHP processing uploaded file information array is provided by the client browser. It may be information forged by hackers. Please write a function to ensure that the image file type uploaded by the user is authentic and reliable

7. PHP implements data interaction with Javascript by encoding the data in the URL. However, the encoding and decoding rules for some special characters are different from those of Javascript. Please explain this difference in detail and write the following for the data in the UTF-8 character set. PHP's encoding and decoding functions and Javascript's encoding and decoding functions ensure that PHP-encoded data can be correctly decoded by Javascript, and Javascript-encoded data can be correctly decoded by PHP

8. Try to explain Memcache's key multi-node distribution algorithm? How will PHP's Memcache client handle when any node fails? How to ensure the atomicity of Memcache data read and write operations?

9. How to maximize the security of PHP? How to avoid SQL injection vulnerabilities and XSS cross-site scripting vulnerabilities?

10. Please design a data structure that can realize the tree menu function of infinite submenus and provide a menu generation algorithm. Use UML to describe the design and write the relevant PHP code

2. System related parts

1 . Please briefly describe the similarities and differences in the kernel implementation methods and management mechanisms of processes and threads under Linux, FreeBSD, Solaris, Mac OS, and Windows systems

2. Please briefly describe the methods of inter-process communication under Linux/BSD systems, and explain specifically how to implement it under PHP

3. Please briefly describe the several system message/event asynchronous notification mechanisms under Linux/BSD system, and compare them

4. Simply compare the similarities and differences of the TCP/UDP protocols. For PHP's Socket extension and Stream extension, try to compare the differences in SOCKET programming based on the TCP/UDP protocol?

5. Why do zombie processes (orphan processes) appear? How to check the zombie process? How to solve the zombie process problem?

6. For System-V message queues, how to solve the system's own limitations on the number of message queues and total capacity (number of bytes)? How to set the priority level of messages? Please compare the similarities and differences between blocking mode and non-blocking mode, and explain how to avoid message queue congestion in non-blocking mode?

7. Please describe the MPM (Multi-Processing Module) mechanism of Apache 2.x version, and specifically explain how to support PHP under different MPM mechanisms?

8. Please briefly describe several ways of running PHP under Apache and compare them? How to make PHP run in Fast CGI mode under Linux+Apache?

9. Please write down the configure parameters that must be specified to install PHP when PHP can be executed as a script on the command line, and explain how to run a PHP script on the command line (write down two methods) and pass parameters to the PHP script at the same time?

10. Please briefly describe the memory pool of PHP 5.2, its memory management mechanism, and garbage collection mechanism. 1. The following questions, except for programming tasks, need to be written on the scratch paper provided to you. Paper is a precious earth resource, please use it sparingly. When there is a corresponding environment, programming tasks will require writing on the computer. If there are no conditions, you can only write on straw paper.

Second set of test papers

Basic tasks + Advanced tasks + Design tasks = 90 minutes

Programming tasks = 60 minutes

Basic tasks:

1. Please list the UNIX you can think of signal, and explain the purpose of the signal.

2. Please list all the string search algorithms you can think of and briefly explain them with comments.

3. There is an IP address (192.168.0.1), please write its 32-bit unsigned integer form.

4. Write out all the HTTP return status values ​​you can think of, and explain their uses (for example: returning 404 to indicate that the page cannot be found)

Basic task-choose (you will get additional Score):

1. Draw a few server-side models that you are most familiar with (the format is not important, just try to make the drawings clear and explain the ideas)

Advanced tasks:

1. What is the garbage collection mechanism of PHP?

Instructions:

1) If you are familiar with PHP source code, then please start with the source code and answer some questions, you will get extra points

2) If you are not If you are familiar with PHP source code, then try your best to write as much as you can, including information obtained by using your own programming intuition.

3) If you are correct, you will get points. If you are wrong, you will not be deducted. If you do not write, you will get no points.

2. Please write the HTTP header and meet the following requirements:

1) This is a post request

2) Target: http://www.example. com:8080/test

3) POST variable:

username: test

pwd: test2

intro: Hello world!

4) Contains the following COOKIE information:

cur_query: you&me

Explanation:

1) If you cannot remember the command word in a certain HTTP protocol, then, Unfortunately, this move is to use "Chinese characters" instead.

2) If you can remember more HTTP protocol command words, then there is always no harm in writing a few more sentences, right?

3) The most important thing is to draw the correct "outline" (remember the head printed by tools such as httpwatch? That is the meaning of "outline"), there will also be points, but if , even "outline" is written wrong, then it is a pity.

Design tasks:

1. Recently, there are always people harassing our voting module. We need you to design something with voting restrictions.

The requirements are as follows:

1) It is required that each QQ number (assuming this QQ number can be expressed in UNIT32) can only cast 5 votes within 10 minutes.

2) Our users are very enthusiastic, with an average of about 20 million people voting through this program every day.

Instructions:

1) No need to write code, just pictures and text.

2) For the key logic, please use pictures and codes to express it. This is also a test of your writing ability.

3) List all the boundary conditions you can think of. This is a test of your comprehensiveness and agility in logical thinking.

4) For storage, do your best. If you need a storage layer designed by yourself, then describe the implementation of this storage layer clearly in words and pictures. If the design is reasonable, you will get gorgeous bonus points.

Programming tasks:

1. We ran into trouble. A new missionary annoyed God. God was very angry and asked us to memorize the Bible (bbe.txt) until Which word he says, we have to quickly answer which line and word position the word is in. I heard that you are an excellent programmer, so please help us complete this impossible task.
The requirements are as follows:

1)/myworks/example/bbe.txt, a 98 version English Bible

2) The input part requirements are as follows: php ./example.php [word ]

3) The output part is as follows: [word] 1,2 2,4 5,6 means: this word is in row 1 and column 2 (the second word), row 2 and column 4...

Description:

1) This text is 4MB huge...

2) The meaning of the word: a string composed of English letters (upper and lower case) and numbers (0-9)

3) The OS of the machine provided to you is Ubuntu 9.10, the memory is only 1G, and, unfortunately, 700M of it is used for other things

4) The computer-based exam does not allow the Internet, but I The man document and the reader for reading CHM and PDF are installed. In the CHM folder on the computer desktop, there is the corresponding PHP reference manual

5) The algorithm complexity requirement cannot be greater than O(N^2) (That’s N squared)

6) What? PHP is inefficient and uncomfortable to use. Well, you can do it in other languages. But note: the machine provided to you only has python 2.4/perl 5.8/gcc[g++] 4.1

Summary: No matter what the interview is, confidence is very important. I hope you can use these two sets when interviewing PHP development engineers. The questions can help you, and I also hope that the PHPers who are interviewing can get their ideal jobs.

Related recommendations:

Knowledge structure of PHP development engineers

##Essentials for becoming a successful programmer

Be a different programmer

The above is the detailed content of Two sets of test papers suitable for PHP development engineers. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn