Cultfit private ltd interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Cultfit private ltd
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
Throughout my computer science journey, I've navigated diverse learning experiences and hands-on endeavours. In my initial year at college, I delved into the foundational aspects, honing my skills in Data Structures and Algorithms through dedicated courses at Coding Ninjas. An enriching phase as a Teaching Assistant at Coding Blocks further solidified my understanding. As the years progressed, I delved deeper, immersing myself in refining my algorithmic prowess through coding platforms. While fortifying my algorithms stronghold, I embarked on a parallel exploration into web development. Here, I found my passion gravitating toward the intricacies of backend development, captivated by its complexity and potential. Alongside, I co-founded a YouTube channel, 'AlgoDS,' where we sought to elucidate elegant solutions to intricate problems, channelling creativity into crafting innovative solutions. My academic journey was complemented by enriching internship experiences. Summer internships at CultFit and winter internships at Aidash during my 7th and 8th semesters, respectively, provided me with opportunities to further my backend development acumen. Recently, I embarked on a new chapter, starting my professional journey at Sprinklr, where I contributed for about a year before transitioning to my current role at Dice. Each step in this trajectory has enriched my understanding, fueled my passion for computer science, and propelled me toward more significant accomplishments in the field.
Application story
I was following a few good companies that were hiring people with 1 to 1.5 years of experience. I saw a post on LinkedIn and applied for it by getting a referral (cold texting on LinkedIn).
Why selected/rejected for the role?
I failed to answer a question in the last round, and the competition was really tough. As a result, I wasn't selected for the HR round.
Preparation
Duration: 6 months
Topics: Data Structures & Algorithms, OOPS (Java, C++ both), Operating System, Computer Networks, Probability, Statistics, Java in Depth, Spring & Spingboot
Tip
Tip

Tip 1: Know what to prepare for; go on LinkedIn to find jobs you would apply for. Understand the skills required and plan for 5-6 months to reach that goal.

Tip 2: Don't waste time in college; get going with a few good seniors and discuss with them what you want to become and how to achieve that.

Tip 3: Campus placements and internships are essential in these uncertain times. If you graduate without any internships or campus placement, there is no incentive for any company to give you a chance as a fresher.

Application process
Where: Linkedin
Eligibility: 1-1.5 Years of experience
Resume Tip
Resume tip

Tip 1: Use an ATS-friendly resume. There are a few ATS tools (some free, some paid) that give your resume a score and list points to improve it.

Tip 2: List only relevant experiences.

Tip 3: Your LinkedIn profile matters. Make sure it is well-crafted.

Interview rounds

01
Round
Easy
Video Call
Duration65 minutes
Interview date21 Aug 2023
Coding problem2

Round started with a discussion about my journey in computer science & my current roles & responsibilities at Sprinklr.
Simple Java questions were asked regarding the Collection framework & Simple OOPS concept
Then we moved ahead to the Algorithmic Problems

1. Remove Edges

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

You are given an undirected graph with ‘N’ vertices and ‘M’ edges. Each edge has a particular type as described below:

An edge with type 1 can only be traversed by a person ‘A’.

An edge with type 2 can only be traversed by a person ‘B’.

An edge with type 3 can be traversed by both persons ‘A’ and ‘B’.

Your task is to determine the maximum number of edges that can be removed such that after removing these edges, all the nodes can still be traversed by both ‘A’ and ‘B’.

Problem approach

At first, I tried to think of a brute force approach in which we would try to explore each & every path from source to destination & reverse every edge that comes in the way.
While explaining the algorithm it hit me that this is somewhat like Dijkstra's algorithm.
Whenever we are at any node we can consider the outgoing edge to be of weight 0 & incoming edge to be of weight 1. 
& the number of edges we would need to reverse in the process would be the same as the cost of reaching the destination from the source in Dijkstra's algorithm.

The interviewer was happy with this approach & I was told to code it out on a Google Doc
I did that & proceeded to the next question.

Try solving now

2. Minimum Steps

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

You are given an array ‘ARR’ consisting of ‘N’ integers. Your task is to make all the numbers equal. You decrease one of the largest numbers present in the array into a number that is just lower than the maximum number in one step.

For example:
You are given ‘ARR’ = [5, 2, 3]
In the first step, you can change 5 to 3, so the new array is [3, 2,3].

In the second step, you can change the 3 to 2, then the array is [2, 2,3].

In the third step, you can change the 3 to 2, then the array is [2, 2, 2] 

Hence the answer is 3.
Problem approach

