Live data from Hacker News

Competitive Programmer's Handbook (2017) [pdf]

cses.fi

121–127 of 127 posts

Re: Competitive Programmer's Handbook (2017) [pdf]

#121

Earlier quoted context omitted.

> Technical interviews (at least in companies such as facebook and google) are usually much easier than competitive programming problems. Probably. But if you are a student outside U.S where the opportunities are an order of magnitude less the only way to even land an interview with these companies is by doing competitive programming. Google selects students through APAC test in Asia where you have to be top n% in th…

> All the persons I know of in my country who works at Google or Facebook got their job through competitive programming. Are any of them bad developers?

The general trend is that students do either competitive programming or development. Most students who do competitive program hardly work on any personal projects or open source as it is of almost zero value when it comes to campus placements. Companies like Flipkart, Morgan Stanely, Goldman, Amazon, Cisco etc conducts a competitive programming test as the first round in Universities. The remaining rounds are mostly data structures and algorithm/DBMS questions taken from GeeksForGeeks. Very few companies ask questions about development, personal projects, open source contributions etc. If a student does only development and hardly do any competitive programming it is very difficult for them to pass the first round.

Re: Competitive Programmer's Handbook (2017) [pdf]

#123

I see in the comments that some people conflate competitive programming and technical interviews. Technical interviews (at least in companies such as facebook and google) are usually much easier than competitive programming problems. The problem you find on leetcode for interview preparation would be considered beginner problems in competitions such as google code jam.

Most people who are doing competitive programming aren't good at the harder problems. For example, there are >2500 people listed on the TopCoder Top Ranked Algorithm Competitors page (https://community.topcoder.com/tc?module=AlgoRank), but only the top 115 or so are Red, and only about 415 more are Yellow.

A programming contest, even if you just do the easy problems, can be a more enjoyable way to practice for interviews than reading a book or even going through online puzzles like those on LeetCode.

Re: Competitive Programmer's Handbook (2017) [pdf]

#124

Earlier quoted context omitted.

I'm not sure that you avoid errors by forcing yourself to write short code. With C macros.

Here's a real world example: https://github.com/LoupVaillant/Monocypher/commit/d7bb73f65a... So I have this function, `crypto_wipe()` that wipes memory regions with `volatile` so the compiler doesn't optimises it away. In the link above I was using it thus: crypto_stuff(stuff_ctx *ctx) { // stuff crypto_wipe(ctx, sizeof(ctx)); // BUUUG!! } See the bug? I should have dereferenced `ctx` in the sizeof operator. As it wa…

In this case the use of macros may increase the readability or assurance of the code, still there are a lot of cases where macros can easily lead to bugs: https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pa...

Re: Competitive Programmer's Handbook (2017) [pdf]

#125

Earlier quoted context omitted.

Here's a real world example: https://github.com/LoupVaillant/Monocypher/commit/d7bb73f65a... So I have this function, `crypto_wipe()` that wipes memory regions with `volatile` so the compiler doesn't optimises it away. In the link above I was using it thus: crypto_stuff(stuff_ctx *ctx) { // stuff crypto_wipe(ctx, sizeof(ctx)); // BUUUG!! } See the bug? I should have dereferenced `ctx` in the sizeof operator. As it wa…

In this case the use of macros may increase the readability or assurance of the code, still there are a lot of cases where macros can easily lead to bugs: https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pa...

Of course. You will note I only went macro to prevent an error I already made. C macros suck, I don't use them lightly.

Re: Competitive Programmer's Handbook (2017) [pdf]

#126

This book gets to the point fast. But for the fundamentals this book serves more as a refresher than a course. Skiena and Sedgewick both have excellent books and online courses if you need more depth. A nice thing about this book is that the full TeX source is on github.

There are some sections that are a bit dense and may require some additional work. The string algorithms section is very dense compared to the rest.

Re: Competitive Programmer's Handbook (2017) [pdf]

#127
post #52

Earlier quoted context omitted.

Sure, that might be the case. But for those funny needs I have a "crazy algorithm course" from a top 10 university, ACM ICPC and Kaggle or other paid competitions I can attend. I am not going to go through such an interview doing simple silly things I did dozen times before at FB/Goog/etc., when I know I can use that time to work on something more interesting, or just for relaxing after a hard work/enjoying accomplis…

What was the problem they asked you to solve? Out of curiosity

I don't want to ruin their test...
Post reply on HN