Question d’entretien chez Meta

Given array of elements of 3 types. Sort it.

Réponses aux questions d'entretien

Utilisateur anonyme

27 juin 2012

Here, you can assume objects are small, middle and large for example.

1

Utilisateur anonyme

26 juin 2012

The question is plain wrong and i think is a trick question. You cannot have an array of 3 different types. Array can only be of a single type. If for some weird reason the interviewer asks you to assume such an array exists, then the first thing needed is Comparison routine or criteria i.e. rules to compare two elements to determine if one is smaller or larger

1

Utilisateur anonyme

13 févr. 2013

Interviewee wanted to here solution to Dutch National Flag problem. See http://en.wikipedia.org/wiki/Dutch_national_flag_problem I didn't know about it at that time.

Utilisateur anonyme

13 juin 2012

Use counting sort for example.

Utilisateur anonyme

24 août 2012

There is a clever O(n) in-place sorting algorithm for this.