## Interview Question for Software Engineer Interns

• 0

Country: United States
Interview Type: In-Person

Comment hidden because of low score. Click to expand.
1
of 1 vote

``````static List<ArrayList> GetAllArray(int[] intData)
{
List<ArrayList> AllArray = new List<ArrayList>();

//Create 20 Array in array collection
for (int i = 0; i < 20; i++)

for (int i = 0; i < intData.Length; i++ )
{
}

return AllArray;
}``````

In this solution provide O(n) solution

Comment hidden because of low score. Click to expand.
0
of 0 vote

``````Simple solution for this problem in php
Complexty : O(N*N)

function getAllTwentiethElements (\$inputArray) {
\$arraySize = count(\$inputArray);
\$outputArrayCollection = array();
if (\$arraySize <= 20) {
return \$outputArrayCollection;
}
for (\$i = 0; \$i < \$arraySize; \$i++) {
\$outputArray = array();
for (\$j = \$i; \$j < \$arraySize; (\$j = \$j+20)) {
\$outputArray [] = \$inputArray[\$j];
}
\$outputArrayCollection[] = \$outputArray;
}
return \$outputArrayCollection;
}
\$inputArray  = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23);
\$outputArrayCollection = getAllTwentiethElements(\$inputArray);``````

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

### Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.