Question d’entretien chez Amazon

1. Implement a function (you can choose language) that returns longest repeating substring. For example "asdfsaasdf" should return "asdf". I asked question if strings can overlap answer was "yes". 2. Provide OO design for a parking lot.

Réponse à la question d'entretien

Utilisateur anonyme

23 avr. 2018

I told the interviewer that I am going to implement to implement this function using suffix tree. He said that I should try different solution. I asked why he thinks this one is wrong? After few minutes I understood my mistake - solution I chosen requires more coding than fits in 15 minutes. I remember another solution with NxN matrix but interviewer wanted to go to design question.