There are times when programmers have to write functions that are recursive, where the critical problem that such functions eat up the entire allocated stack space. To overcome this challenge, Scala provides a “tail recursion” mechanism.

This mechanism optimizes recursive functions so that they do not create new stack space and use the existing stack space.

BY Best Interview Question ON 04 Apr 2020