http://jasonjl.me/blog/2015/03/30/practical-programming-practice-services/

Codewars, Leetcode, Hackerrank. Online Judges Reviews

written March 30, 2015 in algorithmsprogrammingreview

Sometimes the projects you work on just aren’t stimulating enough. Sometimes you need to fill your brain with as many programming problems as possible. Usually tackling a small sized project only requires a small set of challenges to solve while the rest of the time is spent tying the project together. When you need as many challenges to tackle in as short a time as possible you need online judges. This article is a review on the online judges, CodewarsLeetCode, and HackerRank.

Codewars

Codewars takes the concept of the ‘Code Kata’ and gamifies the exercises so programmers always have something to challenge themselves when they got a few minutes to spare. Challenges are usually short, ranging from minutes to a few hours. Most of the questions often have contexts associated with them so it always feels like you’re actually solving a potential real world problem rather using your tools as a programmer, even though the contexts are often fantastical in nature.

Things I like

There’s a clear progression that Codewars wants you to take. Challenges start from the fundamentals and rises slowly in difficulty so that you have a good basis of understanding before you move to the next level.

Solutions of all the other members are available to analyze after solving the problem. Finding out how other (more smarter) people solved the same exact problem allows you to gain insights into the gaps in your methodology. The solutions are bite sized so its easier to digest new programming features or new ways of organizing code that you’ve never considered before. I truly think that social programming is the way to get better at writing code and I think Codewars deserves a giant plus for this feature.

Things I don’t like

The Java error messages are less than helpful. I’m not sure how they return exceptions when your code doesn’t compile, but often times the console is going to return an exception from the enclosing outer stack that executes the code meaning you don’t get any useful stack debugging information, you just know somethings wrong.

Each question has tags associated with them describing what methods of programming you’ll use to solve the problem. These tags often give a hint on what to do to solve the problem which is kind of a problem since people look at these tags as extra meta information to give them a lead. I often like to come into a problem blind and find out myself what to do in order to get to a solution.

Overall

Overall I think it’s actually a really neat service. Like I said earlier, I’ve learned so much more about JavaScript than I ever would have if I were to just continue working on my own projects. I’m definitely going to use it again when I delve into Python.

LeetCode OJ

LeetCode OJ is all about the algorithms. There are no pretenses, you’re going to be solving very straightforward problems that have very defined lower bounds in terms of space and memory. These problems will often test cases on all edges of the spectrum and will only accept answers that meet the lowest bound limitation. Your preferred language is just a means to work around an algorithm. At the end of each problem, Leetcode ranks you up against your peers by how quickly your code executed.

Things I like

No muss no fuss, these questions ask you about algorithms and after enough exercises will hammer the common ways to solve them into your brain. I think this is a good second level after reading and solving the exercises to Crack the Coding Interview. There are tons more exercises here that touches on things that CTCI doesn’t which makes it a natural progression to the book.

The code editor is actually really good. Everything flows like a real professional code editor including quality of life improvements such as auto tab indentation, mass commenting, auto closing brackets, mass tab indentation, highlight bracketing, etc…

The questions are very direct. There are no fillers, no context. At first its a little ambiguous to know what values will be used to test your program, but after a while it becomes very obvious what kinds of edge case values Leetcode expects your program to process.

Things I don’t like

Since the online judge only wants answers that are strictly the lowest bound in terms of space and runtime, it’ll often fail passing solutions that are not the most optimal. It will fail an acceptable solution of O(nlogn) if the lowest bound possible is O(n). Sometimes you think of the correct algorithm, but implement it in such a way that it still exceeds the time limit. It is ambiguous to know what exactly is the bit of code to optimize in order to pass the test.

The community seems more concerned with writing concise code rather than best practice code. Discussion solutions are often compressed to the point where its difficult to read.

I really wish they would allow us to see each user’s submitted code so we can see exactly what we need to do to get the most optimization out of our language of choice. I did not feel like I learned anything about runtime optimization since my code always landed in the middle in terms of speed compared to my peers.

Overall

This site is great if you need some extra exercises to hone in on pure algorithm practice. I would not recommend it as a place to actually learn from 0% knowledge but more of a place if you’re looking for medium to advanced challenges. You have to be familiar with your language of choice as your language is just a tool you should be familiar with to solve a greater problem.

HackerRank

HackerRank is site that focuses more on the competitive nature of programming. HackerRank encourages you to participate in its many ongoing week long challenges. They support a ton of languages cover a wide range of practice problems ranging from algorithms, functional programming, linux shell cmds, and even AI.

Things I like

Since each challenge requests you parse a text file, it actually gives you plenty of exercises in reading in a file, parsing it, and outputting it. I feel like this is something that’s overlooked by a lot of challenge sites so its nice to see a site that allows you to practice that skill.

Each challenge has very clearly defined variables. Sometimes it’s actually kind of annoying, but each challenge will let you know exactly how the text file will be formatted and exactly what it will be testing on.

There are a ton of active competitions going on at a time meaning you can always test your chops against other programmers.

Things I don’t like

Its code editor is missing a lot of convenience features that the other code editors have. Sure it has code highlighting but other than that its very uncomfortable to use. The UI around the site is nice, but I feel like it has some work to do on its code editor.

Parsing a text file every time is kind of annoying. Some times you just want the values to be passed in as primitive data as if it would be used as a modular piece in a larger project. Since JavaScript doesn’t have a real file output stream (without node) it requests for you to use console.log() to output your answer, which is a small inconvenience.

Overall

