You earn badges by solving challenges on the various practice tracks on hackerrank.com. If you solve a challenge in an official HackerRank contest, you will earn points towards your progress once the challenge is added to the practice site. The badges you earn will be added to your profile, and will be visible for other users.