Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

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

Curefit

3 rounds | 4 Coding
problems

Preparation

Duration: 3 Months

Topics: Data structures, Algorithms, OOPS, Operating System, DBMS, Computer Networks

Tip

Tip 1 : Practice DSA questions daily (atleast 1), Be consistent.

Tip 2 : Make proper notes for last time revision of various algorithms and techniques.

Tip 3 : Do not copy projects for resume.

Application process

Where: Campus

Eligibility: 8.5 CGPA and above

Resume tip

Tip 1 : Make a single page resume, recruiters don't have enough time to go through multi-page resume.

Tip 2 : Do not put false things on resume, be yourself as much as you can.

01

Round

Easy

Video Call

Duration45 Minutes

Interview date31 Jul 2021

Coding problem2

This round was held on Google Meet Video Call at 10:30 A.M. There was a single Interviewer and he was very helpful.

```
For the given binary tree: [1, 2, 3, -1, -1, 4, 5, -1, -1, -1, -1]
Start Node: 3
1
/ \
2 3
/ \
4 5
Output: 2
Explanation :
In the zeroth minute, Node 3 will start to burn.
After one minute, Nodes (1, 4, 5) that are adjacent to 3 will burn completely.
After two minutes, the only remaining Node 2 will be burnt and there will be no nodes remaining in the binary tree.
So, the whole tree will burn in 2 minutes.
```

Problem approach

After thinking for some time I got that he wants me to find the diameter of BST because diameter will be the longest path for fire to travel.

I already solved the diameter problem earlier so it doesn't took me me much time to solve it.

```
There can be more than one subsequences with the longest length.
```

```
For the given array [5, 0, 3, 2, 9], the longest decreasing subsequence is of length 3, i.e. [5, 3, 2]
```

```
Try to solve the problem in O(N log N) time complexity.
```

Problem approach

I first thought of the brute force approach. Then tried to solve for LIS which I had already solved once. Then implemented the approach of DP for LDS.

02

Round

Medium

Video Call

Duration45 Minutes

Interview date31 Jul 2021

Coding problem2

It held at morning 10 AM. The interviewer was very friendly. I was asked to solve 2 coding questions and was continuously provided with hints by the interviewer.

Question was on Array and Trees.

```
1. Buying a stock and then selling it is called one transaction.
2. You are not allowed to do multiple transactions at the same time. This means you have to sell the stock before buying it again.
```

```
Input: ‘n’ = 7, ‘prices’ = [3, 3, 5, 0, 3, 1, 4].
Output: 6
Explanation:
The maximum profit can be earned by:
Transaction 1: Buying the stock on day 4 (price 0) and then selling it on day 5 (price 3).
Transaction 2: Buying the stock on day 6 (price 1) and then selling it on day 6 (price 4).
Total profit earned will be (3 - 0) + ( 4 - 1) = 6.
```

Problem approach

First I found that this can easily be done using the brute force approach of taking a hashmap for storing all the numbers (from min value in the input range to the maximum value in the input range )with their frequency of appearance. then I will again run a loop for each query range and output the values which will be greater than k.

in this solution 50% of the test cases gives TLE.

Then I realized that I need not to run the loop for each and every range rather I should take a array of 100000 size and :

first mark the start and end of each range in one loop

then fill the frequencies for the between elements by just looping from min to max value in my range

then for each query I got my answer in constant time by subtracting the frequency of the range elements from frequency array.

```
You need to modify the given tree only. You are not allowed to create a new tree.
```

```
For the given binary search tree
```

```
11 will be replaced by {15 + 29 + 35 + 40}, i.e. 119.
2 will be replaced by {7 + 11 + 15 + 29 + 35 + 40}, i.e. 137.
29 will be replaced by {35 + 40}, i.e. 75.
1 will be replaced by {2 + 7 + 11 + 15 + 29 + 35 + 40}, i.e. 139.
7 will be replaced by {11 + 15 + 29 + 35 + 40}, i.e. 130.
15 will be replaced by {15 + 29 + 35 + 40}, i.e. 104.
40 will be replaced by 0 {as there is no node with a value greater than 40}.
35 will be replaced by {40}, i.e. 40.
```

Problem approach

First I wrote the post order traversal of input. Then by simply doing post-order traversal and performing swapping in between.

03

Round

Easy

HR Round

Duration30 Minutes

Interview date31 Jul 2021

Coding problem0

This was a Technical + HR interview. It was in the afternoon around 12 pm. The interviewer wanted to know whether or not I had built some projects related to this field. Most of the interview went by him asking questions based on my projects. First I was asked to explain about a project then a lot of follow-up questions were asked.

Here's your problem of the day

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

How do you write a single-line comment in C++?

Choose another skill to practice

Start a Discussion

Similar interview experiences

SDE - 1

4 rounds | 5 problems

Interviewed by Curefit

909 views

0 comments

0 upvotes

SDE - 1

2 rounds | 2 problems

Interviewed by Curefit

999 views

0 comments

0 upvotes

SDE - 1

4 rounds | 7 problems

Interviewed by Curefit

892 views

0 comments

0 upvotes

SDE - 1

3 rounds | 5 problems

Interviewed by Curefit

869 views

0 comments

0 upvotes

Companies with similar interview experiences

SDE - 1

5 rounds | 12 problems

Interviewed by Amazon

104644 views

24 comments

0 upvotes

SDE - 1

4 rounds | 5 problems

Interviewed by Microsoft

49761 views

5 comments

0 upvotes

SDE - 1

3 rounds | 7 problems

Interviewed by Amazon

31029 views

6 comments

0 upvotes