Codility lesson 1 - Binary Gap
There is many services where you can test your programming skills. Not so long time ago I found out about Codility which provides programming tests in many languages. It's built mainly to help companies with hiring new programmers by providing automated platform to check candidates programming skills.
Though platform also has a programmer section, where you can test your knowledge and problem solving abilities for free.