Sigmoid Analytics Interview Questions
Round 1 Interview
Question 1:- You have random numbers in an array between 0 and 1. You have to separate these numbers in the array where all the 0's should be on left side and all the 1's should be on the right side of the array. For example:- arr = {0,1,1,0,0,1,0,1,1,1,0,0} after separation arr = {0,0,0,0,0,0,1,1,1,1,1,1}
Question 2:- You are given an array in which there are numbers from 1 to n and one number from that series is missing in the array. Write a program to find the number that is missing from the series. For example:- arr = {1,2,3,5,6} so here number 4 is missing.
Round 2 Interview
Question 1:- Write a code for Level Order traversal for Binary Tree
Question 2:- There are n stairs, a person standing at the bottom wants to climb stairs to reach the nth stair. The person can climb either 1 stair or 2 stairs at a time, the task is to count the number of ways that a person can reach at the top.
Input: n = 1
Output: 1
Explanation
: There is only one way to climb 1 stair
Input: n = 2 Output: 2
Explanation : There are two ways: (1, 1) and (2)
Input: n = 4 Output: 5
Explanation : (1, 1, 1, 1), (1, 1, 2), (2, 1, 1), (1, 2, 1), (2, 2)
Question 3:- Write a program to merge two sorted arrays
Input: arr1[] = { 1, 3, 4, 5}, arr2[] = {2, 4, 6, 8}
Output: arr3[] = {1, 2, 3, 4, 4, 5, 6, 8}
Input: arr1[] = { 5, 8, 9}, arr2[] = {4, 7, 8}
Output: arr3[] = {4, 5, 7, 8, 8, 9}
Comments
Post a Comment