https://uva.onlinejudge.org/index.php?option=com_onlinejudge...
Learning algorithms per se is only a small part of training. Much bigger part of training is learning how to recognize these algorithms in problems.
After reading about some algorithm, I always solve a couple of related problems.
P.S. Looks well-written. Bookmarked. I appreciate the effort of the author to create this book.
And as you say you need to practice, and the book incentivizes it. They accompany the book with precisely problems from UVa Online Judge, some of them solved and with code (in the book and in the site).
write bad code [...] which
you will later throw away
Implementing a quick & dirty prototype, throwing it away and reimplementing it from scratch is not such a bad software engineering techique: first time to understand the problem, second time to make the implementation nice.A lot of bad software comes from not throwing the prototype away, but insteat trying to refine it into a product. Result = spaghetti.
http://www.catonmat.net/blog/programming-competitions-work-p...
Here's a good explanation posted by "tedsanders" the last time this came up on HN:
""" All of these claims from Google that say competition performance hurts or that GPA doesn't matter are missing one huge thing: selection bias.
Google only sees the performance of the employees that it hires, not the performance of the employees that it doesn't hire. Because of this, the data they analyze is statistically biased: all data is conditioned on being employed by Google. So when Google says things like "GPA is not correlated with job performance" what you should hear is "Given that you were hired by Google, GPA is not correlated with job performance."
In general, when you have some thresholding selection, it will cause artificial negative correlations to show up. Here's a very simple example that I hope illustrates the point: Imagine a world where high school students take only two classes, English and Math, and they receive one of two grades, A or B. Now imagine a college that admits students with at least one A (AB, BA, or AA) and that rejects everyone without an A (BB). Now imagine that there is absolutely zero correlation between Math and English - performance on one is totally independent of the other. However, when the college looks at their data, they will nonetheless see a stark anticorrelation between Math and English grades (because everyone who has a B in one subject always has an A in the other subject, simply because all the BBs are missing from their dataset).
When Google says that programming competitions are negatively correlated with performance and GPA is uncorrelated with performance, what that likely means is that Google's hiring overvalues programming competitions and fairly values GPA. """
I've also heard people involved in Google's Code Jam competition say that Norvig's study was done a long time ago, and no longer really applies.
I don't see how that is implied by GP's comment. It is one thing to read between the lines, but now you are reading between the characters.
Now, most good software engineers would probably not be very good at competitions, because competitions require certain specific skills that are not useful outside of competitions. And that's why good interviews don't put too much weight on algorithmic skills.
However, if you recognize the differences and use the skills you learn in the two as complementary, you can be better at both.
You can find the course material and assignments from https://cses.fi/alon/ - however, it's all in Finnish.
[0] https://en.wikipedia.org/wiki/Brian_Reid_(computer_scientist...
Seriously, if you can program at all, and want to be a better programmer (like, really well paid one), this is the greatest single thing I ever saw for this purpose. Just run through all examples and understand how they work, and you are already in top 1%.
Then, you can move to SICP and Project Euler in your spare time.
Nothing to do with getting a better job or a better salary.
For what it's worth, I work with someone who used to be (is? I think he stopped competing) red on TopCoder. He's one of the best developers I've ever worked with. I don't know about the causation there, but his development process and skill is better than most of what I've seen in many other tech companies (I say this in the context of reviewing other companies' source code for errors and getting an understanding of what their respective SDLCs look like).
That's obviously a sample size of one, but I felt like saying it because I think you're really pushing it with your comment. It almost just seems like you have an axe to grind. I can agree that a good developer doesn't need to be adept at competitive programming, but it does help with understanding things like algorithms, data structures and time complexity.
I think you trying to claim that competitive programming has "nothing to do with getting a better job" is just as egregious as people who only hire engineers that can produce impeccable red-black trees on a whiteboard with little preparation.
There's a lot more than just the core problem solving bits involved in making software, but it's a v. useful skill.
If you're trying to argue that improving your skillset makes you more employable, sure, but that's such a general statement that I'm not sure it holds up as a retort.
Shall we start a comprehensive list of skills and activities tangentially related to making more money?
As a former competitor in USACO, ACSL, etc., I would have loved to have resources like this around for practice and self-study back in high school.
I never studied them originally, but once I realised it was a blocker to getting a new job I spent some time to learn the basics at least which truly helped a lot. It was also a bit of fun, to be honest - even though they have almost no bearing on the day to day work.
So I'm interested in this book as it's a remarkably concise list of related things to learn.
Norvig seems to think it's a negative signal though. https://www.youtube.com/watch?v=DdmyUZCl75s
However if you are above the bar required to get hired by google, then a higher success rate in programming competitions correlates negatively with job performance.
"for(int i = 0; i < n; i++)"
In this book all for loops are alien: "for(int i = 1; i <= n; i++)", and it is also accessing arrays like this here and there which would normally be out of bounds unless you make them one larger which would be very odd to do.
Very weird in an otherwise fine book.
The main point imho is that if you have a range starting at some index a, then the first element of that range is at a+0, not a+1, and if n is the amount of element of the range and a is the index of its first element, the last will be at a+n-1, not a+n. The start and end of an array is the same, an array's indexes are also a range. You may want to make it feel all natural by setting a to 1 instead of 0 for arrays, but it then becomes all messy as soon as you work with multiple ranges, especially sub ranges of an existing range since you then really need to add 0, not 1, to get the first one of that sub range, so if you want to treat your arrays the same, easiest is to also have them also start at 0. The least messy solution requiring the least subtracting of 1 to fix things is to use 0-based indexing, inclusive start index and exclusive end index such that end - start = size. But probably somebody like Dijkstra can explain it better:
"E.W. Dijkstra Archive: Why numbering should start at zero (EWD 831)": https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/E...
It's sort of like a word problem in high school math. The math itself is often just addition and multiplication, the hard part is figuring out which math to use and which numbers to apply it to.
All of the old problems are on the CodeJam website though so you can go check them out and give them a go!
that being said, I really like text files.
Does anyone know if there is a way to migrate the pdf to a text file [omitting figures/pictures] ?
Certainly some companies put all their faith in those type of demonstrations of skill, I grant you...I'm just wondering if you or others really believe you are "Google material" by that measure.
> go to grad school, get PhD in mathematics
> get hired at Google (also works anywhere else)
> 300k starting
Pretty sure this is how it works (just ask around on 4chan).
>"In the German Lotto you have to select 6 numbers from the set {1,2,...,49}. A popular strategy top lay Lotto - although it doesn’t increase your chance of winning — is to select a subset S containing k (k > 6) of these 49 numbers, and then play several games with choosing numbers only from S.
For example, for k = 8 and S = {1, 2, 3, 5, 8, 13, 21, 34} there are 28 possible games: [1,2,3,5,8,13], [1,2,3,5,8,21], [1,2,3,5,8,34], [1,2,3,5,13,21], ..., [3,5,8,13,21,34]. Your job is to write a program that reads in the number k and the set S and then prints all possible games choosing numbers only from S."
if K needs to be > 8 how are the numbers in the selected subset {1, 2, 3, 5, 8, 13, 21, 34}? The majority of those are less than K. I have scratched my head about this for a few minutes. There are many that are equally as confusing.
See: https://uva.onlinejudge.org/index.php?option=com_onlinejudge...
Second, the subset contains k elements. The phrasing "select a subset S containing k of these elements" is standard mathematical terminology. I'm not sure how you read this as meaning that each element needed to be less than k.
My reading comprehension is just fine, the following statement is full of ambiguity:
"subset S containing k (k > 6)"
A more articulate way to express that would be "subset S that contain k elements where k is greater than 6"