无论是 web2 还是 web3,良好的数据结构、算法和 Leetcode 问题的能力都很重要,不仅对找工作有帮助,还能为计算机科学打下良好的基础。
许多开发者知道他们应该练习 leetcode(或者替代性的 hackerrank、codecademy 或 codewars),但如果你还没开始,可能会感到很不知所措。
你应该从哪些 Leetcode 问题开始,顺序应该如何呢?
克服开始时的心理障碍
没有什么比打开这些网站,随便选一个标记为简单的问题,然后陷入困境更让人沮丧的了。现在你必须花费三倍的精力:寻找合适的问题、解决它,并且不要自己怀疑是选择错了问题还是自己根本不适合这个测试。
我们建议从一些非常简单的 Leetcode 问题开始。真的,挑战一下这个怎么样?
<https://leetcode.com/problems/add-two-integers/>
func sum(num1 int, num2 int) int {
}
一个简单的编码问题,用于添加两个整数
听起来不太吓人,对吧?
专注于语言的核心
有很多数据结构和算法。存在树、链表、堆、队列、图、定向图等等!为了避免选择过多而感到不知所措,最好专注于几乎所有现代语言中内建的数据结构。
大多数语言允许你在不引入任何东西的情况下使用这些数据结构。
如果要使用队列或堆等东西,你必须引入某种库。尽管技术看起来光鲜且“新颖”,但编程语言已经存在了数十年。它们已经演变得使常见操作变得简单。如果一种语言的使用需要更多的工作,它最终会失去受欢迎度。
镜像二叉树并不是一件常见的事情。但操作字符串和数组是非常常见的,因此它们被内置在语言中。
如果你不知道如何在一种语言中做这些基本的事情,你就不算会编程。如果不知道如何处理树、图和队列,那也是不特定于某门语言的。但如果你无法在 JavaScript 中遍历数组,那么你就不能说自己会 JavaScript。
我们编制的问题列表旨在确保你对语言的基础知识感到舒适。这些问题将为你以后的更高级主题奠定良好的基础。
首先关注逻辑和解决问题的能力
算法的名字可能看起来很吓人,通常是一些很少使用的欧洲名字的拼接,具有神秘的应用。Floyd-Warshall 算法?Dijkstra 算法?Fisher-Yates?
你可以等到稍后再学习这些。
但你绝对必须能够做一些基本的事情,这些事情甚至不是“算法性”的。
例如,给定一个井字棋网格,你能否判断游戏是否结束?你并不需要任何复杂的算法来做到这一点。如果你连这个基本任务都很难完成,你在面对上面列出的一些更高级的算法时,就会很困难。
我们在这里列出的问题不需要任何特殊的技巧来解决。在你添加更多的大学水平技术之前,先学会应用基本的逻辑和常识解决方案。
这些问题不会太简单吗?
也许你不是这个目标受众,但你会惊讶于有多少人自称为开发者却 无法解答 fizz buzz。我们亲身经历过这一点。当你申请我们的项目时,你会迅速收到一封包含编码测试链接的电子邮件。其中一个测试题就是 fizz buzz。而这个题目的失败率是 高 的。
也许是因为紧张,或者之前没有参加过 编码测试。但是如果你从未至少练习过一次编码测试,就不算对自己有利。
这对通过编码面试够用吗?
如果你能解决所有这些问题,你可能能找到一份工作!这将是一个非常入门级的工作,在那些不太挑剔的公司。但即使如此也是有可能的。
你不需要支付费用使用这些问题吗?
我们只包括免费版本中的问题。
版权声明
因为我们与其他软件培训程序发生了抄袭问题,这项作品的全部内容都受《创意共享非商业许可》授权。
- <https://leetcode.com/problems/convert-the-temperature/>
- <https://leetcode.com/problems/add-two-integers/>
- <https://leetcode.com/problems/smallest-even-multiple/>
- <https://leetcode.com/problems/final-value-of-variable-after-performing-operations/>
- <https://leetcode.com/problems/count-of-matches-in-tournament/>
- <https://leetcode.com/problems/number-of-common-factors/>
- <https://leetcode.com/problems/xor-operation-in-an-array/>
- <https://leetcode.com/problems/length-of-last-word/>
- <https://leetcode.com/problems/to-lower-case/>
- <https://leetcode.com/problems/to-lower-case/>(反向进行)
- <https://leetcode.com/problems/reverse-string/>(不要使用双指针)
- <https://leetcode.com/problems/valid-palindrome/>
- <https://leetcode.com/problems/count-vowel-substrings-of-a-string/>(不要使用哈希表)
- <https://leetcode.com/problems/repeated-substring-pattern/>
- <https://leetcode.com/problems/defanging-an-ip-address/>
- <https://leetcode.com/problems/determine-color-of-a-chessboard-square/>
- <https://leetcode.com/problems/add-digits/>
- <https://leetcode.com/problems/jewels-and-stones/>
- <https://leetcode.com/problems/roman-to-integer/>
- <https://leetcode.com/problems/fizz-buzz/>
- <https://leetcode.com/problems/check-if-array-is-sorted-and-rotated/>
- https://leetcode.com/problems/sort-an-array/(忽略 Leetcode 指令,使用内建特性)
- <https://leetcode.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/>
- <https://leetcode.com/problems/subtract-the-product-and-sum-of-digits-of-an-integer/>
- <https://leetcode.com/problems/find-first-palindromic-string-in-the-array/>
- <https://leetcode.com/problems/running-sum-of-1d-array/>
- <https://leetcode.com/problems/merge-two-sorted-lists/>
- <https://leetcode.com/problems/find-greatest-common-divisor-of-array/>
- <https://leetcode.com/problems/maximum-number-of-words-found-in-sentences/>
- <https://leetcode.com/problems/final-value-of-variable-after-performing-operations/>
- <https://leetcode.com/problems/shuffle-the-array/>
- <https://leetcode.com/problems/shuffle-string/>
- <https://leetcode.com/problems/cells-in-a-range-on-an-excel-sheet/>
- <https://leetcode.com/problems/minimum-sum-of-four-digit-number-after-splitting-digits/>
- <https://leetcode.com/problems/decompress-run-length-encoded-list/>
2D 数组 (播放列表):
- <https://leetcode.com/problems/richest-customer-wealth/>
- <https://leetcode.com/problems/flipping-an-image/>
- <https://leetcode.com/problems/lucky-numbers-in-a-matrix/>
- <https://leetcode.com/problems/shift-2d-grid/>
- <https://leetcode.com/problems/available-captures-for-rook/>
- <https://leetcode.com/problems/jewels-and-stones/>
- <https://leetcode.com/problems/decode-the-message/>
- <https://leetcode.com/problems/unique-morse-code-words/>
- <https://leetcode.com/problems/check-if-the-sentence-is-pangram/>
- <https://leetcode.com/problems/first-letter-to-appear-twice/>
- <https://leetcode.com/problems/sum-of-unique-elements/>
- <https://leetcode.com/problems/merge-similar-items/>
- <https://leetcode.com/problems/divide-array-into-equal-pairs/>
- <https://leetcode.com/problems/destination-city/>
- <https://leetcode.com/problems/number-of-good-pairs>
喜欢这里的内容吗?查看我们的 免费 Solidity 课程。
最初发布日期:2022 年 12 月 8 日