{"id":13490135,"url":"https://github.com/Advanced-Frontend/Daily-Interview-Question","last_synced_at":"2025-03-28T05:31:57.580Z","repository":{"id":37414899,"uuid":"166535974","full_name":"Advanced-Frontend/Daily-Interview-Question","owner":"Advanced-Frontend","description":"我是依扬（木易杨），公众号「高级前端进阶」作者，每天搞定一道前端大厂面试题，祝大家天天进步，一年后会看到不一样的自己。","archived":false,"fork":false,"pushed_at":"2020-11-09T01:07:00.000Z","size":199,"stargazers_count":27470,"open_issues_count":264,"forks_count":3288,"subscribers_count":1005,"default_branch":"master","last_synced_at":"2025-03-25T20:15:29.538Z","etag":null,"topics":["css","interview","javascript","react","vue"],"latest_commit_sha":null,"homepage":"https://muyiy.cn/question/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Advanced-Frontend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-19T10:49:00.000Z","updated_at":"2025-03-25T14:13:34.000Z","dependencies_parsed_at":"2022-08-08T20:15:40.108Z","dependency_job_id":null,"html_url":"https://github.com/Advanced-Frontend/Daily-Interview-Question","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advanced-Frontend%2FDaily-Interview-Question","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advanced-Frontend%2FDaily-Interview-Question/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advanced-Frontend%2FDaily-Interview-Question/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advanced-Frontend%2FDaily-Interview-Question/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Advanced-Frontend","download_url":"https://codeload.github.com/Advanced-Frontend/Daily-Interview-Question/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245978200,"owners_count":20703675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","interview","javascript","react","vue"],"created_at":"2024-07-31T19:00:41.332Z","updated_at":"2025-03-28T05:31:57.560Z","avatar_url":"https://github.com/Advanced-Frontend.png","language":"JavaScript","readme":"# Daily-Interview-Question\n\n加入「前端面试互助群」学习小组，搜索公众号「高级前端进阶」，关注即可加入！\n\n工作日每天一道大厂前端面试题，一年后再回头，会感谢曾经努力的自己！\n\n[线上版本阅读更流畅，点击阅读](https://muyiy.cn/question/)\n\n\u003cbr/\u003e\n\n\n\n[推荐一个不错的前端算法系列，点击查看](https://github.com/sisterAn/JavaScript-Algorithms)\n\n\u003cbr/\u003e\n\n\n\n推荐扫码使用微信小程序，除了本项目之外，还囊括了算法题、选择题等多种类型题目和详细解析\n\n记住我们的 Slogan：上下班路上刷一点，半年突击进大厂\n\n\n\n\u003cimg src=\"http://resource.muyiy.cn/image/20200106214930.jpg\" height=\"250px\"\u003e\n\n\u003cbr/\u003e\n\n\n\n\n## 今日面试题\n\n第 162 题：实现对象的 Map 函数类似 Array.prototype.map\n\n解析：[第 162 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/431)\n\n\u003cbr/\u003e\n\n\n\n\n## 最近汇总\n\n第 161 题：用最精炼的代码实现数组非零非负最小值 index \n\n```js\n// 例如：[10,21,0,-7,35,7,9,23,18] 输出 5, 7 最小\nfunction getIndex(arr){\n      let index=null;\n      ...\n      return index;\n}\n```\n\n\n解析：[第 161 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/421)\n\n\u003cbr/\u003e\n\n\n\n第 160 题：输出以下代码运行结果，为什么？如果希望每隔 1s 输出一个结果，应该如何改造？注意不可改动 square 方法\n\n```js\nconst list = [1, 2, 3]\nconst square = num =\u003e {\n  return new Promise((resolve, reject) =\u003e {\n    setTimeout(() =\u003e {\n      resolve(num * num)\n    }, 1000)\n  })\n}\n\nfunction test() {\n  list.forEach(async x=\u003e {\n    const res = await square(x)\n    console.log(res)\n  })\n}\ntest()\n```\n\n\n\n解析：[第 160 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/389)\n\n\u003cbr/\u003e\n\n\n\n第 159 题：实现 `Promise.retry`，成功后 `resolve` 结果，失败后重试，尝试超过一定次数才真正的 `reject`\n\n\n\n解析：[第 159 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/387)\n\n\u003cbr/\u003e\n\n\n\n第 158 题：如何模拟实现 Array.prototype.splice\n\n\n\n解析：[第 158 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/384)\n\n\u003cbr/\u003e\n\n\n\n第 157 题：浏览器缓存 ETag 里的值是怎么生成的\n\n解析：[第 157 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/383)\n\n\u003cbr/\u003e\n\n\n\n第 156 题：求最终 left、right 的宽度\n\n```js\n\u003cdiv class=\"container\"\u003e\n    \u003cdiv class=\"left\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"right\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n\n\u003cstyle\u003e\n  * {\n    padding: 0;\n    margin: 0;\n  }\n  .container {\n    width: 600px;\n    height: 300px;\n    display: flex;\n  }\n  .left {\n    flex: 1 2 300px;\n    background: red;\n  }\n  .right {\n    flex: 2 1 200px;\n    background: blue;\n  }\n\u003c/style\u003e\n```\n\n注：此题和 155 题 left、right 样式有些不同\n\n\n\n解析：[第 156 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/382)\n\n\u003cbr/\u003e\n\n\n\n第 155 题：求最终 left、right 的宽度\n\n```js\n\u003cdiv class=\"container\"\u003e\n    \u003cdiv class=\"left\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"right\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n\n\u003cstyle\u003e\n  * {\n    padding: 0;\n    margin: 0;\n  }\n  .container {\n    width: 600px;\n    height: 300px;\n    display: flex;\n  }\n  .left {\n    flex: 1 2 500px;\n    background: red;\n  }\n  .right {\n    flex: 2 1 400px;\n    background: blue;\n  }\n\u003c/style\u003e\n```\n\n\n\n解析：[第 155 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/381)\n\n\u003cbr/\u003e\n\n\n\n第 154 题：弹性盒子中 flex: 0 1 auto 表示什么意思\n\n解析：[第 154 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/380)\n\n\u003cbr/\u003e\n\n\n\n第 153 题：实现一个批量请求函数 multiRequest(urls, maxNum)\n\n\u2028要求如下：\n\n1. 要求最大并发数 maxNum\n\n2. 每当有一个请求返回，就留下一个空位，可以增加新的请求\n3. 所有请求完成后，结果按照 urls 里面的顺序依次打出\n\n\n\n解析：[第 153 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/378)\n\n\u003cbr/\u003e\n\n\n\n2019-12-31\n\n\u003e 第 152 题：实现一个 normalize 函数，能将输入的特定的字符串转化为特定的结构化数据\n\n\n\n解析：[第 152 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/331)\n\n\u003cbr/\u003e\n\n\n\n\n2019-11-25\n\n\u003e 第 151 题：用最简洁代码实现 indexOf 方法\n\u003e\n\n\n\n解析：[第 151 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/321)\n\n\u003cbr/\u003e\n\n\n2019-11-21\n\n\u003e 第 150 题：二分查找如何定位左边界和右边界\n\u003e\n\u003e 不使用JS数组API，查找有序数列最先出现的位置和最后出现的位置\n\n\n\n解析：[第 150 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/320)\n\n\u003cbr/\u003e\n\n\n\n2019-11-12\n\n\u003e 第 149 题：babel 怎么把字符串解析成 AST，是怎么进行词法/语法分析的？\n\n解析：[第 149 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/315)\n\n\u003cbr/\u003e\n\n\n\n2019-11-01\n\n\u003e 第 148 题： webpack 中 loader 和 plugin 的区别是什么（平安）\n\n\n\n解析：[第 148 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/308)\n\n\u003cbr/\u003e\n\n\n\n2019-10-31\n\n\u003e 第 147 题：v-if、v-show、v-html 的原理是什么，它是如何封装的？\n\n\n\n解析：[第 147 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/307)\n\n\u003cbr/\u003e\n\n\n\n2019-10-29\n\n\u003e 第 146 题：Vue 中的 computed 和 watch 的区别在哪里（虾皮）\n\n\n\n解析：[第 146 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/304)\n\n\u003cbr/\u003e\n\n\n\n2019-10-24\n\n\u003e 第 145 题：前端项目如何找出性能瓶颈（阿里）\n\n\n\n解析：[第 145 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/300)\n\n\u003cbr/\u003e\n\n\n\n2019-10-22\n\n\u003e 第 144 题：手写二进制转 Base64（阿里）\n\n\n\n解析：[第 144 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/299)\n\n\u003cbr/\u003e\n\n\n\n2019-10-21\n\n\u003e 第 143 题：将 '10000000000' 形式的字符串，以每 3 位进行分隔展示 '10.000.000.000'\n\n\n\n解析：[第 143 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/296)\n\n\u003cbr/\u003e\n\n\n\n2019-10-17\n\n\u003e 第 142 题：（算法题）求多个数组之间的交集（阿里）\n\n\n\n解析：[第 142 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/293)\n\n\u003cbr/\u003e\n\n\n\n2019-10-15\n\n\u003e 第 141 题：Vue 中的 computed 是如何实现的（腾讯、平安）\n\n\n\n解析：[第 141 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/291)\n\n\u003cbr/\u003e\n\n\n\n2019-10-14\n\n\u003e 第 140 题：为什么 HTTP1.1 不能实现多路复用（腾讯）\n\n\n\n解析：[第 140 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/290)\n\n\u003cbr/\u003e\n\n\n\n2019-09-17\n\n\u003e 第 139 题：谈一谈 nextTick 的原理\n\n\n\n解析：[第 139 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/281)\n\n\u003cbr/\u003e\n\n\n\n2019-09-11\n\n\u003e 第 138 题：反转链表，每 k 个节点反转一次，不足 k 就保持原有顺序（哔哩哔哩）\n\n\n\n解析：[第 138 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/278)\n\n\u003cbr/\u003e\n\n\n\n2019-09-04\n\n\u003e 第 137 题：如何在 H5 和小程序项目中计算白屏时间和首屏时间，说说你的思路\n\n\n\n解析：[第 137 题](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/272)\n\n\u003cbr/\u003e\n\n\n\n\n## 所有面试题汇总\n\n-   [壹题所有题目及答案汇总](https://github.com/Advanced-Frontend/Daily-Interview-Question/blob/master/datum/summary.md)\n\n\u003cbr/\u003e\n\n\n\n## 半月刊\n\n- [前端 100 问：能搞懂 80% 的请把简历给我](https://github.com/yygmind/blog/issues/43)\n- [【半月刊 1】前端高频面试题及答案汇总](https://juejin.im/post/5c6977e46fb9a049fd1063dc)\n- [【半月刊 2】前端高频面试题及答案汇总](https://juejin.im/post/5c7bd72ef265da2de80f7f17)\n- [【半月刊 3】前端高频面试题及答案汇总](https://juejin.im/post/5c9ac3f66fb9a070e056718f)\n- [【半月刊 4】前端高频面试题及答案汇总](https://juejin.im/post/5cb3376bf265da039c0543da)\n\n\u003cbr/\u003e\n\n\n\n## 联系我\n\n进阶系列文章汇总如下，觉得不错点个 star，欢迎 **加群** 互相学习。\n\n\u003e [https://github.com/yygmind/blog](https://github.com/yygmind/blog)\n\n我是木易杨，公众号「高级前端进阶」作者，跟着我**每周重点攻克一个前端面试重难点**。接下来让我带你走进高级前端的世界，在进阶的路上，共勉！\n\n![image](http://resource.muyiy.cn/image/20200123162151.png)\n","funding_links":[],"categories":["JavaScript","Uncategorized","Code","前端","知识库/教程","目录","七、GitHub 优质仓库精选","inbox","前端开发框架及项目","面试相关"],"sub_categories":["Uncategorized","library/repositories","面试","其他_文本生成、文本对话"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAdvanced-Frontend%2FDaily-Interview-Question","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAdvanced-Frontend%2FDaily-Interview-Question","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAdvanced-Frontend%2FDaily-Interview-Question/lists"}