DealShare.in interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

DealShare.in
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
I was an active participant in various coding competitions at my college and practiced numerous questions on competitive programming sites. Since I got placed early during college, I was not allowed to sit for other companies, so I kept working hard for various off-campus opportunities.
Application story
I was searching for a good opportunity and got to know from a senior working in the same company. I applied via referral, got the test link, and the interviews were scheduled.
Why selected/rejected for the role?
All the rounds went pretty well. I don't know why I got ghosted after the second round of the interview—maybe they found a better candidate.
Preparation
Duration: 8 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Computer Networking, Object Oriented Programming, ML
Tip
Tip

Tip 1: Never skip any topic from any chapter or subject.
Tip 2: Learn to articulate your thoughts clearly.
Tip 3: Learn from previous experiences, interviews, and asked problems.
Tip 4: Have at least four projects on your resume.

Application process
Where: Referral
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1: Have at least four projects on your resume.
Tip 2: Do not include false information. You will always get caught—be genuine.

Interview rounds

01
Round
Medium
Video Call
Duration60 minutes
Interview date17 Jun 2022
Coding problem2

Interviews were conducted by a third party on behalf of DealShare. They provided 60 minutes and two coding questions in the first round of the interview.

1. Count Good Subsets

Moderate
25m average time
75% success
0/80
Asked in companies
Snapdeal Ltd.RED HEALTHCapegemini Consulting India Private Limited

You are given an array ‘ARR’ of size ‘N’ consisting of distinct elements. Your task is to find the total number of good subsets. A subset is called a good subset when you can rearrange the elements of the subset in such a way that each element divides the next element in order. Two subsets are different from each other if there is an element in one subset, which does not exist in the other.

For example :

Consider ARR = [2, 4, 5, 15], all possible good subsets following the given conditions are (2), (4), (5), (15), (2,4), and (5,15). Hence, the total number of good subsets is 6 in this case.
Problem approach

We first count each character (r[ch]) and the number of distinct characters (d_r). These are the initial values for our right substring (thus, indicated as r).

As we move our split point from left to right, we shift the current character to the left substring and update the count and the number of distinct characters in both the left and right substrings.

If the number of distinct characters is equal, we increment the result.

Try solving now

2. Minimum Time To Visit All Points

Moderate
15m average time
85% success
0/80
Asked in companies
AmazonMorgan Stanleyalibaba

Ninja lives in a 2D plane where each location is represented with integer coordinates ‘[X, Y]’. You are given an array ‘POINTS’ containing ‘N’ such points. Ninja lives at the location ‘POINTS[0]’ and wants to visit all the remaining ‘N-1’ points in the order given by the ‘POINTS’ array. Your task is to help ninja find the minimum time (in seconds) required to visit all the points in the given order (starting from ‘POINTS[0]’).

The ninja can travel according to the following rules :
  • In one second, the ninja can either:
    • Move vertically by one unit, i.e., along the y-direction.
    • Move horizontally by one unit, i.e., along the x-direction.
    • Move diagonally by ‘sqrt(2)’ units, i.e., move one unit horizontally then one unit vertically.
  • The ninja must visit the points in the exact order as they are given the ‘POINTS’ array.
  • The ninja is allowed to pass through points that may be given later in the order, but these points will not be counted as visited.


For Example :
‘POINTS = [ [3, 1], [-1, 3], [2, 0] ]’, ‘N = 3’

Example

The path with minimum time is: ‘[3,1] -> [2,2] -> [1,3] - > [0,3] -> [-1,3] -> [0,2] -> [1,1] -> [2,0]’.

Time taken from [3,1] to [-1,3] = 4 seconds.
Time taken from [-1,3] to [2,0] = 3 seconds.

Total time = 7 seconds. Thus, you should return ‘7’ as the answer.
Try solving now
02
Round
Hard
Video Call
Duration60 minutes
Interview date22 Jun 2023
Coding problem2

This round was the Hiring Manager round. He asked questions to assess the depth of the tech stack I have used in my past projects and the work done during my internships. In the end, he concluded the round by asking two quick DSA questions.

1. Kth largest element in the unsorted array

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

You are given an array consisting of 'N' distinct positive integers and a number 'K'. Your task is to find the kth largest element in the array.

Example:
Consider the array {2,1,5,6,3,8} and 'K' = 3, the sorted array will be {8, 6, 5, 3, 2, 1}, and the 3rd largest element will be 5.
Note:
1) Kth largest element in an array is the kth element of the array when sorted in non-increasing order. 

2) All the elements of the array are pairwise distinct.
Problem approach

Build a Max-Heap (MH) using the first K elements (arr[0] to arr[K-1]) of the given array.
For each element after the Kth element (arr[K] to arr[n-1]), compare it with the root of MH.
If the element is smaller than the root, replace the root with this element and call heapify on the Max-Heap (MH).
Otherwise, ignore it.
Finally, the root of the MH is the Kth smallest element.

Try solving now

2. Count all sub-arrays having sum divisible by k

Moderate
15m average time
85% success
0/80
Asked in companies
MicrosoftProtiumIntuit

Given an array ‘ARR’ and an integer ‘K’, your task is to find all the count of all sub-arrays whose sum is divisible by the given integer ‘K’.

Note:
If there exists no subarray in the given sequence whose sum is divisible by ‘K’ then simply return ‘0’.
Example:
Suppose the given array is ‘ARR’ = { 5, 0, 2, 3, 1} and ‘K = 5’.
As we can see in below image, there are a total of 6 subarrays that have the total sum divisible by ‘K’
So we return the integer 6.

subsequence

Problem approach

Fix the left and right columns one by one and count subarrays for every left and right column pair. Calculate the sum of elements in each row from left to right and store these sums in an array, say temp[]. Here, temp[i] represents the sum of elements from left to right in row i. Count the subarrays in temp[] whose sum is divisible by k. This count represents the number of submatrices with a sum divisible by k, considering the left and right columns as boundary columns. Finally, sum up all these counts for each temp[] corresponding to different left and right column pairs.

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 remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4898 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by DealShare.in
1859 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by DealShare.in
1234 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3639 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58238 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes