Curefit interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

Curefit
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Dynamic Programming, Greedy Techniques, Data Structures, OOPs, DBMS, Graph Theory
Tip
Tip

Tip 1 : Prepare OS,DBMS,OOPs too
Tip 2 : Mention at-least one project or past work experience in your resume
Tip 3 : Try maintaining 8+ CGPA as sometimes shortlist is done based on CGPA
Tip 4 : Try past interview questions from Leetcode,Interviewbit.

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Try to Keep Resume 1 Pager
Tip 2 : Have atleast one project or past work experience mentioned
Tip 3 : Don't put false things on Resume as questions are asked in detail from Resume

Interview rounds

01
Round
Medium
Online Coding Test
Duration45 Minutes
Interview date10 Nov 2020
Coding problem2

The first Round was held on Hackerrank and the questions were of medium difficulty based on Data Structures and Algorithms.
The time of test was 1:00 PM and it was of 45 minutes with 2 coding questions to be solved.

1. Merge Intervals

Moderate
20m average time
80% success
0/80
Asked in companies
GoogleInnovaccerFacebook

You are given N number of intervals, where each interval contains two integers denoting the start time and the end time for the interval.

The task is to merge all the overlapping intervals and return the list of merged intervals sorted by increasing order of their start time.

Two intervals [A,B] and [C,D] are said to be overlapping with each other if there is at least one integer that is covered by both of them.

For example:

For the given 5 intervals - [1, 4], [3, 5], [6, 8], [10, 12], [8, 9].

Since intervals [1, 4] and [3, 5] overlap with each other, we will merge them into a single interval as [1, 5].

Similarly, [6, 8] and [8, 9] overlap, merge them into [6,9].

Interval [10, 12] does not overlap with any interval.

Final List after merging overlapping intervals: [1, 5], [6, 9], [10, 12].
Problem approach

I firstly sorted the intervals based on their second values and then I considered each interval if it overlaps with the previous one or not.
Time Complexity : O(nlogn)
Space complexity : O(n)

Try solving now

2. Josephus

Moderate
30m average time
70% success
0/80
Asked in companies
Goldman SachsWalmartAmazon

‘N’ people are standing in a circle numbered from ‘1’ to ‘N’ in clockwise order. First, the person numbered 1 will proceed in a clockwise direction and will skip K-1 persons including itself and will kill a Kth person. Now (K+1)th person from 1 will start and will kill the Kth person from itself.

You have to find the position of the last person surviving with respect to initial numbering.

Note:
A person can also kill himself.
Problem approach

Firstly I tried recursively to fix my position to every place and check if I am remaining till Last to survive. But the Interviewer asked me to do better, then I thought of this question as a circular Linked List where in each step length decreases by one. Then I derived Mathematical formula for the position to survive till last with :
Time Complexity : O(n)
Space Complexity : O(n)

Try solving now
02
Round
Medium
Coding Test - Pen and paper
Duration75 minutes
Interview date14 Nov 2020
Coding problem2

A google Doc was shared with us and we were supposed to write code there.
Use of IDEs was not allowed so we had to write correct code on Google Docs which was later checked by them through online IDEs.
The Interviewer were friendly and observative and helped us through code if we made some silly error.

1. Largest rectangle in a histogram

Hard
25m average time
75% success
0/120
Asked in companies
AmazonDelhiveryCurefit

You have been given an array/list 'HEIGHTS' of length ‘N. 'HEIGHTS' represents the histogram and each element of 'HEIGHTS' represents the height of the histogram bar. Consider that the width of each histogram is 1.

You are supposed to return the area of the largest rectangle possible in the given histogram.

For example :
In the below histogram where array/list elements are {2, 1, 5, 6, 2, 3}.

alt text

The area of largest rectangle possible in the given histogram is 10.
Problem approach

Firstly I tried brute force considering all possible left and right pointer and checking what all rectangle areas we can get and taking maximumm from them.
But the interviewer wanted better time complexity than O(n*n)
So I used two arrays Left and right and kept check of next shorter rectangle index to the present one.
This had Time Complexity of O(n) and Space Complexity : O(n)
The interviewer was pleased with this approach

Try solving now

2. Boundary Traversal

Hard
20m average time
85% success
0/120
Asked in companies
Morgan StanleyMicrosoftSalesforce

You are given a binary tree having 'n' nodes.


The boundary nodes of a binary tree include the nodes from the left and right boundaries and the leaf nodes, each node considered once.


Figure out the boundary nodes of this binary tree in an Anti-Clockwise direction starting from the root node.


Example :
Input: Consider the binary tree A as shown in the figure:

alt text

Output: [10, 5, 3, 7, 18, 25, 20]

Explanation: As shown in the figure

The nodes on the left boundary are [10, 5, 3]

The nodes on the right boundary are [10, 20, 25]

The leaf nodes are [3, 7, 18, 25].

Please note that nodes 3 and 25 appear in two places but are considered once.
Problem approach

I made three functions as the order given in Problem statement and did the Traversals in the same way making sure to cover all the edge cases .
This is similar to Preorder/Postorder/Inorder type problems.
Time Complexity : O(n)

Try solving now
03
Round
Easy
Face to Face
Duration60 minutes
Interview date16 Nov 2020
Coding problem2

The face to face round was held on Google Meet where initially interviewer asked a DS/Algo problem. Later the manager joined and asked about our resume projects in detail.
The time was 10:00 AM.

1. Maximum Subarray Sum

Moderate
25m average time
75% success
0/80
Asked in companies
Paytm (One97 Communications Limited)AmazonSnapdeal

Given an array of numbers, find the maximum sum of any contiguous subarray of the array.


For example, given the array [34, -50, 42, 14, -5, 86], the maximum sum would be 137, since we would take elements 42, 14, -5, and 86.


Given the array [-5, -1, -8, -9], the maximum sum would be -1.


Follow up: Do this in O(N) time.

Problem approach

First I tried brute force approach with taking sum between all left top corner and bottom right corners rectangle formed .
This had time complexity of O(n^4).
Then I brought down the time complexity to O(n^3) by using Kadane's Algorithm and coded it on Docs Shared.

Try solving now

2. Search In Rotated Sorted Array

Moderate
30m average time
65% success
0/80
Asked in companies
Tata 1mgWalmartDelhivery

Aahad and Harshit always have fun by solving problems. Harshit took a sorted array consisting of distinct integers and rotated it clockwise by an unknown amount. For example, he took a sorted array = [1, 2, 3, 4, 5] and if he rotates it by 2, then the array becomes: [4, 5, 1, 2, 3].

After rotating a sorted array, Aahad needs to answer Q queries asked by Harshit, each of them is described by one integer Q[i]. which Harshit wanted him to search in the array. For each query, if he found it, he had to shout the index of the number, otherwise, he had to shout -1.

For each query, you have to complete the given method where 'key' denotes Q[i]. If the key exists in the array, return the index of the 'key', otherwise, return -1.

Note:

Can you solve each query in O(logN) ?
Problem approach

Firstly I gave the solution of Linear Search but he asked to implement binary search with all corner cases .
So I implemented binary search for finding the number of rotations array has went through.

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

How do you create a function in JavaScript?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - Intern
4 rounds | 4 problems
Interviewed by Curefit
999 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by Curefit
992 views
0 comments
0 upvotes
company logo
Software Engineer
3 rounds | 5 problems
Interviewed by Curefit
1768 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by Curefit
580 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
13596 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
12783 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
9049 views
2 comments
0 upvotes