12

Possible Duplicate:
Programming Puzzles

Looking for ways to help me improve my C# coding skills. I thought it would be handy if there was a site that asked you to write a new method every day to perform a task (maybe even one for beginners, intermediate & advanced developers). Seeing comments as to how everyone pulled it off would be very handy to learn how to improve your technique.

Anyone know of anything like this? There has to be something like this on the interwebs :)

4
  • 9
    Why not help answer C# questions on SO?
    – Bernard
    Commented Jun 7, 2011 at 14:54
  • 2
    If you don't feel confident enough to answer the questions, you can still try and work out a solution by yourself and get the practice you want. When you come up with a useful solution that isn't already amongst the question's answers, you can always add yours, even if the question already has an accepted answer. Commented Jun 7, 2011 at 15:28
  • @Bernard: you know that the god of SO is also the god of C#? So why pushing god further? :D Commented Jun 7, 2011 at 15:35
  • Just for future people looking for an answer: Try hackerrank.com It have pushed me into understand better my language of practice and sometimes implement basic Data structures and algorithms.
    – hhh
    Commented Mar 25, 2015 at 2:33

5 Answers 5

12

If you like math, I would suggest Project Euler. A question is released every week, but there are currently over 300 questions posted, so it could keep you busy for a while at least.

5
  • 8
    I don't get why everytime someone looks for ways to improve his coding skills PE is recommended. PE is very good to improve your mathematical skills but I don't see how it makes you a better programmer. Commented Jun 7, 2011 at 15:36
  • 6
    +1 I've found that when I'm trying out a new language, I try tackling PE problems and it DOES help. Maths puzzle are perfect candidate for code "kata". Why? because it forces you to concentrate on the puzzle NOT the language. This can accelerate how you learn a new language.
    – Darknight
    Commented Jun 7, 2011 at 15:43
  • 1
    @Helper Method - I find that you improve your coding skills by doing problems that are outside your normal daily routine. PE is definitely that. Also, if you take the time to read the comments after you've solved a problem you may find a new trick you didn't know before. I've gone back and tweaked code after finishing problems before. It is what you put into it.
    – Tyanna
    Commented Jun 7, 2011 at 16:15
  • 1
    @Helper Method - Because solving math puzzles pretty much covers everything you'd want to do (or able to) using code. While a lot of PE puzzles can be brute forced, a fair amount requires you to optimize your code if you want it done in a reasonable time. That's a very good skill to have. Commented Jun 7, 2011 at 20:02
  • @Oliver, some of the problems challenge you because the naive implementation run out of stack or takes forever. For instance, try solving problem 282 asking for a sum that turns out to be a bit tricky: projecteuler.net/index.php?section=problems&id=282
    – user1249
    Commented Jul 26, 2011 at 0:54
8

One website that I love playing around with when I get a minute is http://www.pexforfun.com/ by Microsoft Research. It requires you to write code that will cause the unit tests to pass, without you knowing the specifics of the unit tests. All it tells you is what inputs it passes in and what outputs should be given. It's good for improving your algorithm skills, in my opinion.

Some of the puzzles are stupid (since they are user generated) but there are quite a few good ones.

1
  • I alredy knew pex as unit testing tool. pexforfun is nice and it's cool to know what happends behind the scenes.
    – mbx
    Commented Jun 7, 2011 at 16:10
2

I assume you are not just trying to familiarize yourself with the standard library. If this is your sole goal, refer to the other answers.

I doubt you would actually improve your C# coding skills with something like this. C# is an extremely feature-rich language, which makes it far harder to decide which tools (e.g. events, LINQ queries, covariant genericity, inout vs. ref parameters etc.) are best applied to what problem domain. Within the scope of a daily quiz question, the problem is too narrow to challenge these skills.

Instead, I would encourage you to find a cool project idea with a certain amount of complexity allowing you to apply all these different tools.

2

Whenever I wanted to get up close and personal with a new programming language, I picked a project I always wanted to do, set aside some time for it and then just started doing it. And while I went along, I usually learnt not only about the programming language, but also about new algorithms and fundamental design principles, too.

The most important things are an explorative, open mind, and an approach that allows you to experiment. If something doesn't work, take a few steps back and try something different.

1
  • +1. Isn't this how PlentyOfFish got started? Now look at the poor sap... he has to keep up with running one of the busiest websites on the net. Nice problem to have and I bet he ended up learning more about ASP than he ever imagined.
    – Jason
    Commented Jun 7, 2011 at 15:40
1

A source of interesting problems with solutions is ActiveState's Cookbooks. This is especially true for Python (3300+ recipies), but there are entries for several other languages.

Not the answer you're looking for? Browse other questions tagged or ask your own question.