Roblox Final Video Interview
5655

Along with bahvioral and situation based questions I was challenged with 1 coding question with my screen shared. The interviewer emphasized on having me narrate my thought process which he shall be more interested than the final end result.

Question - Fetch the final result using in-place array technique. No additional space usage allowed


Input - [A1, A2, A3, A4, B1, B2, B3, B4]
Output - [A1, B1, A2, B2, A3, B3, A4, B4]

My solution in the interview:
num = [1,2,3,4,5,6,7,8]
l = len(num)/2
index = int(l)
for i in range(len(num)):
	if (i + 1)%2 == 0:
		num = num[:i] + num[index: index + 1] + num[i: index] + num[index + 1:]
		index += 1
print(num)
Comments (5)