Home  >  Article  >  Backend Development  >  Written test questions with answers when applying for a job at a large Internet company

Written test questions with answers when applying for a job at a large Internet company

WBOY
WBOYOriginal
2016-07-29 08:37:34983browse

1. There is a forum with huge post data. Please briefly explain how to improve the efficiency of users searching for posts.
In terms of programs, 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.
Cache is enough, both template caching and partial caching are acceptable
2. After user registration in the blog, a second-level domain name such as username.mmosite.com is automatically bound. Please briefly describe the solution.
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.
The following points are also required:
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, obtain the value of * in *.yourdomain.com, and jump to the main site
$_SERVER['HTT_HOST']; Just query the database based on this query
3. Please use PHP script to parse out the
http://srfi.schemers.org/srfi-28/mail-archive/maillist.html
This All emails that appear on the page are 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/ to store users For the uploaded video files, this directory is temporary. Now we need to regularly transfer the files in this directory to /video/yearmonthday/. Please write a script
#!/usr/bin/php -n
foreach(glob ("/video/temp/") as $file){
copy...
}

The above introduces the written test questions and answers for a large Internet company when applying for jobs, including relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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