Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
nurture.farm interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

nurture.farm
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
Being from a tier 3 college got no opportunity in college, there was no coding culture in our college so ended by started up in a service based company, worked for 2 years at service based company i worked hard to get multiple offers and selected microsoft from those.
Application story
There was an opening on Linkedin for the role of backend engineer in Nurture.farm. I applied on the opening and received a test link from HR. After that she scheduled interviews for me.
Why selected/rejected for the role?
Rejected, interview round 2 did not go the way as i expected it to be. I was not able to answer some of the questions asked by interviewer.
Preparation
Duration: 4 months
Topics: Data structures, Algorithms, OOPS, OS, DBMS, Computer Networks, System Design
Tip
Tip

Tip 1 : Make sure you have your computer science fundamentals very clear.
Tip 2 : You should know the complexity of the code you write and should know the internal implementation of the data structure you use while coding.
Tip 3 : You should know about everything you write in your resume.
Tip 4 : Practice a lot of programming problems. Participate in competitive programming contests.

Application process
Where: Linkedin
Eligibility: BTech Computer Science
Resume Tip
Resume tip

Tip 1 : Be honest about what you write in your resume.
Tip 2 : Should have at least 2 projects
Tip 3 : Maintain a precise and self-speaking one-page resume.
Tip 4 : Add technical achievements only.

Interview rounds

01
Round
Medium
Video Call
Duration75 minutes
Interview date24 Mar 2022
Coding problem2

Interviewer straight away shared doc with 2 coding questions and gave me some time to think followed by discussion.

1. Bursting Balloons

Moderate
40m average time
60% success
0/80
Asked in companies
QuikrSamsungOracle

You are given an array 'ARR' of N integers. Each integer represents the height of a balloon. So, there are N balloons lined up.

Your aim is to destroy all these balloons. Now, a balloon can only be destroyed if the player shoots its head. So, to do the needful, he/ she shoots an arrow from the left to the right side of the platform, from an arbitrary height he/she chooses. The arrow moves from left to right, at a chosen height ARR[i] until it finds a balloon. The moment when an arrow touches a balloon, the balloon gets destroyed and disappears and the arrow continues its way from left to right at a height decreased by 1. Therefore, if the arrow was moving at height ARR[i], after destroying the balloon it travels at height ARR[i]-1. The player wins this game if he destroys all the balloons in minimum arrows.

You have to return the minimum arrows required to complete the task.

Problem approach

Since we need smaller window answer for larger windows, so we have to store the answer for window of each size from 1 to n.
Then we will have two pointers left and right to point at the two ends of our current window. For example if we have array [1,1,2,3,4,5,1] and we have to get the answer for subarray [2,3,4] then left will point at index 2and right at index 4.
Now in the current window we have to burst baloons in such sequence that we get the max value. And for this we have to check for each baloon in that window whether it can give the max value if burst at last.
So for this we have to traverse from left to right in the window and each time calculate the value assuming ith baloon is burst at last.
So while filling Dp we will be filling values for left to right window , i.e.,
dp[left][right] = Max(already calculated value, burst this ith baloon last and add left and right subarray points within the window)
dp[left][right] = max(dp[left][right], arr[left-1] * arr[i] * arr[right+1] + dp[left][i-1] + dp[i+1][right])

Try solving now

2. LRU Cache

Moderate
0/80
Asked in companies
FlipkartExpedia GroupOla
Design a data structure that satisfies the constraints of a Least Recently Used (LRU).
1. Get(int num): If the key exists, it will return the value of the key stored. Else, return -1.    
2. Put(int key, int value): If the key already exists, update the value of the key. Else add the key-value pair to the cache. If the number of keys is more than the capacity for this operation, delete the least recently key used. 
Example:
For the following input: 

4 2
2 1 4
1 1
1 4

We will initialize an empty LRU cache for the first operation with a maximum capacity of 2.
For the first operation, we need to add a key-value pair (1,4) to the cache.
For the second operation, we need to return the value stored for key 1, i.e., 4
For the third operation, we need to return -1, as we don't have any key 4 in the cache.

So, the final output will be: 
4  -1
Problem approach

Since we need smaller window answer for larger windows, so we have to store the answer for window of each size from 1 to n.
Then we will have two pointers left and right to point at the two ends of our current window. For example if we have array [1,1,2,3,4,5,1] and we have to get the answer for subarray [2,3,4] then left will point at index 2and right at index 4.
Now in the current window we have to burst baloons in such sequence that we get the max value. And for this we have to check for each baloon in that window whether it can give the max value if burst at last.
So for this we have to traverse from left to right in the window and each time calculate the value assuming ith baloon is burst at last.
So while filling Dp we will be filling values for left to right window , i.e.,
dp[left][right] = Max(already calculated value, burst this ith baloon last and add left and right subarray points within the window)
dp[left][right] = max(dp[left][right], arr[left-1] * arr[i] * arr[right+1] + dp[left][i-1] + dp[i+1][right])

Try solving now
02
Round
Hard
Video Call
Duration75 minutes
Interview date31 May 2023
Coding problem2

The interview was primarily based on Development skills and system design(I was not prepared for this). Interviewer asked 1 coding question as well.

1. Design a Restaurant Management System

Design a Restaurant Management System

Problem approach

Tip 1 : Prepare System Design questions.
Tip 2 : Prepare Previously Asked Questions.

2. Maximum Sum

Moderate
25m average time
75% success
0/80
Asked in companies
AmazonAmazonOptum

You are given an array ‘arr’ consisting of ‘N’ integers. Your task is to maximize the value of 0 * arr[0] + 1 * arr[1] + 2 * arr[2] … (N - 1) * arr[N - 1] . You can rotate the array as many times as you wish.

For Example:
For the given arr[ ] = { 1, 2, 3, 1} 
After 0 rotation arr[ ] = { 1, 2, 3, 1} the sum is = (0 *1 + 1 * 2 + 2 * 3 + 3 * 1) = 11.
After 1 rotation  arr[ ] = { 1, 1, 2, 3} the sum is = (0 *1 + 1 * 1 + 2 * 2 + 3 * 3) = 14.
After 2 rotation arr[ ] = { 3, 1, 1, 2} the sum is = (0 *3 + 1 * 1 + 2 * 1 + 3 * 2) = 9.
After 3 rotation arr[ ] = { 2, 3, 1, 1} the sum is = (0 *2 + 1 * 3 + 2 * 1 + 3 * 1) = 8.
So the maximum sum is 14 when arr[ ] = { 1, 1, 2, 3}.
Problem approach

Traverse the array once and keep updating the frequency of array elements in the Map.
Check if the size of the map is equal to the total number of distinct elements present in the original array or not. If found to be true, update the maximum sum.
While traversing the original array, if the ith traversal crosses K elements in the array, update the Map by deleting an occurrence of (i – K)th element.
After completing the above steps, print the maximum sum obtained.

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

When does a stack underflow occur?

Choose another skill to practice
Start a Discussion
Similar interview experiences
SDE - 1
3 rounds | 6 problems
Interviewed by nurture.farm
2419 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
2030 views
0 comments
0 upvotes
company logo
SDE - Intern
1 rounds | 3 problems
Interviewed by Amazon
870 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 6 problems
Interviewed by Expedia Group
587 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
105603 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
50411 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
31390 views
6 comments
0 upvotes