Round 1
Given the grid of 1's and 0's where 1 represent that bulb is switched ON and 0 represent the bulb is switched off find whether all of them bulbs can be switched off that is all grid values can be turn to 0. You can flip a row or column i.e. 0 0 1 0 0 will become 1 1 0 1 1 .(Given grid can be of any size)
For Ex:
0 0 1 0 0
0 0 1 0 0
0 0 1 0 0
1 1 0 1 1
0 0 1 0 0
Here if we flip last second row and then flip the middle column all will be 0. so return true.
1 0 0
0 1 0
0 0 1
returns false
Round 2
You have digital clock in front of you which shows the time in 12h format (eg 3:05 pm).
You need to implement a method to set the clock to the given time format from current time the clock is showing, with the least amount of button presses.
Clock.getCurrentTime() - returns the current time as [HH, MM, "AM"|"PM"]
Clock.queryButtonActions() - returns a list of possible time advancements
Clock.pressButton(i) - presses the button returned by queryButtonActtions at index i
Round 3
Behavioural Questions
Round 4
Given an array and a target sum find the list of non-overlapping subarray equals to the target sum and then find the smallest among them and return the start index of that subarray. And if two lengths are equal return the smallest index
For Ex: [1,2,3,1,1,1,1,1,5]
<1,2><3,2><8,1>
Ans is 9
Round 5
Given a JOB array where each has a start time, duration and cpus required. Find out if all the jobs can be finished given a max amount of CPU. Your function should return false if there is possibility that at a given time no of cpus in use is more than the max nos of cpu available
class Job{
int start;
int duration,
int cpus;
}
public boolean findJobsutilization(Job[] arr, int maxCpus)