Think in Scala & master the highest paid programming language in the US

Scala is used at many places, such as AirBnB, Apple, Bank of America, BBC, Barclays, Capital One, Citibank, Coursera, eBay, JP Morgan, LinkedIn, Morgan Stanley, Netflix, Singapore Exchange, Twitter.

Study our 94 Scala Algorithms: 6 fully free, 54 published & 40 upcoming

Fully unit-tested, with explanations and relevant concepts; new algorithms published about once a week.

  1. Monitor success rate of a process that may fail
  2. Find combinations adding up to N (unique)
  3. Find k closest elements to a value in a sorted Array
  4. Quick Sort sorting algorithm in pure immutable Scala
  5. Find minimum missing positive number in a sequence
  6. Compute a Roman numeral for an Integer, and vice-versa
  7. Matching parentheses algorithm with foldLeft and a state machine
  8. Traverse a tree Breadth-First, immutably
  9. Read a matrix as a spiral
  10. Remove duplicates from a sorted list (state machine)
  11. Merge Sort: stack-safe, tail-recursive, in pure immutable Scala, N-way
  12. Longest increasing sub-sequence length
  13. Binary search a generic Array
  14. Merge Sort: in pure immutable Scala
  15. Is an Array a permutation?
  16. Count number of contiguous countries by colors
  17. Add numbers without using addition (plus sign)
  18. Tic Tac Toe MinMax solve
  19. Run-length encoding (RLE) Encoder
  20. Print Alphabet Diamond
  21. Balanced parentheses algorithm with tail-call recursion optimisation
  22. Reverse a String's words efficiently
  23. Count number of changes (manipulations) needed to make an anagram with foldLeft and a MultiSet
  24. Counting inversions of a sequence (array) using a Merge Sort
  25. Check if an array is a palindrome
  26. Compute nth row of Pascal's triangle
  27. Run-length encoding (RLE) Decoder
  28. Check if a number is a palindrome
  29. In a range of numbers, count the numbers divisible by a specific integer
  30. Find the index of a substring ('indexOf')
  31. Reshape a matrix
  32. Closest pair of coordinates in a 2D plane
  33. Find the contiguous slice with the minimum average
  34. Compute maximum sum of subarray (Kadane's algorithm)
  35. Binary search in a rotated sorted array
  36. Rotate Array right in pure-functional Scala - using an unusual immutable efficient approach
  37. Length of the longest common substring
  38. Tic Tac Toe board check
  39. Find an unpaired number in an array
  40. Check if a String is a palindrome
  41. Count binary gap size of a number using tail recursion
  42. Remove duplicates from a sorted list (Sliding)
  43. Find sub-array with the maximum sum
  44. Find the minimum absolute difference of two partitions
  45. Find maximum potential profit from an array of stock price
  46. Fibonacci in purely functional immutable Scala
  47. Fizz Buzz in purely functional immutable Scala
  48. Find combinations adding up to N (non-unique)
  49. Count factors/divisors of an integer
  50. Compute single-digit sum of digits
  51. Traverse a tree Depth-First
  52. Reverse bits of an integer
  53. QuickSelect Selection Algorithm (kth smallest item/order statistic)
  54. Rotate a matrix by 90 degrees clockwise

Explore the 21 most useful Scala concepts

To save you going through various tutorials, we cherry-picked the most useful Scala concepts in a consistent form.

  1. Class Inside Class
  2. Class Inside Def
  3. Collect
  4. Def Inside Def
  5. Drop, Take, dropRight, takeRight
  6. foldLeft and foldRight
  7. For-comprehension
  8. Lazy List
  9. Option Type
  10. Ordering
  11. Partial Function
  12. Pattern Matching
  13. Range
  14. scanLeft and scanRight
  15. Sliding / Sliding Window
  16. Stack Safety
  17. State machine
  18. Tail Recursion
  19. Type Class
  20. View
  21. Zip

Register now (free)


How the algorithms look

  1. A description/goal of the algorithm.
  2. An explanation with both Scala and logical parts.
  3. A proof or a derivation, where appropriate.
  4. Links to Scala concepts used in this specific algorithm, also unit-tested.
  5. An implementation in pure-functional immutable Scala, with efficiency in mind (for most algorithms, this is for paid subscribers only).
  6. Unit tests, with a button to run them immediately in our in-browser IDE.
Screenshot of an example algorithm demonstrating the listed features

What our users say


Register now (free)