Weird experience with Yubi Fintech | Mumbai | Senior Software Engineer | Startup
Recently had an interview with Yubi, a fintech startup having office in bombay for an SSE role.
Current company
Designation : Software Architect
Company : Fintech startup in bombay
CTC : 39L
Budget of the company was less than what I have currently, still I thought let's learn more about the organization during conversation with the interviewer. Funny that the interviewer was also not having clear idea about the company, other teams, vision of the company ( expected this since it is a startup )
I have given interviews at good companies including FAANG ones, never have I heard such a feedback. "Code was not neat" :P AAAND the rejection mail contains
We've reviewed your background and experience, and have decided to move ahead with other candidates who more closely align with our role requirements.
Question 1:
Given a sorted array of distinct elements arr[] of size n that is rotated at some unknown point, the task is to find the minimum element in it.
Input: arr[] = [5, 6, 1, 2, 3, 4]
Ans: 1
Solution given :
private static int findMinElement(int[] arr) {
int start =0;
int end = arr.length-1;
while(start<end){
int mid = start+ (end-start)/2;
int midElement = arr[mid];
if(arr[(mid-1+arr.length)%arr.length]>midElement && arr[(mid+1)%arr.length]>0 ){
return arr[mid];
}else{
if((mid-1+arr.length)%arr.length==0){
start=mid+1;
continue;
}else if((mid+1)%arr.length==arr.length-1){
end = mid;
}
if(arr[(mid-1+arr.length)%arr.length]>arr[0]){
start=mid+1;
}
else {
end = mid;
}
}
}
return -1;
}Question 2:
Given an array of integers. Find the next greater number to the right for each number.. for last number, since there is no next element to its right, next greater value is -1
Input: arr[] = [1, 3, 2, 4]
Ans: [3, 4, 4, -1]
Solution given :
public static void main(String[] args) {
int arr[] = {1,2,2,4,5};
Stack<Integer> st = new Stack<>();
List<Integer> l = new ArrayList<>();
for(int i=arr.length-1;i>=0;i--){
if(st.isEmpty()){
l.add(-1);
}else{
if(arr[i]<st.peek()){
l.add(st.peek());
}else{
while(!st.isEmpty() && arr[i]>=st.peek()){
st.pop();
}
if(st.isEmpty()){
l.add(-1);
}else{
l.add(st.peek());
}
}
}
st.push(arr[i]);
}
Collections.reverse(l);
System.out.println(l);
}I also conduct interviews myself, so I understand what qualities should be evaluated. From my experience in this interview, it seemed they were expecting a memorized solution, whereas I took a bit of time to think through and devise the solution during the discussion.
Every interview experience is a good redirection. :) I wish them good luck hiring engineers that can write code like robots and not like engineers.

