Practice exercises

I’ve started to learn Scala from scratch from Martin Odersky’s book- Programming in scala, 4th edition.
Can anyone please suggest me where can i find any good practice problem/exercises for each topic(preferably with solutions), so that I can get confident in Scala?

1 Like

While I don’t think any of the sections match that book 1-to-1, many folks find the Scala Exercises site quite helpful for this.


You can also check the exercises of the coursera course. And Scala 99 problems.


Hands-on Scala Programming, by Li Haoyi, contains exercises and solutions:

Starting from chapter 5, every chapter come with some exercises at the end… Some exercises ask you to make use of what you learned to write new code, others ask you to modify the code presented in the chapter, while others ask you to combine techniques from multiple chapters to achieve some outcome. …The solutions to these exercises are also available online as executable code examples.


Exercism has a track for Scala too:

There are even mentors which suggest improvements and you can get comments from other users too.


You could do yourself some good in a discipline you love: Pick up a book in Computer Science such as Algorithms (e.g., the latest edition of Cormen, T. H., Leiserson, C. E., Rivest, R., L., & Stein, C. (1990, 2009). Introduction to Algorithms (3rd ed.). Cambridge, MA: MIT Press.), General Statistics, Regression Analysis, Multivariate Analysis, Machine Learning, or Mathematics (e.g. a good text on Numerical Analysis or Differential Equations) and then do all the exercises. The head of the Computer Science, Statistics, or Math department at a local college or university almost certianly would be willing recommend a book with a lot of exercises. If you are working, ask your boss (or higher level manager) if there is an area or discipline the organization needs more knowledge/experience/competence in, and then pick up a book in that area and do all the exercises. If you are not working, go to an organization you might like to work for and ask someone (HR, a manager or an executive) there if there is an area or discipline that would be helpful to it. The main idea here is that you really do need someone older, wiser, and more knowledgeable about organizational needs to guide your efforts. Everybody who ever made it had a mentor!