I’ve used this the least amount so I’m not yet decided on whether I like it or not. The challenges are appropriately challenging but the text editor is not very fun to use. Its less of a site to practice but more to compete. Some of you may view this as the same thing.

Conclusions

Just about doing any of these is a good natural progression in terms of interview preparation and to generally be a better programmer. All three of these sites and many more like it definitely can only help since you’ll be exposed to a wider range of problems you never even knew existed. Of course, nothing truly beats the experience of working on a truly challenging real project but when those are few and far in between, then these online judges got you covered.


Comments

Codewars, Leetcode, Hackerrank. Online Judges Reviews的更多相关文章

  1. [DE] How to learn Big Data

    打开一瞧:50G的文件! emptystacks jobstacks jobtickets stackrequests worker 大数据加数据分析,需要以python+scikit,sql作为基础 ...

  2. leetcode刷题总结

    题外话 今年大三,现正值寒假时间,开学就开始大三下学期的生活了. 在大三临近结束的时间,也就是复习考试的时间里,我每天都会用早上的时间来刷codewars.刚开始玩的时候,一到8kyu的题目如果稍微难 ...

  3. leetcode算法题(JavaScript实现)

    题外话 刷了一段时间的codewars的JavaScript题目之后,它给我最大的感受就是,会帮助你迅速的提升你希望练习的语言的API的熟悉程度,Array对象.String对象等原生方法,构造函数. ...

  4. Leetcode——练习

    平时没事刷刷Leetcode,还办了个年会员.为了自己150刀.为了自己的大脑投资,从不差钱儿.刷刷题能练习coding,此外看一些别人的优秀的答案,能增长见解.大家共同努力,共勉. 十.Google ...

  5. 我为什么要写LeetCode的博客?

    # 增强学习成果 有一个研究成果,在学习中传授他人知识和讨论是最高效的做法,而看书则是最低效的做法(具体研究成果没找到地址).我写LeetCode博客主要目的是增强学习成果.当然,我也想出名,然而不知 ...

  6. LeetCode All in One 题目讲解汇总(持续更新中...)

    终于将LeetCode的免费题刷完了,真是漫长的第一遍啊,估计很多题都忘的差不多了,这次开个题目汇总贴,并附上每道题目的解题连接,方便之后查阅吧~ 477 Total Hamming Distance ...

  7. [LeetCode] Longest Substring with At Least K Repeating Characters 至少有K个重复字符的最长子字符串

    Find the length of the longest substring T of a given string (consists of lowercase letters only) su ...

  8. Leetcode 笔记 113 - Path Sum II

    题目链接:Path Sum II | LeetCode OJ Given a binary tree and a sum, find all root-to-leaf paths where each ...

  9. Leetcode 笔记 112 - Path Sum

    题目链接:Path Sum | LeetCode OJ Given a binary tree and a sum, determine if the tree has a root-to-leaf ...

随机推荐

  1. MD5,SHA1 都是哈希 摘要算法 MD5+SALT BCRYPT

    为什么说 MD5 是不可逆的? md5是摘要算法,你学数据结构的时候学过哈希表吧?也有叫散列的.md5就是干那个用的 当然,如果硬要说的话...你可以用md5 hash一段字符串,也算是加密好了,不过 ...

  2. Node.js文件操作一

    Node.js和其他语言一样,也有文件操作.先不说node.js中的文件操作,其他语言的文件操作一般也都是有打开.关闭.读.写.文件信息.新建删除目录.删除文件.检测文件路径等.在node.js中也是 ...

  3. git移除文件夹的版本控制

    案例背景:git提交的时候把bin文件下的各种.dll提交上去了,然后每次提交都得提交好多文件,很容易忽略你真正修改的东西,故对这些不必要的东西忽略掉 解决方案:git rm 命令参数 具体实施: 1 ...

  4. NodeJS之 Express框架 app.use(express.static)

    一 .设置静态文件目录 语法如下: app.use(express.static(_dirname + '/public')); //设置静态文件目录 注: 将静态文件目录设置为项目根目录 + ‘/p ...

  5. 番外篇 之 Win32Api

    C# 调用系统API. 从自己的软件,来操作别人写好的软件. SendMessage 句柄  标识当前进程/控件的一个标识; 本课程所用到的常量信息: private const uint LB_FI ...

  6. Maven - dependency那些事儿

    身边有几位刚使用Maven的同学表示——在一个叫"pom.xml"的文件里声明一个依赖就不用去手动添加jar了,感觉这东西和自己手动管理依赖没太大区别. 当然,并不是这样,在此记录 ...

  7. Django(三):HttpRequest和HttpResponse

    当一个请求连接进来时,django会创建一个HttpRequest对象来封装和保存所有请求相关的信息,并且会根据请求路由载入匹配的视图函数.每个请求的视图函数都会返回一个HttpResponse. H ...

  8. angular2.0---服务Service,使用服务进行数据处理

    1.创建服务 打开命令窗口,cd到项目目录下,输入  ng g service myData1  回车 创建服务,如下图所示: 这样就成功创建了服务,此时,可以在项目的app文件夹下生成了两个serv ...

  9. js和jquery中获取非行间样式

    样式又分为了行间样式和非行间样式.一般来说行间样式用的是比较少的,因为它能够作用的范围就只有一个元素,而非行间样式的作用范围可以是一类元素(即拥有相同德标签,或者说是有相同的类名,(当然id名不可能相 ...

  10. RxJava重温基础

    RxJava是什么 a library for composing asynchronous and event-based programs using observable sequences f ...