GFG App
Open App
Browser
Continue

# 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 rand3() using rand2()

• Implement rand5() using rand2()

Round 4:

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

My Personal Notes arrow_drop_up