{"id":602,"date":"2022-11-25T12:36:26","date_gmt":"2022-11-25T04:36:26","guid":{"rendered":"https:\/\/twocups.cn\/?p=602"},"modified":"2023-10-23T01:42:40","modified_gmt":"2023-10-22T17:42:40","slug":"48","status":"publish","type":"post","link":"https:\/\/twocups.cn\/index.php\/2022\/11\/25\/48\/","title":{"rendered":"\u3010\u6c42\u804c\u3011\u8bb0\u5f55\u81ea\u5df1\u9762\u8bd5Google\u7684\u7ecf\u5386\u4e0e\u7ecf\u9a8c"},"content":{"rendered":"\n<p><img width=\"80\" src=\"https:\/\/twocups.cn\/wp-content\/uploads\/2019\/12\/logo\u6a2a.png\" alt=\"\">\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\uff1a<a href=\"https:\/\/twocups.cn\/index.php\/2022\/11\/25\/48\/\">https:\/\/twocups.cn\/index.php\/2022\/11\/25\/48\/<\/a><\/p>\n\n\n\n<h2>\u9762\u8bd5\u5185\u5bb9\u4ecb\u7ecd<\/h2>\n\n\n\n<p>\u6211\u6700\u8fd1\u9762\u4e86Google\uff0c\u8ba4\u4e3a\u8fd9\u662f\u4e00\u6b21\u5f88\u68d2\u7684\u9762\u8bd5\u4f53\u9a8c\uff0c\u6240\u4ee5\u8bb0\u5f55\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>2022\u5e747\u670815\u65e5\uff0c\u6211\u5728Google\u7684\u62db\u8058\u5b98\u7f51\u4e0a\u6295\u9012\u4e86\u81ea\u5df1\u7684\u7b80\u5386\u3002<\/p>\n\n\n\n<p>2022\u5e749\u67089\u65e5\uff0cGoogle\u7684HR\u52a0\u4e86\u6211\u7b80\u5386\u4e0a\u7684\u5fae\u4fe1\uff0c\u8ddf\u6211\u8bf4\u6700\u8fd1Google\u4e0a\u6d77\u8fd9\u8fb9\u5f00\u4e86\u4e00\u4e9b\u5c97\u4f4d\u51fa\u6765\uff0c\u95ee\u6211\u6709\u6ca1\u6709\u5174\u8da3\u3002\u6700\u7ec8\u5411\u6211\u53d1\u8d77\u9762\u8bd5\u9080\u8bf7\u7684\u662f\u4e0a\u6d77\u7684<strong>Pixel<\/strong>\u90e8\u95e8\uff0c\u4e3b\u8425\u4e1a\u52a1\u662f\u65e0\u7ebf\u901a\u4fe1\u3002\u6b63\u597d\u6211\u672c\u79d1\u7684\u4e13\u4e1a\u5c31\u662f\u901a\u4fe1\uff0c\u5bf9\u8fd9\u4e2a\u8fd8\u633a\u611f\u5174\u8da3\u7684\uff0c\u5c31\u63a5\u53d7\u4e86\u3002<\/p>\n\n\n\n<p>Google\u7684\u9762\u8bd5\u662f\u6211\u6240\u6709\u7ecf\u5386\u8fc7\u7684\u9762\u8bd5\u4e2d\u6700\u6807\u51c6\u7684\uff0c\u4e00\u573a\u662f45\u5206\u949f\u3002\u6211\u9762\u8bd5\u7684\u90e8\u95e8\u6240\u4f7f\u7528\u7684\u8bed\u8a00\u662fC++\uff0c\u4f46\u9762\u8bd5\u4e2d\u7684\u7f16\u7a0b\u8bed\u8a00\u662f\u4e0d\u53d7\u9650\u5236\u7684\uff0c\u6240\u4ee5\u6211\u5c31\u7528\u6211\u6700\u719f\u6089\u7684Golang\u6765\u89e3\u9898\u3002\u9762\u8bd5\u7c7b\u578b\u5206\u4e3a\u4e24\u79cd\uff0c\u4e00\u79cd\u662f<strong>Coding\u9762\u8bd5<\/strong>\uff0c\u53e6\u4e00\u79cd\u662f<strong>Googleyness &amp; Leadership<\/strong>\uff08\u4ee5\u4e0b\u7b80\u79f0G&amp;L\uff09\u9762\u8bd5\u3002Coding\u9762\u8bd5\u4e3b\u8981\u5c31\u662f\u9488\u5bf9\u9762\u8bd5\u5b98\u63d0\u51fa\u7684\u4e00\u4e2a\u60c5\u666f\uff0c\u81ea\u5df1\u7f16\u5199\u4e00\u4e2a\u7b97\u6cd5\u6765\u89e3\u51b3\u95ee\u9898\u3002\u901a\u5e38\u9762\u8bd5\u5b98\u4f1a\u5148\u7ed9\u51fa\u4e00\u4e2a\u6bd4\u8f83\u7b80\u5355\u7684\u95ee\u9898\uff0c\u7136\u540e\u5728\u6b64\u57fa\u7840\u4e0a\u9010\u6b65\u53d8\u96be\u3002\u800cG&amp;L\u9762\u8bd5\u8003\u5bdf\u7684\u662f\u4e2a\u4eba\u7684\u8f6f\u80fd\u529b\uff0c\u662f\u7eaf\u804a\u5929\uff0c\u53ea\u4e0d\u8fc7\u804a\u7684\u90fd\u662f\u4e13\u4e1a\u6027\u7684\u5185\u5bb9\u3002<\/p>\n\n\n\n<p>\u6211\u7ecf\u5386\u7684\u9762\u8bd5\u4e00\u5171\u4e94\u8f6e\u3002<\/p>\n\n\n\n<p>2022\u5e749\u670827\u65e5\uff0c\u4e00\u573a\u521d\u8bd5\uff0c\u4e2d\u6587\uff0ccoding\u9762\u8bd5\u3002<\/p>\n\n\n\n<p>2022\u5e7410\u670813\u65e5\u548c14\u65e5\uff0c\u56db\u573a\u590d\u8bd5\uff0c\u4e24\u82f1\u6587\u4e24\u4e2d\u6587\uff0c\u4e09\u8f6ecoding\u9762\u8bd5\u548c\u4e00\u8f6eG&amp;L\u9762\u8bd5\u3002<\/p>\n\n\n\n<p>2022\u5e7411\u670828\u65e5\uff0cHiring Team\u7684\u53cd\u9988\u662f\u5de5\u7a0b\u80fd\u529b\u548c\u9762\u8bd5\u8868\u73b0\u90fd\u5f88\u4f18\u79c0\uff0c\u4f46\u76ee\u524d\u4ed6\u4eec\u66f4\u52a0\u671f\u5f85\u6709\u6570\u636e\u4ed3\u5e93\u80cc\u666f\u7684\u5019\u9009\u4eba\uff0c\u6240\u4ee5\u6bd4\u8f83\u9057\u61be\u6ca1\u80fd\u62ff\u5230Google\u7684Offer\u3002<\/p>\n\n\n\n<h2>\u9762\u8bd5\u7ecf\u9a8c<\/h2>\n\n\n\n<p>\u5c31\u6211\u4e2a\u4eba\u611f\u53d7\u800c\u8a00\uff0cGoogle\u7684\u9762\u8bd5\u660e\u663e\u6bd4\u6211\u4e4b\u524d\u9762\u7684\u5fae\u8f6f\u548cAWS\u8981<strong>\u96be<\/strong>\u5f88\u591a\u3002Google\u66f4\u770b\u91cd\u7684\u662f\u9762\u8bd5\u8005\u7684<strong>\u601d\u7ef4\u80fd\u529b\u548c\u6c9f\u901a\u80fd\u529b<\/strong>\uff0c\u800c\u4e0d\u662f\u5355\u7eaf\u5730\u770b\u9762\u8bd5\u8005\u80fd\u4e0d\u80fd\u628a\u9898\u76ee\u76f4\u63a5\u505a\u51fa\u6765\uff08\u5f53\u7136\u4f60\u5fc5\u987b\u4e5f\u8981\u505a\u51fa\u6765\uff09\u3002\u5982\u679c\u601d\u8def\u4e0a\u9047\u5230\u5361\u58f3\uff0c\u662f\u53ef\u4ee5\u8ddf\u9762\u8bd5\u5b98\u8981\u601d\u8def\u7684\u3002\u4e0d\u8981\u60f3\u7740\u4e00\u6b21\u5c31\u76f4\u63a5\u60f3\u5230\u5b8c\u7f8e\u7684\u89e3\u51b3\u65b9\u6cd5\uff0c\u4e0d\u592a\u73b0\u5b9e\u3002\u6bd5\u7adfGoogle\u662f\u6709\u81ea\u5df1\u5b9e\u65f6\u66f4\u65b0\u7684\u9898\u5e93\u7684\uff0c\u5982\u679c\u5728\u7f51\u4e0a\u770b\u5230\u9898\u76ee\u88ab\u6cc4\u9732\uff0c\u9898\u5e93\u4e2d\u4f1a\u5220\u9664\u76f8\u5e94\u7684\u9898\u76ee\uff0c\u6240\u4ee5\u4e0d\u592a\u53ef\u80fd\u9047\u5230\u539f\u9898\u3002\u6b63\u786e\u7684\u505a\u6cd5\u662f\u4ece\u57fa\u7840\u4e00\u6b65\u4e00\u6b65\u63a8\u7b97\uff0c\u4e0d\u7528\u4e00\u6b21\u5c31\u60f3\u7684\u5b8c\u7f8e\uff0c\u4f46\u8981\u6700\u7ec8\u5168\u90e8\u60f3\u6e05\u695a\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u4e5f\u5e94\u8be5\u8ddf\u9762\u8bd5\u5b98\u5168\u7a0b\u4ea4\u6d41\uff0c\u540c\u65f6\u9a8c\u8bc1\u81ea\u5df1\u7684\u60f3\u6cd5\u3002<\/p>\n\n\n\n<p><strong>\u62ff\u5230\u9898\u76ee\u4e4b\u540e\u8be5\u5982\u4f55\u601d\u8003\u5462\uff1f<\/strong><\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u6211\u4f1a\u53bb\u8003\u8651\u9898\u76ee\u7684<strong>\u7b97\u6cd5\u7c7b\u578b<\/strong>\u3002\u5e38\u7528\u7684\u7b97\u6cd5\u7c7b\u578b\u6709\u6570\u7ec4\u5904\u7406\u3001\u5b57\u7b26\u4e32\u5904\u7406\u3001\u4e8c\u5206\uff08\u6574\u6570\/\u5c0f\u6570\uff0c\u7cbe\u786e\u67e5\u627e\/\u8303\u56f4\u67e5\u627e\uff09\u3001\u53cc\/\u591a\u6307\u9488\u3001\u6570\u5b66\u8ba1\u7b97\u3001\u4f4d\u8fd0\u7b97\u3001\u7279\u6b8a\u6570\u636e\u7ed3\u6784\uff08\u94fe\u8868\/\u6808\/\u6ed1\u52a8\u7a97\u53e3\/\u5806\/\u5355\u8c03\u6808\/HashMap\/Trie\/\u5e76\u67e5\u96c6\uff09\u3001\u6811\/\u56fe\u3001DFS\u3001BFS\u3001\u52a8\u6001\u89c4\u5212\uff08\u7ebf\u6027\/\u533a\u95f4\/\u6570\u4f4d\u7edf\u8ba1\/\u72b6\u6001\u538b\u7f29\/\u6811\u5f62\/\u8bb0\u5fc6\u5316\u641c\u7d22\uff09\u3001\u8d2a\u5fc3\u3002<\/p>\n\n\n\n<p>\u901a\u5e38\u6765\u8bf4\uff0c\u77e5\u9053\u7b97\u6cd5\u7c7b\u578b\u4e4b\u540e\u5e94\u8be5\u80fd\u60f3\u5230\u6700\u57fa\u7840\u7684\u66b4\u529b\u89e3\u6cd5\u3002\u4e4b\u540e\uff0c\u6211\u4f1a\u8ba1\u7b97\u51fa\u8fd9\u4e2a\u89e3\u6cd5\u7684\u65f6\u95f4\u548c\u7a7a\u95f4\u590d\u6742\u5ea6\uff0c\u7136\u540e\u4f18\u5316\u7b97\u6cd5\u3002\u4f18\u5316\u7b97\u6cd5\u7684\u65f6\u5019\u53ef\u4ee5\u8003\u8651\u5148\u964d\u4f4e\u65f6\u95f4\u590d\u6742\u5ea6\uff0c\u5982\u679c\u4e0d\u884c\u518d\u8003\u8651\u964d\u4f4e\u7a7a\u95f4\u590d\u6742\u5ea6\u3002\u5982\u679c\u6211\u80fd\u731c\u5230<strong>\u6700\u4f18\u7684\u65f6\u95f4\u590d\u6742\u5ea6<\/strong>\uff0c\u90a3\u4e48\u6211\u5c31\u80fd\u9006\u63a8\u51fa\u7b97\u6cd5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u65f6\u95f4\u590d\u6742\u5ea6\u4e00\u822c\u6709\u4e09\u79cd\u3002<br>O(logn) \u4e8c\u5206\u3001\u53cc\u6307\u9488<br>O(n) \u904d\u5386\u3001\u6ed1\u52a8\u7a97\u53e3\u3001\u5355\u8c03\u6808\u3001\u7ebf\u6bb5\u6811\u3001\u4e00\u7ef4\u6570\u7ec4DP<br>O(n^2) \u53cc\u6307\u9488<\/pre>\n\n\n\n<p>\u5982\u679c\u9762\u8bd5\u5b98\u5728\u63cf\u8ff0\u9898\u76ee\u7684\u65f6\u5019\u63d0\u9192\u4f60\uff0c\u7531\u4e8e\u7b54\u6848\u53ef\u80fd\u4f1a\u5f88\u5927\uff0c\u6240\u4ee5\u4f60\u9700\u8981\u53d6\u4f59\u540e\u8f93\u51fa\uff0c\u90a3\u4e48\u8fd9\u53e5\u8bdd\u7684\u610f\u601d\u662f\u7528\u5230\u4e86\u7d2f\u52a0\/\u7d2f\u4e58\u3002\u7d2f\u52a0\u4e00\u822c\u4f1a\u662f\u7ec4\u5408\u516c\u5f0f\uff0c\u6216\u8005\u4e8c\u7ef4DP\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u4ecd\u7136\u6ca1\u6709\u89e3\u9898\u601d\u8def\u7684\u8bdd\uff0c\u63a5\u4e0b\u6765\u6211\u4f1a\u91c7\u53d6\u5c06\u9898\u76ee<strong>\u964d\u7ef4<\/strong>\u7684\u7b56\u7565\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u5148\u4fee\u6539\u9898\u76ee\uff0c\u628a\u9898\u76ee\u53d8\u5f97\u7b80\u5355\uff0c\u5f97\u5230\u6700\u4f18\u89e3\u540e\uff0c\u518d\u4e00\u6b65\u4e00\u6b65\u5730\u5c06\u9898\u76ee\u53d8\u56de\u539f\u6765\u7684\u96be\u5ea6\u3002\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u6211\u5c31\u53ef\u4ee5\u6e05\u6670\u5730\u77e5\u9053\u662f\u4ec0\u4e48\u5728\u963b\u6320\u6211\u89e3\u9898\uff0c\u7136\u540e\u9010\u4e2a\u51fb\u7834\u5c31\u597d\u4e86\u3002<\/p>\n\n\n\n<p>\u8fd8\u6709\u4e00\u4e2a\u96be\u70b9\u5c31\u662f\u52a8\u6001\u89c4\u5212\u3002\u6211\u4f1a\u5148\u5047\u8bbe\u6211\u5df2\u7ecf\u5f97\u5230\u4e86\u8fd9\u4e2a\u52a8\u6001\u89c4\u5212\u7684\u72b6\u6001\u8f6c\u79fb\u65b9\u7a0b\uff0c\u90a3\u4e48\u5982\u679c\u72b6\u6001\u6570\u7ec4\u7684\u957f\u5ea6\u4ecen\u53d8\u6210\u4e86n+1\uff0c\u90a3\u4e48\u591a\u51fa\u6765\u7684\u90a3\u4e2a\u72b6\u6001\u4f1a\u5bf9\u6574\u4f53\u7684\u7ed3\u679c\u9020\u6210\u4ec0\u4e48\u5f71\u54cd\u5462\uff1f\u53ea\u8981\u60f3\u660e\u767d\u8fd9\u70b9\uff0c\u5c31\u76f8\u5f53\u4e8e\u77e5\u9053\u6570\u7ec4\u7684\u60c5\u51b5\uff08\u72b6\u6001\uff09\u662f\u5982\u4f55\u53d8\u5316\uff08\u8f6c\u79fb\uff09\u7684\uff0c\u72b6\u6001\u8f6c\u79fb\u65b9\u7a0b\u81ea\u7136\u5c31\u51fa\u6765\u4e86\u3002\u6211\u7684\u8fd9\u79cd\u89e3\u6cd5\u5176\u5b9e\u5c31\u662f\u52a8\u6001\u89c4\u5212\u7684\u672c\u8d28\uff0c\u662f\u9700\u8981\u5927\u91cf\u7ec3\u4e60\u7684\uff0c\u4f46\u7ec3\u51fa\u6765\u4ee5\u540e\u52a8\u6001\u89c4\u5212\u95ee\u9898\u51e0\u4e4e\u90fd\u80fd\u89e3\u51b3\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u5bf9\u4e8e\u6700\u4f18\u89e3\u4ecd\u7136\u6beb\u65e0\u5934\u7eea\uff0c\u90a3\u4e48\u53ea\u80fd\u901a\u8fc7<strong>\u6a21\u62df<\/strong>\u6765\u89e3\u9898\u4e86\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u4fd7\u79f0\u7684\u66b4\u529b\u89e3\u6cd5\u3002\u6a21\u62df\u6c38\u8fdc\u662f\u6700\u540e\u4e00\u6761\u8def\uff0c\u4e0d\u5230\u4e07\u4e0d\u5f97\u5df2\u4e0d\u8981\u7528\u3002<\/p>\n\n\n\n<p><strong>\u5728Google\u7684\u80fd\u529b\u8003\u5bdf\u91cc\uff0c\u6c9f\u901a\u80fd\u529b\u548c\u89e3\u9898\u80fd\u529b\u662f\u540c\u7b49\u91cd\u8981\u7684\u3002<\/strong><\/p>\n\n\n\n<p>\u5728Coding\u9762\u8bd5\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u9700\u8981\u4e0d\u505c\u5730\u8bf4\u8bdd\uff0c\u4e0d\u505c\u5730\u5411\u9762\u8bd5\u5b98\u8868\u8fbe\u6211\u73b0\u5728\u6b63\u5728\u601d\u8003\u7684\u4e1c\u897f\u3002\u6211\u8ba4\u4e3a\u8fd9\u662f\u4e00\u4e2a<strong>\u96be\u70b9<\/strong>\uff0c\u7279\u522b\u662f\u5728\u82f1\u6587Coding\u7684\u60c5\u51b5\u4e0b\u3002\u82f1\u6587Coding\u4e2d\uff0c\u6211\u9700\u8981\u503e\u542c\u9762\u8bd5\u5b98\u7684\u8868\u8fbe\uff0c\u540c\u65f6\u5411\u9762\u8bd5\u5b98\u7528\u82f1\u6587\u8868\u8fbe\u6211\u81ea\u5df1\u7684\u601d\u8def\uff0c\u8fd9\u4e2a\u8868\u8fbe\u7684\u8fc7\u7a0b\u6211\u8981\u5c3d\u91cf\u5730\u653e\u6162\uff0c\u56e0\u4e3a\u6211\u9700\u8981\u786e\u4fdd\u5bf9\u65b9\u80fd\u542c\u6e05\u6211\u5728\u8bf4\u4ec0\u4e48\u3002\u4f46\u662f\u6211\u8111\u4e2d\u662f\u7528\u4e2d\u6587\u5728\u601d\u8003\u7684\uff0c\u8fd9\u4e2a\u601d\u8003\u7684\u8fc7\u7a0b\u6211\u662f\u5168\u7a0b\u52a0\u901f\u7684\uff0c\u56e0\u4e3a\u6211\u5fc5\u987b\u8981\u5728\u5c3d\u91cf\u77ed\u7684\u65f6\u95f4\u5185\u60f3\u51fa\u89e3\u51b3\u95ee\u9898\u7684\u65b9\u6cd5\uff0c\u5e76\u4e14\u67e5\u6f0f\u8865\u7f3a\u3002\u8fd9\u79cd\u4e00\u5fc3\u4e8c\u7528\u7684\u80fd\u529b\u6211\u521a\u5f00\u59cb\u4e5f\u662f\u5b8c\u5168\u505a\u4e0d\u5230\uff0c\u4f46\u6b63\u5de7\u521d\u8bd5\u548c\u590d\u8bd5\u4e2d\u95f4\u9694\u4e86\u4e00\u4e2a\u56fd\u5e86\u5047\u671f\uff0c\u6240\u4ee5\u5728\u81ea\u5df1\u4e13\u95e8\u7684\u8bad\u7ec3\u540e\u4e5f\u5f88\u719f\u7ec3\u4e86\u3002\u6211\u5f53\u65f6\u7528\u7684\u662fPramp\uff0c\u8fd9\u662f\u4e00\u4e2a\u5b8c\u5168\u514d\u8d39\u7684\u6a21\u62df\u9762\u8bd5\u7f51\u7ad9\u3002\u5728\u8fd9\u91cc\u6211\u53ef\u4ee5\u4f5c\u4e3a\u9762\u8bd5\u5b98\u7ed9\u522b\u4eba\u9762\u8bd5\uff0c\u540c\u65f6\u4f5c\u4e3a\u9762\u8bd5\u8005\u63a5\u53d7\u522b\u4eba\u7684\u9762\u8bd5\u3002\u6211\u5f53\u65f6\u4e00\u5929\u7ea6\u4e94\u573a\uff0c\u5168\u82f1\u6587\u9ad8\u5f3a\u5ea6\u8bad\u7ec3\uff0c\u6548\u679c\u8fd8\u662f\u5f88\u597d\u7684\u3002<\/p>\n\n\n\n<p>\u5173\u4e8eCoding\uff0c\u6211\u6709\u4e09\u4e2a\u5efa\u8bae\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e00\uff0c\u53d8\u91cf\u540d\u4e00\u5b9a\u8981\u80fd\u4ee3\u8868\u53d8\u91cf\u7684<strong>\u542b\u4e49<\/strong>\uff0c\u8981\u8ba9\u9762\u8bd5\u5b98\u770b\u5230\u4f60\u7684\u53d8\u91cf\u540d\u5c31\u77e5\u9053\u8fd9\u4e2a\u6570\u636e\u7ed3\u6784\u4e2d\u5b58\u50a8\u7684\u662f\u4ec0\u4e48\u6570\u636e\uff0c\u5343\u4e07\u4e0d\u8981\u8d77array\u6216\u8005queue\u8fd9\u79cd\u540d\u5b57\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e8c\uff0c\u6bcf\u5199\u5b8c\u4e00\u6bb5\u4ee3\u7801\u5c31\u56de\u5934\u770b\u770b\uff0c\u4ee5\u4e00\u4e2a\u65c1\u89c2\u8005\u7684\u89c6\u89d2\u770b\u770b\u81ea\u5df1\u80fd\u4e0d\u80fd\u6e05\u695a\u5730\u7406\u89e3\u8fd9\u6bb5\u4ee3\u7801\uff0c\u95ee\u95ee\u81ea\u5df1\u8fd9\u6bb5\u4ee3\u7801\u7684\u903b\u8f91\u662f\u5426\u6e05\u6670\u3002\u8fd9\u4e48\u505a\u662f\u4e3a\u4e86\u7ef4\u62a4\u4ee3\u7801\u7684<strong>\u53ef\u8bfb\u6027<\/strong>\uff0c\u8fd9\u975e\u5e38\u91cd\u8981\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e09\uff0c<strong>\u4ee3\u7801\u89c4\u8303<\/strong>\u975e\u5e38\u91cd\u8981\uff0c\u53ef\u4ee5\u53bb\u770b\u4e0b\u81ea\u5df1\u8bed\u8a00\u7684Google\u4ee3\u7801\u89c4\u8303\u3002\u8fd8\u6709\u5c31\u662f\u521b\u5efa\u6570\u7ec4\u7684\u65f6\u5019\u5148\u7b97\u4e00\u4e0b\u8981\u7528\u591a\u5c11\u5bb9\u91cf\uff0c\u7136\u540e\u521d\u59cb\u5316\u6570\u7ec4\u7684\u65f6\u5019\u5e26\u4e0a\u521d\u59cb\u5bb9\u91cf\uff0c\u5426\u5219\u6570\u7ec4\u6269\u5bb9\u5f88\u8017\u8d39\u65f6\u95f4\u3002<\/p>\n\n\n\n<p>Google\u7684Coding\u9762\u8bd5\u6b63\u56e0\u4e3a\u6807\u51c6\uff0c\u6240\u4ee5\u6bcf\u6b21\u7684\u6d41\u7a0b\u662f\u975e\u5e38\u76f8\u4f3c\u7684\uff0c\u4e0b\u9762\u6709\u6211\u81ea\u5df1\u603b\u7ed3\u7684<strong>Coding\u9762\u8bd5\u6a21\u677f<\/strong>\u3002<\/p>\n\n\n\n<p>\u56e0\u4e3a\u5b58\u5728\u82f1\u6587Coding\uff0c\u6240\u4ee5\u5fc5\u987b\u719f\u7ec3\u638c\u63e1\u6240\u6709\u82f1\u6587\u4e2d\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5\u7684\u8868\u8fbe\uff0c\u4e0b\u9762\u6709\u6211\u81ea\u5df1\u603b\u7ed3\u7684<strong>Coding\u5355\u8bcd\u8868<\/strong>\u3002<\/p>\n\n\n\n<p>G&amp;L\u9762\u8bd5\u7684\u672c\u8d28\u662f\u770b\u4f60\u662f\u5426\u7b26\u5408Google\u7684\u4f01\u4e1a\u6587\u5316\uff0c\u5f88\u91cd\u8981\u7684\u4e00\u70b9\u662f\u4e0d\u8981\u628a\u5b83\u5f53\u6210\u8003\u8bd5\uff0c\u800c\u662f\u628a\u5b83\u5f53\u6210\u4e00\u6b21\u4ea4\u6d41\uff0c\u548c\u9762\u8bd5\u5b98\u804a\u804a\u5c31\u597d\u3002\u5f53\u7136\uff0c\u9762\u8bd5\u5b98\u90a3\u91cc\u80af\u5b9a\u662f\u6709\u8bc4\u5224\u6807\u51c6\u7684\uff0c\u6240\u4ee5\u804a\u7684\u65f6\u5019\u4e5f\u8bf7\u957f\u70b9\u5fc3\u3002<\/p>\n\n\n\n<h2>Coding\u9762\u8bd5\u6a21\u677f<\/h2>\n\n\n\n<p>\u5982\u679c\u662f\u6ca1\u6709\u9762\u8bd5\u7ecf\u9a8c\u7684\u9762\u8bd5\u8005\uff0c\u53ef\u4ee5\u4ece\u6211\u81ea\u5df1\u603b\u7ed3\u7684\u6a21\u677f\u5165\u624b\u7ec3\u4e60\u3002\u7b49\u719f\u7ec3\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u81ea\u7531\u53d1\u6325\u4e86\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6bcf\u4e2a\u65f6\u95f4\u6bb5\u9700\u8981\u505a\u7684\u4e8b\u60c5\u662f\u56fa\u5b9a\u7684\uff0c\u53ea\u662f\u81ea\u5df1\u8868\u8fbe\u7684\u65b9\u5f0f\u53ef\u4ee5\u66f4\u52a0\u81ea\u7531\u3002\u53ea\u8981\u9762\u8bd5\u5b98\u80fd\u591f\u542c\u61c2\u4f60\u5728\u8bf4\u4ec0\u4e48\uff0c\u5e76\u4e14\u6240\u6709\u7684\u6ce8\u610f\u70b9\u90fd\u63d0\u5230\u4e86\uff0c\u600e\u4e48\u8868\u8fbe\u90fd\u53ef\u4ee5\uff0c\u6ca1\u6709\u56fa\u5b9a\u53e5\u5f0f\u7684\u3002<\/p>\n\n\n\n<h3>0 ~ 10min \u542c\u9898 + Clarification Questions<\/h3>\n\n\n\n<p>\u9762\u8bd5\u5b98\u662f\u901a\u8fc7\u53e3\u8ff0\u7684\u65b9\u5f0f\u7ed9\u51fa\u9898\u76ee\uff0c\u800c\u6211\u8fd9\u91cc\u80fd\u770b\u5230\u7684\u5c31\u53ea\u6709\u4e00\u4e2a\u767d\u677f\u3002\u6240\u4ee5\u6700\u5f00\u59cb\u4e00\u5b9a\u8981\u542c\u6e05\u695a\u9898\u76ee\u63cf\u8ff0\u7684\u60c5\u666f\u548c\u8981\u6c42\u81ea\u5df1\u89e3\u51b3\u7684\u95ee\u9898\u3002\u5f53\u9762\u8bd5\u5b98\u8bf4\u5b8c\u9898\u76ee\u4e4b\u540e\uff0c\u81ea\u5df1\u4e00\u5b9a\u8981\u628a\u9898\u76ee\u518d\u590d\u8ff0\u4e00\u904d\uff0c\u548c\u9762\u8bd5\u5b98\u6c9f\u901a\u9898\u76ee\u7684\u610f\u601d\uff0c\u76f4\u5230\u5b8c\u5168\u5f04\u6e05\u695a\u9898\u76ee\u624d\u884c\u3002<\/p>\n\n\n\n<p>\u5728\u786e\u5b9a\u81ea\u5df1\u5df2\u7ecf\u5f04\u6e05\u9898\u76ee\u4e4b\u540e\uff0c\u9996\u5148\u8981\u505a\u7684\u5c31\u662f\u7ea6\u5b9a\u8f93\u5165\u548c\u8f93\u51fa\u3002<\/p>\n\n\n\n<p>I will define a function to solve this problem. The input is &#8230;, and the output is &#8230;<\/p>\n\n\n\n<p>\u4e4b\u540e\u5c31\u8981\u8ddf\u9762\u8bd5\u5b98\u660e\u786e\u9898\u76ee\u4e2d\u4ed6\u6ca1\u6709\u63d0\u5230\u7684\u4e00\u4e9b\u6761\u4ef6\uff08Clarification Questions\uff09\u3002<\/p>\n\n\n\n<p>I got the problem, but I have some clarification questions that I want to discuss with you.<\/p>\n\n\n\n<p>Anything I can know about the size of array and the range of values? \uff08\u660e\u786e\u6570\u636e\u8303\u56f4\uff09<\/p>\n\n\n\n<p>What should I do if there is no valid answer? Do you want me to throw exception? Or simply return a special value such as minus one? \uff08\u5982\u679c\u7b54\u6848\u4e0d\u5b58\u5728\uff0c\u90a3\u6211\u8be5\u5982\u4f55\u5904\u7406\uff09<\/p>\n\n\n\n<p>Since integer calculations appear, I assume all the data will not overflow when calculated.\uff08\u5047\u8bbe\u6570\u636e\u5728\u8ba1\u7b97\u8fc7\u7a0b\u4e2d\u4e0d\u4f1a\u6ea2\u51fa\uff09<\/p>\n\n\n\n<p>There is some edge cases that I want to share with you. \uff08\u8003\u8651\u8fb9\u7f18\u60c5\u51b5\uff09<\/p>\n\n\n\n<h3>10 ~ 15min \u63cf\u8ff0\u89e3\u9898\u601d\u8def + \u8dd1\u4e00\u4e2a\u6848\u4f8b + \u5206\u6790\u65f6\u7a7a\u590d\u6742\u5ea6<\/h3>\n\n\n\n<p>\u63a5\u7740\u5c31\u53ef\u4ee5\u5f00\u59cb\u601d\u8003\u5982\u4f55\u53bb\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u4e5f\u5e94\u8be5\u79ef\u6781\u5730\u8ddf\u9762\u8bd5\u5b98\u6c9f\u901a\u81ea\u5df1\u7684\u601d\u8def\uff0c\u800c\u4e0d\u662f\u81ea\u5df1\u95f7\u5934\u60f3\u3002\u5f53\u7136\uff0c\u6211\u77e5\u9053\u8fb9\u8bf4\u8bdd\u8fb9\u601d\u8003\u4f1a\u5927\u5927\u51cf\u6162\u601d\u8003\u7684\u901f\u5ea6\uff0c\u66f4\u4f55\u51b5\u7528\u82f1\u6587\uff0c\u4f46\u5728\u9762\u8bd5\u8fc7\u7a0b\u4e2d\u8fd9\u662f\u5fc5\u8981\u7684\uff0c\u4e5f\u662f\u9700\u8981\u5927\u91cf\u7684\u7ec3\u4e60\u624d\u80fd\u719f\u7ec3\u3002<\/p>\n\n\n\n<p>\u6709\u4e86\u601d\u8def\u5c31\u53ef\u4ee5\u8ddf\u9762\u8bd5\u5b98\u8868\u660e\u8be5\u5982\u4f55\u89e3\u51b3\u5f53\u524d\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<p>With these clarification questions, I will use &#8230; to solve this problem.<\/p>\n\n\n\n<p>\u4e3a\u4e86\u786e\u4fdd\u9762\u8bd5\u5b98\u80fd\u591f\u542c\u61c2\u81ea\u5df1\u7684\u601d\u8def\uff0c\u6211\u8fd8\u4f1a\u7528\u4e00\u4e2a\u6848\u4f8b\u6765\u8fc7\u4e00\u8fb9\u81ea\u5df1\u7684\u601d\u8def\u3002<\/p>\n\n\n\n<p>Here, I want to use the example to show my ideas.<\/p>\n\n\n\n<p>Firstly, I will iterate \/ go through the array&#8230;<\/p>\n\n\n\n<p>After, we find that &#8230;<\/p>\n\n\n\n<p>Finally, &#8230;<\/p>\n\n\n\n<p>\u4e4b\u540e\u518d\u8ba1\u7b97\u4e00\u4e0b\u81ea\u5df1\u7b97\u6cd5\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u548c\u7a7a\u95f4\u590d\u6742\u5ea6\u3002<\/p>\n\n\n\n<p>Let me think about the complexity of my algorithm.<\/p>\n\n\n\n<p>The time complexity is &#8230;<\/p>\n\n\n\n<p>The space complexity is &#8230;<\/p>\n\n\n\n<h3>15 ~ 25min \u5b8c\u6210Coding + \u518d\u8dd1\u4e00\u4e2a\u6848\u4f8b<\/h3>\n\n\n\n<p>\u5199\u4ee3\u7801\u7684\u540c\u65f6\uff0c\u8981\u544a\u8bc9\u9762\u8bd5\u5b98\u4f60\u6b63\u5728\u5904\u7406\u7684\u903b\u8f91\uff0c\u548c\u4f60\u73b0\u5728\u7684\u601d\u8def\u3002<\/p>\n\n\n\n<p>Here I am using a loop to &#8230;<\/p>\n\n\n\n<p>Now, we need to check &#8230;<\/p>\n\n\n\n<h3>25 ~ 40min Follow up<\/h3>\n\n\n\n<p>\u5f53\u5df2\u7ecf\u89e3\u51b3\u4e86\u4e00\u4e2a\u95ee\u9898\u7684\u65f6\u5019\uff0c\u9762\u8bd5\u5b98\u5f80\u5f80\u4f1a\u5728\u521a\u624d\u95ee\u9898\u7684\u57fa\u7840\u4e0a\u4fee\u6539\u4e00\u4e9b\u6761\u4ef6\uff0c\u4f7f\u8fd9\u4e2a\u95ee\u9898\u53d8\u5f97\u66f4\u96be\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u9700\u8981\u6ce8\u610f\u7684\u662f\u4ed6\u4fee\u6539\u4e86\u4ec0\u4e48\u6761\u4ef6\uff0c\u5e76\u4e14\u4f1a\u5bf9\u9898\u76ee\u7684\u89e3\u6cd5\u9020\u6210\u4ec0\u4e48\u6837\u7684\u5f71\u54cd\u3002\u6211\u4eec\u77e5\u9053\u5982\u4f55\u89e3\u9898\u4e4b\u540e\uff0c\u518d\u91cd\u590d\u4e0a\u8ff0\u89e3\u9898\u7684\u8fc7\u7a0b\u3002<\/p>\n\n\n\n<p>Since the elements are not unique now, &#8230;<\/p>\n\n\n\n<p>The array is &#8230; so we can do it simply, but we need to care about more cases.<\/p>\n\n\n\n<p>What will happen if the integers are not unique?<\/p>\n\n\n\n<h1>Coding\u5355\u8bcd\u8868<\/h1>\n\n\n\n<pre class=\"wp-block-preformatted\">algorithm \u7b97\u6cd5<br>data structure \u6570\u636e\u7ed3\u6784<br>item \u9879<br>logical structure \u903b\u8f91\u7ed3\u6784<br>phyical structure \u7269\u7406\u7ed3\u6784<br>linear structure \u7ebf\u6027\u7ed3\u6784<br>atomic data type \u57fa\u672c\u6570\u636e\u7c7b\u578b<br>linear list \u7ebf\u6027\u8868<br>stack \u6808<br>queue \u961f\u5217<br>string \u4e32<br>array \u6570\u7ec4<br>tree \u6811<br>graph \u56fe<br>search \u67e5\u627e\/\u641c\u7d22<br>update \u66f4\u65b0<br>sort \u6392\u5e8f<br>insert \u63d2\u5165<br>delete \u5220\u9664<br>predecessor \u524d\u8d8b<br>successor \u540e\u7ee7<br>double-ended queue \u53cc\u7aef\u961f\u5217<br>circular queue \u5faa\u73af\u961f\u5217<br>pointer \u6307\u9488<br>first-in first-out list \u5148\u8fdb\u5148\u51fa\u8868<br>last-in first-out list \u540e\u8fdb\u5148\u51fa\u8868<br>bottom \u5e95\u90e8\uff08\u6808\u5e95\uff09<br>top \u9876\u90e8\uff08\u6808\u9876\uff09<br>push \u5165\u6808<br>pop \u51fa\u6808<br>front \u961f\u5934<br>rear \u961f\u5c3e<br>overflow \u4e0a\u6ea2<br>underflow \u4e0b\u6ea2<br>matrix \u77e9\u9635<br>multi-dimentional array \u591a\u7ef4\u6570\u7ec4<br>symmetric matrix \u5bf9\u79f0\u77e9\u9635<br>sparse matrix \u7a00\u758f\u77e9\u9635<br>linked list \u94fe\u8868<br>linear linked list \u7ebf\u6027\u94fe\u8868<br>single linked list \u5355\u94fe\u8868<br>multi linked list \u591a\u91cd\u94fe\u8868<br>circular linked list \u5faa\u73af\u94fe\u8868<br>head node \u5934\u8282\u70b9<br>head pointer \u5934\u6307\u9488<br>tail pointer \u5c3e\u6307\u9488<br>blank string \u7a7a\u767d\u4e32\uff08\u7a7a\u683c\u4e32\uff09<br>null string \u7a7a\u4e32\uff08\u96f6\u4e32\uff09<br>substring \u5b50\u4e32<br>subtree \u5b50\u6811<br>forest \u68ee\u6797<br>root \u6839<br>leaf \u53f6\u5b50<br>node \u8282\u70b9<br>depth \u6df1\u5ea6<br>level \u5c42\u6b21<br>parents \u53cc\u4eb2<br>children \u5b69\u5b50<br>brother \u5144\u5f1f<br>ancestor \u7956\u5148<br>descendant \u5b50\u5b59<br>binary tree \u4e8c\u53c9\u6811<br>balanced binary tree \u5e73\u8861\u4e8c\u53c9\u6811<br>full binary tree \u6ee1\u4e8c\u53c9\u6811<br>complete binary tree \u5b8c\u5168\u4e8c\u53c9\u6811<br>traverse binary tree \u904d\u5386\u4e8c\u53c9\u6811<br>binary sort tree \u4e8c\u53c9\u6392\u5e8f\u6811<br>binary search tree \u4e8c\u53c9\u641c\u7d22\u6811<br>preorder traversal \u5148\u5e8f\u904d\u5386<br>inorder traversal \u4e2d\u5e8f\u904d\u5386<br>postorder traversal \u540e\u5e8f\u904d\u5386<br>directed graph \u6709\u5411\u56fe<br>undirected graph \u65e0\u5411\u56fe<br>connected graph \u8fde\u901a\u56fe<br>weighted graph \u52a0\u6743\u56fe<br>directed acyclic graph \u6709\u5411\u65e0\u73af\u56fe\uff08DAG\uff09<br>spares graph \u7a00\u758f\u56fe<br>dense graph \u7a20\u5bc6\u56fe<br>edge \u8fb9<br>vertex \u9876\u70b9<br>path \u8def\u5f84<br>cycle \u56de\u8def\uff08\u73af\uff09<br>source \u6e90\u70b9<br>destination \u7ec8\u70b9<br>initial node \u521d\u59cb\u8282\u70b9<br>terminal node \u7ec8\u7aef\u8282\u70b9<br>adjacent edge \u76f8\u90bb\u8fb9<br>adjacent vertex \u76f8\u90bb\u8282\u70b9<br>indegree \u5165\u5ea6<br>outdegree \u51fa\u5ea6<br>shortest path \u6700\u77ed\u8def\u5f84<br>adjacency matrix \u90bb\u63a5\u77e9\u9635<br>adjacency list \u90bb\u63a5\u8868<br>spanning tree \u751f\u6210\u6811<br>minimum cost spanning tree \u6700\u5c0f\u751f\u6210\u6811<br>topological sort \u62d3\u6251\u6392\u5e8f<br>critical path \u5173\u952e\u8def\u5f84<br>match \u5339\u914d<br>linear search \u7ebf\u6027\uff08\u987a\u5e8f\uff09\u67e5\u627e<br>binary search \u4e8c\u5206\u67e5\u627e<br>block search \u5206\u5757\u67e5\u627e<br>hash table \u6563\u5217\u8868<br>immediately allocating method \u76f4\u63a5\u5b9a\u5740\u6cd5<br>addition \u52a0\u6cd5<br>subtraction \u51cf\u6cd5<br>multiplication \u4e58\u6cd5<br>division \u9664\u6cd5<br>plus \u52a0<br>minus \u51cf<br>times \u4e58<br>divided by \u9664\u4ee5<br>sort \u6392\u5e8f<br>internal sort \u5185\u90e8\u6392\u5e8f<br>external sort \u5916\u90e8\u6392\u5e8f<br>insertion sort \u63d2\u5165\u6392\u5e8f<br>selection sort \u9009\u62e9\u6392\u5e8f<br>heap sort \u5806\u6392\u5e8f<br>quick sort \u5feb\u901f\u6392\u5e8f<br>merge sort \u5f52\u5e76\u6392\u5e8f<br>redix sort \u57fa\u6570\u6392\u5e8f<br>monotonic stack \u5355\u8c03\u6808<br>iterate \u8fed\u4ee3<br>recursion \u9012\u5f52<br>edge cases \u8fb9\u7f18\u6848\u4f8b<br>clarification questions \u6f84\u6e05\u95ee\u9898<br>union find \u5e76\u67e5\u96c6<br>time complexity \u65f6\u95f4\u590d\u6742\u5ea6<br>space complexity \u7a7a\u95f4\u590d\u6742\u5ea6<br>brute force \u66b4\u529b\u89e3<br>optimal solution \u6700\u4f18\u89e3<br>indicate \u8868\u660e<br>by default \u9ed8\u8ba4<br>trie tree \u5b57\u5178\u6811<br>be greater than \u6bd4...\u5927<br>be greater than or equal to \u5927\u4e8e\u7b49\u4e8e...<br>be less than \u6bd4...\u5c0f<br>be less than or equal to \u5c0f\u4e8e\u7b49\u4e8e...<br>be equal to \u7b49\u4e8e<br>sliding window \u6ed1\u52a8\u7a97\u53e3<br>dynamic programming \u52a8\u6001\u89c4\u5212\uff08DP\uff09<br>contiguous sequence \u8fde\u7eed\u5e8f\u5217<br>cell \u683c\u5b50<br>distinct \u4e0d\u540c\u7684<br>judge \u5224\u65ad<br>array expansion \u6570\u7ec4\u6269\u5bb9<br>candidates \u5019\u9009<br>consecutive \u8fde\u7eed\u7684<br>N-ary tree N\u53c9\u6811<br>best \u6700\u597d<br>worst \u6700\u5dee<br>memorandum \u5907\u5fd8\u5f55<br>optimal substructure \u6700\u4f18\u5b50\u7ed3\u6784<br>diagonal \u5bf9\u89d2\u7ebf<br>maintain \u7ef4\u62a4<br>ascending \u4e0a\u5347\u7684<br>inherit \u7ee7\u627f<br>duplicate elements \u91cd\u590d\u5143\u7d20<br>parentheses \u62ec\u53f7<br>compound question \u590d\u5408\u95ee\u9898<br>in addition to \u9664\u4e86<br>respectively \u5206\u522b\u5730<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\uff1ahttps:\/\/twocups.cn\/index.php\/202 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":604,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[129],"_links":{"self":[{"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/posts\/602"}],"collection":[{"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/comments?post=602"}],"version-history":[{"count":0,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/posts\/602\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/media\/604"}],"wp:attachment":[{"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/media?parent=602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/categories?post=602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/tags?post=602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}