2013 Shandong civil servant interview Real problem PHP's face test set, with my answer and analysis (i)

Source: Internet
Author: User
Interview Question 1
1. The time format of the day before printing with PHP is 2006-5-10 22:21:21
2, Echo (), print (), Print_r () difference
3, the ability to make HTML and PHP separated from the use of the template
4, how to implement PHP, JSP interaction?
5. What tools are used for version control?
6, how to implement string rollover?
7, optimize the MySQL database method.
8. Talk about transaction processing
9, apache+mysql+php to achieve maximum load method
10, the implementation of the text string interception without garbled method.
Answer:
1.echo date (' y-m-d h:i:s ', Strtotime ('-1 day '));
2.echo is the language structure, no return value, print function and echo basically the same, the difference is that print is a function, there is a return value; Print_r is a recursive print for outputting array objects
3.so much, in fact, PHP itself is a template engine, I used is smarty, common and phplib,fasttemplate,savant here is a list of templates engine: http://www.sitepoint.com/forums /showthread.php?t=123769
4. The topic is a little vague, soap,xml_rpc,socket function,curl can achieve these, if it is a test of PHP and Java integration, PHP built-in this mechanism (if you test PHP and. NET integration, can also answer this), such as $foo = New Java (' Java.lang.System ');
5.CVS and SVN,SVN claims to be the next generation of CVS, but CVS is a veteran, with a high market share. I have been using SVN, the topic is to ask what tool, er, this may need to answer: CVS Server on Apache as the service side, Wincvs as a client; Subversion on Apache/dav do the server, TortoiseSVN do the client, or Subclipse do the client.
6. Use Strrev function Bai, do not use PHP built-in on their own write:
function Strrev ($STR)
{
$len =strlen ($STR);
$newstr = ";
for ($i = $len; $i >=0; $i--)
{
$newstr. = $str {$i};
}
return $newstr;
}
7. The political problem of college entrance examination, write down all the knowledge you know. My answer:
(1). Database design Aspects, this is the responsibility of the DBA and architect, the design of a well-structured database, when necessary, to regularization (English is this: denormalize, Chinese translation into what I do not know), allow partial data redundancy, avoid join operation, to improve query efficiency
(2). System architecture design, the table hash, the huge amount of data scattered into a few different tables. Slow table, fast table only stay up-to-date data, slower table is a historical archive. Cluster, master server Read & write, from server read only, or n servers, each machine is master
(3). (1) and (2) Beyond PHP programmer requirements, will be better, will not matter. Check for fewer indexes
(4). Write efficient SQL statements to see if there are any inefficient SQL statements, such as the full connection of the generated Cartesian product, a large number of group by and order by, no limit, and so on. When necessary, the database logic is encapsulated in the DBMS side of the stored procedure. Cache query Results, Explain of each SQL statement
(5). All that is required is to fetch only the necessary data from the database, such as querying the number of comments for an article, select COUNT (*) ... where article_id =? Yes, don't select * ... where article_id =? Then Msql_num_rows.
Send only the necessary SQL statements, such as when the article is modified, if the user only modified the title, then update ... set title =? where article_id =? Do not set content =? (large text)
(6). When necessary, use a different storage engine. For example, InnoDB can reduce deadlocks. Heap can increase query speed by an order of magnitude.
8. As is a programming language will have promised Hello World example, is the textbook of this database will say a to B's account transfer $50 example, to answer this is good. But as far as I know, with the MySQL company, MySQL is seldom used for transaction processing. And now Oracle has acquired InnoDB's company.
9. See the answer to question seventh, where the problem is solved.
10. Hahaha, I guess the question is not the substr of Chinese processing problems for a long time, is not also used on the Internet circulated with the regular match Chinese characters and then intercept the function, in fact, there is a very simple solution: Mb_substr ()
Interview Question 2
var $empty = ';
var $null = null;
var $bool = FALSE;
var $notSet;
var $array = array ();
1.
$a = "Hello";
$b = & $a;
Unset ($b);
$b = "World";
What is $a?
2.
$a = 1;
$x = & $a;
$b = $a + +;
What is $b?
3.
$x = Empty ($array);
What is $x? True or False
4. Have you ever used version control software? If you have the name of the version control software you are using?
5. Have you ever used a template engine? If you have the name of the template engine you are using?
6. Please briefly describe your most proud development.
7. What are the methods you use to solve traffic problems for large-volume websites?
8. Write the code that displays the client IP and server IP in PHP:
The answer is to update the blog when you write again.

The above introduces the 2013 Shandong civil servant interview Real problem PHP test set, attached to my answer and analysis (a), including the 2013 Shandong civil Servant interview Real topic aspects of the content, I hope the PHP tutorial interested friends have helped.

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