PHP interview questions, that is, no answer

Source: Internet
Author: User

PHP interview questions, that is, no answer

I. Basic and program questions (we suggest using the languages you are good at: C/C ++, PHP, and Java)

1. Write a sorting algorithm, which can be Bubble sorting or fast sorting. Assume that the object to be sorted is a dimension array. (Note: you cannot use existing functions of the system. Remember the basic knowledge you have learned before)

2. Implement a string truncation function, similar to substr, which must be able to intercept Chinese Multi-byte encoding. Assume that each Chinese character is also a character, and a common number, symbol, or letter is also a character. (Note: the upper part of Chinese Characters in GB encoding is 0x81-0xfe)

3. Write a function that traverses all subdirectories and sub-files in the specified directory (Note: recursive methods can be used)

4. Write two regular expressions that match the email address and URL. Similar to the following:
Email Address: user_name.first@example.com.cn
URL: http://www.example.com.cn/user_profile.php? Uid = 1, 100
(Note: The standard regular expression is the regular expression that can be parsed by the regular expression of the preg _ * class in PHP)

Ii. Database Technical Questions

1. Write the names of more than three MySQL database storage engines (Note: Case Insensitive)

2. Name the three or more open source databases you know (Note: Think about the popular open source databases outside China)

3. What are the main differences between the field types varchar and char in the MySQL database? The field search efficiency is high. Why?

4. Tell us the two major differences between MySQL 4.0 and MySQL 4.1. If you have used MySQL 5, tell us the main differences between MySQL 5 and MySQL 4. (Selected in the second half)

5. What are the three basic optimization rules of the MySQL database? (Tip: service configuration, application, and development considerations)

Iii. Comprehensive Technical Questions

1. Use JavaScript to write out three methods to generate an Image Tag (Tip: For methods, objects, and HTML)

2. Use the CSS style to describe two methods to show only one Div object in the current column

3. Describe the two most significant differences between XHTML and HTML.

4. More than five PHP extensions you have used (Note: Common PHP extensions)

5. Do you understand the MVC mode? Write more than three popular php mvc Framework names (Case Insensitive)

6. write more than 15 common Linux commands you know and their functions.

7. Have you used the vim editor? If you have used it, how to split multiple visual windows in Vim, including horizontal and vertical rows. (This question is selected)

8. Differences between the find and grep commands in Linux)

9. Describe the name of the layer-7 network model from bottom to top (Chinese description can be used)

10. Let's talk about the full names and Chinese interpretations of these protocols below (note: both work at the application layer) SMTP, POP3, HTTP, FTP, DNS

11. Have you used memcache cache? If you have used it, can you briefly describe how it works? (This question is selected)

12. Let's talk about the working principle of the session. (Note: There is a relationship with Cookie)

13. What technologies do you know about search engines? (This question is selected)

Iv. Project and Design Questions

1. In the development of a Web Development Team, let's talk about the division of labor and cooperation among all the members you know.

2. Talk about the most proud projects or personal development works you have ever done (either personal works or cooperative projects)

3. Suppose you have five servers. Please give a rough description of how to use the open-source software you are familiar with to build a medium-sized website with a daily PV of about 3 million.

Five Database Technical Questions

6. write the names of more than three MySQL database storage engines (Note: Case Insensitive)
Dozens of engines including MyISAM, InnoDB, bdb (Berkeley dB), merge, memory (HEAP), example, federated, archive, CSV, blackhole, and MaxDB

7. Name the three or more open source databases you know (Tip: Think about the popular open source databases outside China)
MySQL, SQLite, bdb (Berkeley dB), PostgreSQL, Firebird

8. What are the main differences between the field types varchar and char in the MySQL database? The field search efficiency is high. Why?
Varchar is longer, saving storage space, and char is a fixed length. The query efficiency is faster than that of the char type. Because varchar is not a fixed length, you must first search for the length and then extract the data. This is more efficient than the char fixed length type.

9. Tell us the two major differences between MySQL 4.0 and MySQL 4.1. If you have used MySQL 5, tell us the main differences between MySQL 5 and MySQL 4. (Selected in the second half)

MySQL 4.1 features subqueries and character encoding more than MySQL 4.0.
Mysql5 has more features than mysql4, including stored procedures, views, transactions, and so on.

10. What are the three basic optimization rules for MySQL databases, except for increasing hardware and bandwidth? (Tip: service configuration, application, and development considerations)
(1) System Service optimization: Increase the capacity of MySQL's key_buffer, cache_buffer, and query_cache.
(2) Add an appropriate index for all frequently queried Fields
(3) Optimize SQL statements to reduce operations on ditinct, group, join, and other statements

