一道RAID面试题】的更多相关文章

有一道 JavaScript 面试题. f = function () { return true; }; g = function () { return false; }; (function() { if (g() && [] == ![]) { f = function () { return false; }; function g() { return true; } } })(); console.info(f()); 首先看前两行 var f = function () {…
一道sql面试题(查询语句)   id name age 1  a        11 2  b        11 3  c        12 4  d        13 5  e        12 . . . 查询age唯一的那一个 这个应该怎么写 满意答案 热心问友 2010-10-14 select * from table1 where id not in (select age from table1 group by age having count(1)>1)   --Up…
一道经典面试题-----setTimeout(function(){},0) 转载: http://www.w3cfuns.com/notes/17398/e8a1ce8f863e8b5abb530069b388a158/page/3.html#tagsbar 先看题: for (var i = 0; i < 3; i++) { setTimeout(function() { console.log(i); }, 0); console.log(i); } 结果是:0 1 2 3 3 3 很多公…
无意间,看到这么一道Python面试题:以下代码将输出什么? def testFun():    temp = [lambda x : i*x for i in range(4)]    return temp for everyLambda in testFun():    print (everyLambda(2)) 脑中默默一想,这还用说么,肯定是: 0 2 4 6 最后一看答案,竟然是: 6 6 6 6 于是带着怀疑的心态(其实是不服输,不认错),打开编辑器,快速一敲,果然是. ​ 怀疑…
这段时间一直在研究设计模式,在看工厂模式的时候,看到一段代码 VehicleFactory.prototype.createVehicle = function ( options ) { if( options.vehicleType === "car" ){ this.vehicleClass = Car; }else{ this.vehicleClass = Truck; } return new this.vehicleClass( options ); }; 对这段代码最后的…
前言 这篇博客九月就想写了,因为赶项目拖了到现在,抓住17年尾巴写吧~ 正文 上次看了一篇 <从一道网易面试题浅谈OC线程安全> 的博客,主要内容是: 作者去网易面试,面试官出了一道面试题:下面代码会发生什么问题? @property (nonatomic, strong) NSString *target; //.... dispatch_queue_t queue = dispatch_queue_create("parallel", DISPATCH_QUEUE_CO…
这是一道面试题,问程序最终输出几个“-”: #include<stdio.h> #include<sys/types.h> #include<unistd.h> int main() { int i; ; i < ; i++) { fork(); printf("-"); } wait(NULL); ; } 正确答案是8个,关键在于prinf("-")只是将字符放到了进程的缓冲区而不输出,而fork在产生子进程的时候,会把父…
一道面试题,以下程序的输出是? public class StaticDispatch { static abstract class Human{ } static class Man extends Human{ } static class Woman extends Human{ } public void sayHello(Human guy){ System.out.println("hello , guy!"); } public void sayHello(Man gu…
function Parent() { this.a = 1; this.b = [1, 2, this.a]; this.c = { demo: 5 }; this.show = function () { console.log(this.a , this.b , this.c.demo ); } } function Child() { this.a = 2; this.change = function () { this.b.push(this.a); this.a = this.b.…