forked from Advanced-Frontend/Daily-Interview-Question
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.md
231 lines (136 loc) · 4.62 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# Daily-Interview-Question
加入前端「壹题」学习小组,尽在公众号「高级前端进阶」,进阶共勉之!
工作日每天一道大厂前端面试题,一年后再回头,会感谢曾经努力的自己!
<br/>
## 今日面试题
2019-07-18
> 第 108 题:请写出如下代码的打印结果
>
> ```js
> var name = 'Tom';
> (function() {
> if (typeof name == 'undefined') {
> var name = 'Jack';
> console.log('Goodbye ' + name);
> } else {
> console.log('Hello ' + name);
> }
> })();
> ```
公司:京东
解析:[第 108 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/190)
<br/>
## 本周汇总
2019-07-17
> 第 107 题:考虑到性能问题,如何快速从一个巨大的数组中随机获取部分元素。
>
> 比如有个数组有100K个元素,从中不重复随机选取10K个元素。
解析:[第 107 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/187)
<br/>
2019-07-16
> 第 106 题:分别写出如下代码的返回值
>
> ```js
> String('11') == new String('11');
> String('11') === new String('11');
> ```
公司:京东
解析:[第 106 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/180)
<br/>
2019-07-15
> 第 105 题:编程题
>
> url有三种情况
>
> ```js
> https://www.xx.cn/api?keyword=&level1=&local_batch_id=&elective=&local_province_id=33
> https://www.xx.cn/api?keyword=&level1=&local_batch_id=&elective=800&local_province_id=33
> https://www.xx.cn/api?keyword=&level1=&local_batch_id=&elective=800,700&local_province_id=33
> ```
>
> 匹配elective后的数字输出(写出你认为的最优解法):
>
> ```js
> [] || ['800'] || ['800','700']
> ```
解析:[第 105 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/177)
<br/>
2019-07-12
> 第 104 题:模拟 localStorage 时如何实现过期时间功能
公司:阿里
解析:[第 104 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/171)
<br/>
2019-07-11
> 第 103 题:模拟实现一个 localStorage
公司:阿里
解析:[第 103 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/166)
<br/>
2019-07-10
> 第 102 题:不用加减乘除运算符,求整数的7倍
解析:[第 102 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/161)
<br/>
2019-07-09
> 第 101 题:修改以下 print 函数,使之输出 0 到 99,或者 99 到 0
>
> 要求:
>
> 1、只能修改 `setTimeout` 到 `Math.floor(Math.random() * 1000` 的代码
>
> 2、不能修改 `Math.floor(Math.random() * 1000`
>
> 3、不能使用全局变量
>
> ```js
> function print(n){
> setTimeout(() => {
> console.log(n);
> }, Math.floor(Math.random() * 1000));
> }
> for(var i = 0; i < 100; i++){
> print(i);
> }
> ```
公司:头条
解析:[第 101 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/158)
<br/>
2019-07-08
> 第 100 题:请写出如下代码的打印结果
>
> ```js
> function Foo() {
> Foo.a = function() {
> console.log(1)
> }
> this.a = function() {
> console.log(2)
> }
> }
> Foo.prototype.a = function() {
> console.log(3)
> }
> Foo.a = function() {
> console.log(4)
> }
> Foo.a();
> let obj = new Foo();
> obj.a();
> Foo.a();
> ```
公司:京东
解析:[第 100 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/155)
<br/>
## 所有面试题汇总
- [壹题所有题目及答案汇总](https://github.com/Advanced-Frontend/Daily-Interview-Question/blob/master/datum/summary.md)
<br/>
## 半月刊
- [前端 100 问:能搞懂 80% 的请把简历给我](https://github.com/yygmind/blog/issues/43)
- [【半月刊 1】前端高频面试题及答案汇总](https://juejin.im/post/5c6977e46fb9a049fd1063dc)
- [【半月刊 2】前端高频面试题及答案汇总](https://juejin.im/post/5c7bd72ef265da2de80f7f17)
- [【半月刊 3】前端高频面试题及答案汇总](https://juejin.im/post/5c9ac3f66fb9a070e056718f)
- [【半月刊 4】前端高频面试题及答案汇总](https://juejin.im/post/5cb3376bf265da039c0543da)
<br/>
## 交流
进阶系列文章汇总如下,觉得不错点个 star,欢迎 **加群** 互相学习。
> [https://github.com/yygmind/blog](https://github.com/yygmind/blog)
我是木易杨,公众号「高级前端进阶」作者,跟着我**每周重点攻克一个前端面试重难点**。接下来让我带你走进高级前端的世界,在进阶的路上,共勉!
