Answers to the written examination questions of a large network company

Source: Internet
Author: User
Questions for online companies, mainly including php and javascript 1. there is a forum where the post data is huge. please briefly describe how to improve the efficiency of searching for posts.
In terms of programs, the page cache technology can be used. On the front-end interface, users can also enter more keywords, such as the title of the post, the id of the poster, and the time, which greatly improves the search efficiency.
You can cache the template and local cache.

2. after a user registers in the blog, the user automatically binds a second-level domain name such as the user name .mmosite.com. please briefly describe the solution.
You can use two IIS sites, one is the master site, and the other is the domain name jump
An empty host header must be added to the site for redirect in IIS (default site)
The following requirements are also required:
1. wildcard domain name resolution: resolve * .yourdomain.com to the IP address of your Web server
2. in the default page editing program of the domain name jump site, get the * Value in * .yourdomain.com, and jump to the main site

$ _ SERVER ['htt _ host']; query the database based on this.

3. Use a PHP script to parse
Http://srfi.schemers.org/srfi-28/mail-archive/maillist.html
All emails on this page are saved to the array.

Preg_match_all \ w + @ ([\ w \.] + ).

4. write the following functions using JavaScript scripts. There is a page with two image ads. when a user visits this page, he or she randomly clicks one of the two ads at a rate of 1%.

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

5. an article contains Chinese and English characters. now you need to extract all the English words from the article. For example, the following text:
RF Online has been officially rele button power ased
The extracted result should be:
RF
Online
Has
Been
Officially
Rele
Ased
For
Write this function in C language.

Preg_match_all \ w +
The C language is also simple, and the assoc range can be determined.

6. use the shell (Bourne Again Shell) script in linux to write the following required functions:
Now there is a directory/video/temp/used to store the video files uploaded by the user. this directory is temporary. now we need to regularly transfer the files in this directory to/video/year/month, please write the script
#! /Usr/bin/php-n
Foreach (glob ("/video/temp/") as $ file ){
Copy...
}

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.