Question d’entretien chez Acturis

Given pseudo code functions such as sub-string, a while loop and a for loop, write a code that uses some form of recursion to return the given string written backwards.

Réponse à la question d'entretien

Utilisateur anonyme

7 sept. 2024

This question I got right but not in the concise way they were looking for. I wrote a python-like loop using a dummy variable "n" to grab the letters from the end in reverse order stopping after every character had been taken. The answer they were looking for was a function that grabbed the last letter of a string, then called the function within itself instead using a substring instead as a parameter, the substring being the same string with the last letter cut off. The stopping when the substring is empty.