Sat.
1. Use PHP to print the time format of the previous day in the format of 22:21:21
2. Differences between echo (), print (), and print_r ()
3. templates that can be used to split HTML and PHP
4. How to Implement PHP and JSP interaction?
5. What tools are used for version control?
6. How to Implement string flip?
7. Optimize the MySQL database.
8. Talk about Transaction Processing
9. How to achieve maximum load using Apache + MySQL + PHP
10. The method for intercepting Chinese strings without garbled characters is implemented.

VII,
VaR $ empty = '';
VaR $ null = NULL;
VaR $ bool = false;
VaR $ notset;
VaR $ array = array ();
1.
$ A = "hello ";
$ B = & $;
Unset ($ B );
$ B = "world ";
What is $?
2.
$ A = 1;
$ X = & $;
$ B = $ A ++;
What is $ B?

$ X = empty ($ array );
What is $ X? True or false
4. Have you used version control software? What is the name of the version control software you use?
5. Have you used the template engine? What is the name of the template engine that you use?
6. Briefly describe your most proud development work.
7. What methods do you use to solve the traffic issue for websites with large traffic volumes?
8. Use PHP to write the code that shows the Client IP address and Server IP Address:

1. in PHP, the name of the current script (excluding the path and query string) is recorded in the predefined variable (1), and the URL linked to the current page is recorded in the predefined variable (2).
2. The execution segment will be output (3 ).
3. In HTTP 1.0, Status Code 401 indicates (4). If the "file not found" prompt is returned, the header function is available. The statement is (5 ).
4. The role of the Array Function arsort is (6); the role of the statement error_reporting (2047) is (7 ).
5. The format of the database connection string in pear is (8 ).

6. Write a regular expression and overwrite all JS/vbs scripts on the webpage (that is, remove the script tag and its content): (9 ).
7. install PHP using the Apache module in the HTTP. in the conf file, first use statement (10) to dynamically load the PHP module, and then use Statement (11) to make Apache process all files with the extension of PHP as PHP scripts.

8. the statement include and require can both include another file to the current file. The difference is (12). To avoid multiple inclusion of the same file, you can use the statement (13) to replace them.
9. attributes of the class can be serialized and saved to the session, so that the entire class can be restored later. The function used is (14 ).
10. A function parameter cannot be a reference to a variable unless (15) is set to on.
11. The meaning of left join in SQL is (16 ). If tbl_user records the student's name and student ID, tbl_score records the student's student ID (ID) (which is not recorded after some students take the test) to print the Student name and the total score of each subject
You can use the SQL statement (17 ).
12. In PHP, heredoc is a special string whose end mark must be (18 ).
13. Write a function to traverse all files and subfolders in a folder.
14. Briefly describe the implementation principles of unlimited classification in the Forum.
15. Design a webpage so that a full screen window is displayed when it is opened, which contains a text box and a button. After entering information in the text box, you can click the button to close the window, but the entered information is displayed on the main page.

1-give you three numbers and write the program to find the maximum value.
2-Advantages and Disadvantages of ASP, PHP, and JSP
3-Introduction to MVC
4-Write the SQL statement for the top 10 people with the most posts. Use the following table:
Members (ID, username, posts, pass, email)
Interview question 8
1-how to use JavaScript to determine whether a window has been blocked.
2-Write the session Running Mechanism
3-there is an array $ A = array (, 2); sort it again and list it in ascending order.
4-which of the following functions are used to prevent SQL injection vulnerabilities.
5-query the number of online users and handle SQL statements with exceptions or dropped lines
... Where ________ <now ()

1. The difference between passing a value in PHP and transferring a reference. When will the value be passed for reference?
2. What is the role of error_reporting in PHP?
3. Write a function to verify that the email format is correct.
4. Briefly describe how to obtain the path of the script to be executed, including the obtained parameters.
Note: for example, there is a script www.domain.com, and the parameters passed to it include parameter 1, parameter 2, parameter 3 ....
The method for passing parameters may be get or post, so please write a similar
Http://www.domain.com/script.php ?? Result of parameter 1 = value 1 & Parameter 2 = value 2...
5. How to modify the session survival time.
6. There is a webpage address http://www.domain.com/xxx.php. How can this problem be solved?
7. There is a one-dimensional array that stores integer data. Please write a function to sort them in ascending order. High execution efficiency is required. It also describes how to improve execution efficiency. (This function must be implemented by yourself and cannot use PHP functions)
8. Examples are provided to illustrate how to accelerate page loading during your development process.

 

 

 

Reposted from: csdn-axiebin
 

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.