0% found this document useful (0 votes)
11 views3 pages

Guna

The document contains a series of mock interview questions that involve manipulating arrays and strings through various tasks. Each question provides an input, a specific task to perform, and the expected output. The tasks include adding elements, modifying arrays, filtering values, and string operations.

Uploaded by

shaseliyapri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Guna

The document contains a series of mock interview questions that involve manipulating arrays and strings through various tasks. Each question provides an input, a specific task to perform, and the expected output. The tasks include adding elements, modifying arrays, filtering values, and string operations.

Uploaded by

shaseliyapri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

MOCK INTERVIEW QUESTIONS

Question 1:

Input:
Array = [11, 22, 33, 44]
Task: Add the previous element to the current element.
Expected Output: [33, 55, 77, 99]

Question 2:

Input:
Array = [1, 5, 10, 15, 20]
Task: Add 5 to each element until the sum exceeds 50.
Expected Output: [1, 5, 10, 15, 20] (continue adding till sum exceeds 50)

Question 3:

Input:
Array = [10, 20, 30, 40, 50]
Task: Remove the last element and add 60 at the end.
Expected Output: [10, 20, 30, 40, 60]

Question 4:

Input:
Array = [7, 14, 21]
Task: Add 28 at the end.
Expected Output: [7, 14, 21, 28]

Question 5:

Input:
Array = [1, 2, 3, 4, 5]
Task: Remove the first element and add 6 at the start.
Expected Output: [6, 2, 3, 4, 5]

Question 6:

Input:
Array = [2, 3, 4]
Task: Add 1 at the start.
Expected Output: [1, 2, 3, 4]
Question 7:

Input:
Arrays = [[50, 60], [70, 80]]
Task: Combine both arrays.
Expected Output: [50, 60, 70, 80]

Question 8:

Input:
Array = [5, 10, 15, 20]
Task: Create a new array where each element is reduced by 5.
Expected Output: [0, 5, 10, 15]

Question 9:

Input:
Array = [11, 12, 13, 14]
Task: Filter the array to get only numbers that are odd.
Expected Output: [11, 13]

Question 10:

Input:
Array = [20, 30, 40, 50],
Task: Modify the array by adding 35 at index 2 without removing any element.
Expected Output: [20, 30, 35, 40, 50]

Question 11:

Input:
Array = [15, 20, 25, 30, 35]
Task: Extract a portion of the array from index 2 to 5
Expected Output: [25, 30, 35]

Question 12:

Input:
Array = [5, 10, 15, 20]
Task: Print each element divided by 5.
Expected Output:
1
2
3
4

Question 13:

Input:
String = "cat-dog-rat"
Task: Split the string by hyphens.
Expected Output: ['cat', 'dog', 'rat']

Question 14:

Input:
Array = ['this', 'is', 'a', 'test'],

Task: Join the array elements into a single string, separated by " - ".
Expected Output: "this - is - a - test"

Question 15:

Input:
Array = [5, 'a', true, null]
Task: Convert the array to a string.
Expected Output: "5,a,true,null"

You might also like