This repository is an effort to contribute solutions in Scala for the coding-problems in the book "CRACKING the CODING INTERVIEW" by Gayle Laakmann McDowell Reference to the Books Web-site for all details about the book and Author :) https://www.crackingthecodinginterview.com
Go to Scala-lang website https://www.scala-lang.org/ Follow the scala install guide or got to https://www.scala-lang.org/download/
Recommended use coursier install scripts for MacOS either brew or curl as suitable to you . For windows use Scala Installer For Linux follow the latest install instruction | Recommended follow the curl command which uses/downloads coursier script.
All Solution / Coding Question Source code resides under src/main/scala
directory .
Coursier will automatically install scala, scalafmt, REPL's, scala-compiler etc. even JDK on your system.
This is a normal sbt project. You can compile code with sbt compile
, run it with sbt run
, and sbt console
will start a Scala 3 REPL.
For more information on the sbt-dotty plugin, see the scala3-example-project.
cd to the solution.scala file of any coding question.
execute scala file_name.scala
to run it.
In VS code install scala-metals extension . then from vscode window dash select Run Tab
sometimes "metals.javaHome": "path/jdk/home" has to be set with path to your JDK in .vscode settings.json reference !
Intellij works out of the box maximum times / like always !
- select Run without debugging to run normally.
- select Start Debugging to debug code with added break-points.