Pergunta de entrevista da empresa Meta

Given array of elements of 3 types. Sort it.

Respostas da entrevista

Sigiloso

27 de jun. de 2012

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

1

Sigiloso

26 de jun. de 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

Sigiloso

13 de fev. de 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.

Sigiloso

13 de jun. de 2012

Use counting sort for example.

Sigiloso

24 de ago. de 2012

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