Pergunta de entrevista da empresa ZeMoSo

Core Java Questions: You could be asked any question, but I was asked the following questions. Seemed like the interviewer came with a fixed set of questions, as every question was either a definition or a difference between two things. notify vs wait. iterator vs listIterator immutable Object & why we need it Hashing concept HashSet vs HashTable Problem Solving: It was a simple one, I solved it, yet got rejected probably due to some wrong definitions... Input: Array of Integers [1,2,3,4,5] Iterations - 4 Group - 3 Expected Output: 1, 2, 3 4, 5, 1 2, 3, 4 5, 1, 2

Resposta da entrevista

Sigiloso

27 de nov. de 2022

Problem Solving Answer: void printCyclicArray(int [] arrayOfIntegers, int iterations, int group) { int arrayIndex = 0; for(int i=0;i group) arrayIndex = 0; if( j < group-1) System.out.print(arrayOfIntegers[arrayIndex]+", "); else System.out.print(arrayOfIntegers[arrayIndex]); } System.out.println(); } }