Domanda di colloquio di Meta

Given array of elements of 3 types. Sort it.

Risposte di colloquio

Anonimo

27 giu 2012

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

1

Anonimo

26 giu 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

Anonimo

13 feb 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.

Anonimo

13 giu 2012

Use counting sort for example.

Anonimo

24 ago 2012

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