Pergunta de entrevista da empresa PayPal

1. Print unique words sorted in order of length from a file. 2. Rotate an array 3. How threads work? How threads work in a single processor system?

Respostas da entrevista

Sigiloso

4 de nov. de 2017

1. I gave an HashMap> solution. But the interviewer expected a TreeMap solution. But a TreeMap would not be suitable for this question since it will not add elements of same length. 2. I gave him a O(n*d) solution with constant space. He wanted an O(n) with constant space solution which I could not give.

Sigiloso

7 de mai. de 2020

We can use treemap along with comparator to sort based on words length.