设为首页 加入收藏

TOP

2011-06-01 面试总结 中关村附近的2家公司面试
2014-11-24 00:39:16 来源: 作者: 【 】 浏览:6
Tags:2011-06-01 面试 总结 中关村 附近 公司

第一家
一进门说明来意后被领进一个小会议室做题。


1. 用至少2种方法去除一个数组中的重复元素。
arrayarray_unique ( array $array [, int $sort_flags = SORT_STRING ] )


Takes an input arrayand returns a new array without duplicate values.


Note that keys are preserved. array_unique() sorts the values treated as string at first, then will keep the first keyencountered for every value, and ignore all following keys. It does not meanthat the key of the first related value from the unsorted array will be kept.


Note: Two elementsare considered equal if and only if (string) $elem1 === (string) $elem2. Inwords: when the string representation is the same. The first element will beused.


几个要点:


除了用二重循环,第二种方法是什么呢。今天还被问了道类似的题,数据表中有个字段存放着身份证号,如何把重复出现的身份证号列出来?


2. 不借助中间变量,交换2个变量的值


3. 构造匹配<script>元素的正则表达式


4. (一维)数组排序(不能用内置函数*sort())

下一家也有这题


5. 在PHP中error_reporting()的作用

Changelog
Version
Description
5.0.0
E_STRICT introduced (not part of E_ALL).
5.2.0
E_RECOVERABLE_ERROR introduced.
5.3.0
E_DEPRECATED and E_USER_DEPRECATED introduced.


6. 请说明在开发过程中用什么方法来加快页面的加载速度。
(这回倒是一下想起缓存来了)。以下摘抄O’Reilly出版的《高性能网站建设指南》中的14条准则:


7. HTTP中几个回应状态码的含义。


8. 写出遍历根目录下所有文件的程序。
这道题下一家也考了。


9. 根据题目要求设计用户类。其中包括登录功能(方法)。
< php
classUser {


// properties


public function login() {
$username = $this->username;
$password = $this->password;


把$username和$password作为login()的参数,就是披着面向对象的外衣干着面向过程的“勾当”。


第二部分是数据库


ALTER语句还是不熟悉啊。这回倒没写成ALERT。


下面是道好题:


比较MyISAM和InnoDB。
除了有无外键约束深有体会以外,剩下的还是不知道。


第三部分是最不喜欢的逻辑题。
1. 用5L和6L的桶如何从小河中灌来3L的水。
2. 分马。17匹马,分给第一个人总数的1/2;第二个人分得1/3,第三个人分得1/9。


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇软件测试LoadRunner面试题:How d.. 下一篇Web开发笔试题

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·如何理解智能指针? (2025-12-24 12:48:26)
·c++是否应避免使用普 (2025-12-24 12:48:23)
·如何通俗易懂学会 C+ (2025-12-24 12:48:21)
·在 C 语言函数中,如 (2025-12-24 12:19:41)
·C盘里面的AppData文 (2025-12-24 12:19:38)