Practice
Here are some resources for practicing C skills (mostly for those who
already know the language). These might be useful for beginners
building skills or for experienced programmers who want to sharpen
their skills or who simply want project ideas.
Practice Exercises
Most of these exercises come with a way to check your answer.
- Computer Science by Example
- Although some of these exercises are suitable for beginners,
there are also some “bonus exercises” that more advanced
programmers might find useful.
- HackerRank
- Lots of people like this. However, use with caution as some of
the code you will see exhibits poor habits (e.g. not checking for
errors).
- If you are going to use these, consider pairing them with a
teaching resource with a strong focus on correctness and good
habits. Such as Effective C (see Books Suitable for
Programming
Beginners).
- Advent of Code - Christmas-themed
puzzles. New puzzles each December. Within each year’s exercises,
the first ones are relatively easy and the later ones get very hard
(requiring significant Data Structures & Algorithms skills, often
from about day 16). Created by Eric Wastl.
- Synacor Challenge -
also created by Eric Wastl.
- The original page is gone now, but the above URL provides all the things you will need.
- The challenge is to build an emulator for a computer described in
the instructions, and then use it to run an example program
… which presents additional challenges.
- Caveat: there are lots of spoilers for this on the web
- Rosetta Code
- Project Euler - mathematically focused
puzzles with graduated difficulty
- Online Judge systems
- These provide questions and will automatically tell you if your solution is correct.
- There is a list of these at https://code.fandom.com/wiki/Online_judge
- Code Kata Collections
- http://codekata.com/ - puzzles, but no solutions are provided
- List of Katas by Gabe Montalvo
Project Ideas
These generally won’t come with solutions.
- General Stuff
- https://codingchallenges.fyi/challenges/intro/
- Lists of projects ideas
- Topics
Things to Stay Away From
Here are some anti-recommendations of learning resources I do not
recommend you use, each with a brief explanation.
- codeforwin.org
- The model answers have some significant style problems. Our
concern is that you would learn counterproductive habits by
learning from these.
- https://github.com/manjunath5496/Beginner-C-Exercises
- Model answers exhibit sloppy habits and lack any useful
indentation
- www.placementpreparation.io
- Solution judge rejects answers for very early exercises that are
close enough to correct (e.g. too many decimal places in
floating-point answers)
- Solutions sometimes look garbled due to character encoding
issues.
- www.scribd.com/document/876660790/30-Beginner-C-Programming-Exercises-With-Solutions
- More bad habits. Some solutions (e.g. GCD) could benefit from
commentary or explanation but don’t have them.
- https://www.learn-c.org/
- This is actually not quite as bad as other other sites listed
here but it does have some problems. Specifically, corectness
issues (e.g. printing pointers with %x) and it’s slightly out of
date (e.g. claims C has no boolean type).
Things We’d Like a Review of
Here are some resources Ihaven’t evaluated yet and so haven’t been
able to put them in the “Recommended” or “Not Recommended” sections.
If you have an opionion (and can explain why) please let me know.