1mg Interview Experience (Off Campus)
I was interviewed for Software Developer Profile at 1mg, gurugram.
Round 1:Â Online Test
- Given an array of numbers, arrange them in a way that yields the largest value.
For example, if the given numbers are {54, 546, 548, 60}, the arrangement 6054854654 gives the largest value. And if the given numbers are {1, 34, 3, 98, 9, 76, 45, 4}, then the arrangement 998764543431 gives the largest value. - We have to find the count of Longest increasing subsequence (LIS) for each change we made at ith position in array from 1 to n, i.e 1<=a[i]<=n.
– Input:
3 1        // n i
1 2 3
– Output:
2     //LIS of 1 1 3  put a[i]=1
3    // LIS of 1 2 3   put a[i]=2
2    //LIS of 1 3 3   put a[i]=3
– Time Complexity Required: O(nlogn)+O(n)
Round 2:
- Tell me about yourself.
- Current project in the current organization
– REST VS SOAP
– HTTP Methods of REST
– Write a REST service to search a particular data in Database in current project. - Design an Authentication system (with only email ans password)(with flow and Database Schema).
- Design a Third party Authentication system via Facebook(with flow and Database Schema).
Round 3:
- Discussion on College Project based on Machine learning ( explain KNN- classifier )
-
Find the minimum element in a sorted and rotated array
Input: {5, 6, 1, 2, 3, 4}
Output: 1 - To find maximum length substring in an input string which could be arranged into a palindrome, only even length palindromes are expected. Input is one line String which contains only integers.
The output is the length of the substring which could be arranged in palindrome.
Input:Â124565463
Output:Â6
 (substringÂ456546
 can be rearranged to an even palindrome) - In 1D number line system (-Infinity, +Infinity), at beginning a car with velocity(V)=+1 at position(pos)=0 (origin), with every Acceleration(A) it jumps twice of its current velocity(in +ve or -ve direction) and with every Reverse(R) it’s position remain same but velocity changes to -1 if its was +ve or +1 if it was -ve.
You have to find the count of shortest string (combination of A’s and R’s) to reach from origin to +N
Input:Â+6
Output:Â5
 (substringÂAAARA
 )
Explanation: pos   V
Initial :Â Â Â Â Â Â 0Â Â Â Â +1
after A:Â Â Â Â Â +1Â Â Â Â +2
after A:Â Â Â Â Â +3Â Â Â Â +4
after A:Â Â Â Â Â +7Â Â Â Â +8
after R:Â Â Â Â Â +7Â Â Â Â Â -1
after A:Â Â Â Â Â+6
    -2 - Implement rand5() using rand2()
Round 4:
- Given an array of n elements which contains elements from 0 to n-1, with any of these numbers appearing any number of times. Find these repeating numbers in O(n) and using only constant memory space.
For example, let n be 7 and array be {1, 2, 3, 1, 3, 6, 6}, the answer should be 1, 3 and 6. - Given an unsorted array of n integers which can contain integers from 1 to n. Some elements can be repeated multiple times and some other elements can be absent from the array.Count frequency of all elements .
Input: arr[] = {2, 5, 3, 2, 5}
Output: Below are frequencies of all elements
1 -> 0
2 -> 2
3 -> 1
4 -> 0
5 -> 2 -
What happens when you type google.com in the browser (with network flow) ?
- Computer network concepts
Round 5: VP round
- Tell me about yourself.
- Current project in the current organization
– What was the toughest challenge you faced in a project? - Why do you want to leave current organisation
- Print characters and their frequencies( special characters can be present).
Input : str = “$characters$”
Output : $2 c2 h1 a2 r2 t1 e1 s1
Hint: Hash, AVL
Got Offer but declined as I had better option, not in terms of money but in tech. stack
Please Login to comment...