I had solved this problem beforehand while practising & had a little time left to solve this question in the interview so quickly I went to the solution.
This is a basic DP problem. 
Maintain a 2D dp matrix of size (row, column) where each i, and j shows the minimum steps required to reach the end of the matrix
Start from the bottom right corner and fill the last row & last column using the (i, j+arr[i][j]) or (i+arr[i][j], j) rule.
Now start from row - 2->0 & column - 2->0 & start filling the dp matrix in reverse order. 
(Avoid going out of the bounds of the matrix).

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date27 Nov 2023
Coding problem2

The Round started with a discussion about my journey in computer science & my current roles & responsibilities at Sprinklr (Same as the previous round).
Then we moved directly to the problem-solving

1. House Robber

Moderate
26m average time
0/80
Asked in companies
SamsungAmazonQuikr

A thief wants to loot houses. He knows the amount of money in each house. He cannot loot two consecutive houses. Find the maximum amount of money he can loot.

Problem approach

I knew about its other variation House Robber 1 in which houses were lined up straight.
So I started thinking in that manner only but the catch was that we cannot rob 0th & n-1th house 
The simple approach that hit me was - 
Remove the first & the last house 
Therefore, the core idea is to apply dynamic programming. Two cases are considered here: 
When you rob the first house
When you don't rob the first house, i.e. you rob the last one.

Try solving now

2. Count Distinct Substrings

Moderate
10m average time
90% success
0/80
Asked in companies
AdobeAmazonIntuit

Given a string 'S', you are supposed to return the number of distinct substrings(including empty substring) of the given string. You should implement the program using a trie.

Note :
A string ‘B’ is a substring of a string ‘A’ if ‘B’ that can be obtained by deletion of, several characters(possibly none) from the start of ‘A’ and several characters(possibly none) from the end of ‘A’. 

Two strings ‘X’ and ‘Y’ are considered different if there is at least one index ‘i’  such that the character of ‘X’ at index ‘i’ is different from the character of ‘Y’ at index ‘i’(X[i]!=Y[i]).
Problem approach

This was a tricky problem 
First I tried a brute force approach in which I made a graph.
Any number Ex - 239 has an outgoing edge to every number starting with 9 & an Incoming edge from every number starting with 2.
Now after making this graph we just have to find the largest cycle in this graph.

The interviewer stopped me here & asked me about the time complexity 
O(n^2) I said.
However, the interviewer said to reduce the time complexity.

I took a few minutes & thought that we don't need to store the whole string of number 
We just need its first & last digit
I build a 2D matrix of size 10*10 
any index i,j represents a number or the maximum length of a number starting with I & ending in j.
Now whenever a number ex - 891 comes.
We already have the data of all the numbers before it ends with 8 (starting with 1, starting with 2 etc....) 
Now for index (1, 8) (2, 8), (3, 8) etc., we form a 9 numbers 
starting with 1 & ending with 1 (last digit of 891)
starting with 2 & ending with 1 (last digit of 891)
& so on.
thus updating the (1, 1) index (2, 1) index & so on.....


After iterating over all the given numbers we will find the maximum value present in the diagonal (i, i) to get the answer.

Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date28 Nov 2023
Coding problem2

Directly started with the Problem-solving.

1. Search In Rotated Sorted Array

Moderate
30m average time
65% success
0/80
Asked in companies
FreshworksExpedia GroupPayPal

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

The first step of course is to find out the actual sorted order with their position.
Then 

Assume we have to collect any number say 8 whose first occurrence is at index 3 to index 9 & we are at position 6. There are 2 options now - 
1) Go to position 9 collecting all 8s & then to position 3
2) Go to position 3 collecting all 8s & then to position 9

Now start from there & move to the next greater number

So simply at every step/number we have 2 options & hence it became a 2 power n kind of approach that can be converted to a 2dp problem.
& I proceeded with that

It took me a lot of time so got a little anxious about the next question.

Try solving now

2. Longest Increasing Subsequence

Moderate
30m average time
65% success
0/80
Asked in companies
PhonePeChegg Inc.Barclays

For a given array with N elements, you need to find the length of the longest subsequence from the array such that all the elements of the subsequence are sorted in strictly increasing order.

Strictly Increasing Sequence is when each term in the sequence is larger than the preceding term.

For example:
[1, 2, 3, 4] is a strictly increasing array, while [2, 1, 4, 3] is not.
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

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
8518 views
0 comments
0 upvotes
Analytics Consultant
3 rounds | 10 problems
Interviewed by ZS
907 views
0 comments
0 upvotes
company logo
SDE - Intern
1 rounds | 3 problems
Interviewed by Amazon
3319 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 6 problems
Interviewed by Expedia Group
2580 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114579 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57825 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34961 views
7 comments
0 upvotes