面试小记

  1. js this的作用域
    A function’s this keyword behaves a little differently in JavaScript compared to other languages. It also has some differences between strict mode and non-strict mode.

  2. 内连接&左连接的区别
    例子:


a表 id name b表 id job parent_id
1 张3 1 23 1
2 李四 2 34 2
3 王武 3 34 4
a.id同parent_id 存在关系


1) 内连接
select a.,b. from a inner join b on a.id=b.parent_id
结果是
1 张3 1 23 1
2 李四 2 34 2

2)左连接
select a.,b. from a left join b on a.id=b.parent_id
结果是
1 张3 1 23 1
2 李四 2 34 2
3 王武 null

3) 右连接
select a.,b. from a right join b on a.id=b.parent_id
结果是
1 张3 1 23 1
2 李四 2 34 2
null 3 34 4

4) 完全连接
select a.,b. from a full join b on a.id=b.parent_id

结果是
1 张3 1 23 1
2 李四 2 34 2
null    3 34 4
3 王武 null

  1. => in coffee script
    The fat arrow => can be used to both define a function, and to bind it to the current value of this, right on the spot. This is helpful when using callback-based libraries like Prototype or jQuery, for creating iterator functions to pass to each, or event-handler functions to use with bind. Functions created with the fat arrow are able to access properties of the this where they’re defined.

  2. 浅拷贝和深拷贝
    这个问题我跟面试官聊,感觉他是不是有对这个概念理解有点过头了。
    Shallow copies duplicate as little as possible. A shallow copy of a collection is a copy of the collection structure, not the elements. With a shallow copy, two collections now share the individual elements.

Deep copies duplicate everything. A deep copy of a collection is two collections with all of the elements in the original collection duplicated.

以上为一次阿里小记

Mongodb本质存储的是什么

http://stackoverflow.com/questions/337878/var-self-this