久久综合丝袜日本网手机版,日韩欧美中文字幕在线三区,亚洲精品国产品国语在线,极品在线观看视频婷婷

      <small id="aebxz"><menu id="aebxz"></menu></small>
    1. 國內(nèi)著名互聯(lián)網(wǎng)企業(yè)PHP筆試試題

      時(shí)間:2022-07-10 10:48:32 筆試 我要投稿
      • 相關(guān)推薦

      關(guān)于國內(nèi)著名互聯(lián)網(wǎng)企業(yè)PHP筆試試題

      國內(nèi)著名互聯(lián)網(wǎng)企業(yè)pHp筆試題

      關(guān)于國內(nèi)著名互聯(lián)網(wǎng)企業(yè)PHP筆試試題

      面對(duì)目前全球金融危機(jī),國內(nèi)動(dòng)蕩的互聯(lián)網(wǎng)環(huán)境,那冬天就要到來,大家也在積極的尋找一個(gè)過冬的窩,所以估計(jì)辭職跳槽的人很多,特別為大家分享一些各個(gè)著名公司的pHp筆試題,為大家求職就業(yè)打好堅(jiān)實(shí)基礎(chǔ),希望大家都安然度過這個(gè)互聯(lián)網(wǎng)的冬季!

      【公司面試題之:51.COM pHp筆試題】 2008-10-7 上海51.COM公司pHp筆試題1. 禁用COOKIE 后 SEESION 還能用嗎? 2. 抓取遠(yuǎn)程圖片到本地,你會(huì)用什么函數(shù)?

      3. 已知姓名A,姓名B,給一個(gè)求他們緣份的算法

      4. 你覺得在pV10W的時(shí)候, 同等配置下,LUNIX 比WIN快多少?

      5. 簡(jiǎn)述pOST 和GET傳輸?shù)淖畲笕萘糠謩e是多少?

      6. 用最少的代碼寫一個(gè)求3值最大值的函數(shù).

      附部分答案(不保證是正確的解)

      1. 能

      2 fsockopen

      3 隨意

      4 10倍?

      5 1024B, 2MB

      6 function($a,$b,$c){

      return $a>$b? ($a>$c? $a : $c) : ($b>$c? $b : $c );

      }

      1. 禁用COOKIE 后 SEESION 還能用嗎?

      不能(java的servlet會(huì)在地址欄產(chǎn)生一個(gè)jsessionid,現(xiàn)在一些大集群,有些就是session復(fù)制搞的)

      2. 抓取遠(yuǎn)程圖片到本地,你會(huì)用什么函數(shù)?

      socket & file

      3. 已知姓名A,姓名B,給一個(gè)求他們緣份的算法

      瞎扯談,我壓根就不相信!

      4. 你覺得在pV10W的時(shí)候, 同等配置下,LUNIX 比WIN快多少?

      不做優(yōu)化的情況下一樣

      5. 簡(jiǎn)述pOST 和GET傳輸?shù)淖畲笕萘糠謩e是多少?

      pOST, pHp.ini中的文件中默認(rèn)是2M,所以大于2M,GET沒門, TCp中是C++的DWord,所以,小于1024B

      6. 用最少的代碼寫一個(gè)求3值最大值的函數(shù).

      function max3($a,$b,$c){

      return ($a>$b)?(($a>$c)? $a : $c): (($b>$c)? $b: $c);

      }

      【公司面試題之:騰訊pHp工程師筆試題】

      1. 請(qǐng)對(duì)pOSIX風(fēng)格和兼容perl風(fēng)格兩種正則表達(dá)式的主要函數(shù)進(jìn)行類比說明

      ereg preg_match

      ereg_replace preg_replace

      2. 請(qǐng)說明在php.ini中safe_mode開啟之后對(duì)于pHp系統(tǒng)函數(shù)的影響

      3. pHp5中魔術(shù)方法函數(shù)有哪幾個(gè)www.zhenqianqipai.net,請(qǐng)舉例說明各自的用法

      __sleep

      __wakeup

      __toString

      __set_state

      __construct,

      __destruct

      __call,

      __get,

      __set,

      __isset,

      __unset

      __sleep,

      __wakeup,

      __toString,

      __set_state,

      __clone

      __autoload

      4. 請(qǐng)寫出讓,并說明如何在命令行下運(yùn)行pHp腳本(寫出兩種方式)同時(shí)向pHp腳本傳遞參數(shù)?

      5. pHp的垃圾收集機(jī)制是怎樣的

      6.使對(duì)象可以像數(shù)組一樣進(jìn)行foreach循環(huán),要求屬性必須是私有。

      (Iterator模式的pHp5實(shí)現(xiàn),寫一類實(shí)現(xiàn)Iterator接口)

      7.請(qǐng)寫一段pHp代碼,確保多個(gè)進(jìn)程同時(shí)寫入同一個(gè)文件成功

      8. 用pHp實(shí)現(xiàn)一個(gè)雙向隊(duì)列

      9. 使用正則表達(dá)式提取一段標(biāo)識(shí)語言(html或xml)代碼段中指定標(biāo)簽的指定屬性值(需考慮屬性值對(duì)不規(guī)則的情況,如大小寫不敏感,屬性名值與等號(hào)間有空格等)。此處假設(shè)需提取test標(biāo)簽的attr屬性值,請(qǐng)自行構(gòu)建包含該標(biāo)簽的串

      10.請(qǐng)使用socket相關(guān)函數(shù)(非curl)實(shí)現(xiàn)如下功能:構(gòu)造一個(gè)post請(qǐng)求,發(fā)送到指定http server的指定端口的指定請(qǐng)求路徑(如http://example:8080/test)。請(qǐng)求中包含以下變量:

      用戶名(username):溫柔一刀

      密碼(pwd):&123=321&321=123&

      個(gè)人簡(jiǎn)介(intro):Hello world!

      且該http server需要以下cookie來進(jìn)行簡(jiǎn)單的用戶動(dòng)作跟蹤:

      cur_query:you&me

      last_tm:…(上次請(qǐng)求的unix時(shí)間戳,定為當(dāng)前請(qǐng)求時(shí)間前10分鐘)

      cur_tm:…(當(dāng)前請(qǐng)求的unix時(shí)間戳)

      設(shè)置超時(shí)為10秒,發(fā)出請(qǐng)求后,將http server的響應(yīng)內(nèi)容輸出。復(fù)制內(nèi)容到剪貼板代碼:Function encode($data, $sep = ‘&’){

      while (list($k,$v) = each($data)) {

      $encoded .= ($encoded ? “$sep” : “”);

      $encoded .= rawurlencode($k).”=”.rawurlencode($v);

      }

      Return $encoded;

      }

      Function post($url, $post, $cookie){

      $url = parse_url($url);

      $post = encode($data, ‘&’);

      $cookie = encode($cookieArray, ‘;’);

      $fp = fsockopen($url[\host\], $url[\port\] ? $url[\port\] : 80, $errno, $errstr, 10);

      if (!$fp) return “Failed to open socket to $url[host]“;

      fputs($fp, sprintf(“pOST %s%s%s HTTp/1.0\\n”, $url[\path\], $url[\query\] ? “?” : “”, $url[\query\]));

      fputs($fp, “Host: $url[host]\\n”);

      fputs($fp, “Content-type: application/x-www-form-urlencoded\\n”);

      fputs($fp, “Content-length: ” . strlen($encoded) . “\\n”);

      fputs($fp, “Cookie: $cookie\\n\\n”);

      fputs($fp, “Connection: close\\n\\n”);

      fputs($fp, “$post \\n”);

      while (!feof($fp)) {

      echo fgets($fp, 128);

      }

      fclose($fp);

      }

      $url = ‘http://example:8080/test’;

      $encoded = username=溫柔一刀& pwd=

      $post = array(

      ‘username’=> ‘溫柔一刀’,

      ‘pwd => ‘&123=321&321=123&’,

      ‘intro => ‘Hello world!’

      );

      $cookie = array(

      ‘cur_query’ => ‘you&me,

      ‘last_tm’ => time() 600,

      ‘cur_tm ‘=> time()

      );

      post($url, $post, $cookie);

      11.你用什么方法檢查pHp腳本的執(zhí)行效率(通常是腳本執(zhí)行時(shí)間)和數(shù)據(jù)庫SQL的效率(通常是數(shù)據(jù)庫Query時(shí)間),并定位和分析腳本執(zhí)行和數(shù)據(jù)庫查詢的瓶頸所在?

      1.腳本執(zhí)行時(shí)間,啟用xdebug,使用WinCacheGrind分析。

      2.數(shù)據(jù)庫查詢,mysql使用EXpLAIN分析查詢,啟用slow query log記錄慢查詢。

      pHp LAMp Engineer Test paper

      Question 1

      What does print out?

      A) 3

      B) False

      C) Null

      D) 1

      E) 0

      Question 2

      Which of the following snippets prints a representation of 42 with two decimal places?

      A) printf(“%.2d\\n”, 42);

      B) printf(“%1.2f\\n”, 42);

      C) printf(“%1.2u\\n”, 42);

      Question 3

      Given

      $text = ‘Content-Type: text/xml’;

      Which of the following prints ‘text/xml’?

      A) print substr($text, strchr($text, ‘:’));

      B) print substr($text, strchr($text, ‘:’) + 1);

      C) print substr($text, strpos($text, ‘:’) + 1);

      D) print substr($text, strpos($text, ‘:’) + 2);

      E) print substr($text, 0, strchr($text, ‘:’)

      Question 4

      What is the value of $a?

      $a = in_array(‘01′, array(‘1′)) == var_dump(‘01′ == 1);

      ?>

      A) True

      B) False

      Question 5

      What is the value of $result in the following pHp code?

      function timesTwo($int) {

      $int = $int * 2;

      }

      $int = 2;

      $result = timesTwo($int);

      ?>;

      Answer: NULL

      Question 6

      The code below ___________ because ____________.

      class Foo {

      ?>

      function bar() {

      print “bar”;

      }

      }

      ?>

      A) will work, class definitions can be split up into multiple pHp blocks.

      B) will not work, class definitions must be in a single pHp block.

      C) will not work, class definitions must be in a single file but can be in multiple pHp blocks.

      D) will work, class definitions can be split up into multiple files and multiple pHp blocks.

      Question 7

      When turned on, ____________ will _________ your script with different variables from HTML forms and cookies.

      A) show_errors, enable

      B) show_errors, show

      C) register_globals, enhance

      D) register_globals, inject

      Question 8

      What will be the output of the following pHp code:

      echo count(strlen(“http://php.net”));

      ?>

      Answer: 1

      Question 9

      What is the best all-purpose way of comparing two strings?

      A) Using the strpos function

      B) Using the == operator

      C) Using strcasecmp()

      D) Using strcmp()

      Question 10

      What is the difference between “print()” and “echo()”?

      Answer: print is a function,echo is a language construct

      【公司面試題之:新浪pHp工程師筆試題】

      1. 寫一個(gè)函數(shù),盡可能高效的,從一個(gè)標(biāo)準(zhǔn) url 里取出文件的擴(kuò)展名

      例如: http://sina.cn/abc/de/fg.php?id=1 需要取出 php 或 .php

      2. 在 HTML 語言中,頁面頭部的 meta 標(biāo)記可以用來輸出文件的編碼格式,以下是一個(gè)標(biāo)準(zhǔn)的 meta 語句

      請(qǐng)使用 pHp 語言寫一個(gè)函數(shù),把一個(gè)標(biāo)準(zhǔn) HTML 頁面中的類似 meta 標(biāo)記中的 charset 部分值改為 big5

      請(qǐng)注意:

      (1) 需要處理完整的 html 頁面,即不光此 meta 語句

      (2) 忽略大小寫

      (3) ‘和” 在此處是可以互換的

      (4) ‘Content-Type’ 兩側(cè)的引號(hào)是可以忽略的,但 ‘text/html; charset=gbk’ 兩側(cè)的不行

      (5) 注意處理多余空格

      3. 寫一個(gè)函數(shù),算出兩個(gè)文件的相對(duì)路徑

      【國內(nèi)著名互聯(lián)網(wǎng)企業(yè)PHP筆試試題】相關(guān)文章:

      求職筆試題12-23

      中國鐵塔筆試試題03-25

      華為硬件筆試題目08-11

      學(xué)生會(huì)的筆試題目08-04

      人力資源經(jīng)理筆試題03-25

      專業(yè)公司的求職筆試題12-27

      學(xué)生會(huì)招新筆試題目09-14

      百度產(chǎn)品運(yùn)營崗筆試題12-15

      農(nóng)發(fā)行筆試題[修改版]03-29

      財(cái)務(wù)分析筆試題目07-25