Question d’entretien chez Booking.com

I faced one question. Simple programing problem. The problem was, given two arrays, retrieve the minimal common element.

Réponses aux questions d'entretien

Utilisateur anonyme

14 oct. 2014

Guess what they want to know from you is quite difficult. And I realized after the interview. I solved problem extracting the common values and then sorting the results. But they were expecting that I use structures like hash tables to solve the problem in O(n) I think if they have had mentioned that from the begging, I would have passed to the next step.

Utilisateur anonyme

14 juin 2016

Given one array of size M and the other of size N. Create a Hash with all words from M as key and value 0 for Each word in N if its present in the hash (0 present null not present) change the value to 1 this is O(M + N) for each key in hash if the value is 1 put it in a variable "min_str" if the key size is smaller them min_str min_str wlll then have te minimum string. this is O(M+N) as well so overall complexity O(M+N)

2