Home  >  Article  >  Backend Development  >  Written test questions with answers when applying for a large Internet company_PHP tutorial

Written test questions with answers when applying for a large Internet company_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:53:49825browse

1. There is a forum with huge post data. Please briefly explain how to improve the efficiency of users searching for posts.
On the program side, page caching technology can be used. In terms of front-end interface design, users can also enter more keywords, such as the title of the post, the ID of the poster, time, etc., which can greatly improve the efficiency of search.
Just cache it, both template caching and local caching are possible

2. After the user registers in the blog, it will automatically bind a second-level domain name: username.mmosite.com. Please describe briefly. Come up with solutions.
You can use two IIS sites, one is the main site and the other is domain name jump
The site used for jump must add an empty host header (default site) in IIS
You also need the following items Points:
1. Pan-domain name resolution, resolve *.yourdomain.com to the IP address of your Web server
2. Edit the program on the default page of the domain name jump site, and obtain *.yourdomain.com The value of *, jump to the main site

$_SERVER['HTT_HOST']; Just query the database according to this query

3. Please use PHP script to parse out the content in
http ://srfi.schemers.org/srfi-28/mail-archive/maillist.html
All emails appearing on this page and saved to an array.

preg_match_all w+@([w.]+) will do.

4. Use JavaScript script to write the following function. There is a page with two image ads. When a user visits this page, there is a one percent probability of clicking one of the two ads randomly.

parseInt(Math.random()*100)==1

5. There is an article containing Chinese and English characters. Now it is necessary to extract all the English words in the article. For example, the following text:
RF Online has been officially rele button function ased for
The extraction result should be:
RF
Online
has
been
officially
rele
ased
for
Please write this function in C language.

preg_match_all w+
C language is also simple, just judge the assoc range

6. Please use the shell (Bourne Again Shell) script under Linux to write the following required functions:
There is now a directory /video/temp/ used to store video files uploaded by users. This directory is temporary. Now we need to regularly transfer the files in this directory to /video/year, month, day/. Please write a script
#!/usr/bin/php -n
foreach(glob("/video/temp/") as $file){
copy...
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/318614.htmlTechArticle1. There is a forum with huge post data. Please briefly explain how to improve the efficiency of user search posts. On the program side, page caching technology can be used. In terms of front-end interface design...
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