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

SDE - 1

ShareChat
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Data Structures & Algorithms, System Design (Basics), Resume Projects Revision
Tip
Tip

Tip 1 : Focus more on the problem-solving part, i.e. Data Structures & Algorithms and coding skills.
Tip 2 : You should be comfortable with Leetcode medium-level questions.
Tip 3 : Basic system design should be enough, basics of HLD (High-Level Design) & LLD (Low-Level Design)

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

Tip 1 : Keep your resume one-pager, short, and concise. They will be more interested in your problem-solving skills.
Tip 2 : Do not include redundant projects in your resume. Do not write about skills you are not good at.
Tip 3 : Focus on your previous work experience in your resume. That is one section, from which you will be asked questions.

Interview rounds

01
Round
Hard
Online Coding Interview
Duration90 Minutes
Interview date17 Jul 2021
Coding problem3

It was a coding round of a duration of 90 minutes hosted on HackerEarth. There were 3 coding questions.
Question-1 Maximum Score: 20
Question-2 Maximum Score: 50
Question-3 Maximum Score: 100
Total Maximum Score: 170

Timing: You can take the test at your convenience. A deadline of 4-5 days was mentioned for that.

1. Virus Detection

Moderate
0/80
Asked in companies
Goldman SachsShareChatUber

In a database, each stored file is named by a string of size ‘N’. But due to some error in the security, some of the files got infected by a virus. Given two strings ‘A’ and ‘B’ and a virus string ‘C’, Your task is to tell the number of files that are not affected by the virus. An unaffected file follows the given conditions:

The name of the file should be greater than or equal to the string ‘A’.
The name of the file should be less than or equal to string ‘B’.
The name of the file should not contain the virus string as a substring ‘C’.
Since the answer can be very large, print answer % (10^9 + 7).
For Example
If N=2 and string ‘A’ = “bc” and string ‘B’ = “bm” and virus string ‘C’ = ”g”.So the files that are not affected are “bc”, “bd”, “be”, “bf”, “bh”, “bi”, “bj”, “bk”, “bl”.
Try solving now

2. Minimum Insertions

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

You are given a string 'STR' of length 'N' consisting of lowercase English Alphabet letters. Your task is to return the count of minimum characters to be added to make the string a palindrome.

You can add any number of characters at any positions in the string like in the beginning, or between two characters of the string or at the end of the string.

For example:

For the given string “deed”, the string is already a palindrome, thus, minimum characters needed to be added are 0. 

Similarly, for the given string “abb”, the minimum characters needed is 1 i.e. ‘a’ which is to be added to the end of the string,  which makes the string “abba”, which is a palindrome.   
Try solving now

3. Minimum Cost to Hire M Candidates

Hard
50m average time
50% success
0/120
Asked in companies
SalesforceShareChatApple

You are the HR of the Ninja team and planning to hire ‘M’ candidates out of ‘N’ candidates to form a paid group. The candidates have been evaluated on the basis of their skills and have been asked for their minimum salary expectations. So, you are given two arrays, ‘SKILL’ and ‘EXPECTED_SALARY’, where ‘SKILL[i]’ and ‘EXPECTED_SALARY[i]’ represent the skill and minimum salary expectation of ‘i-th’ candidate, respectively. You have to consider the following two rules for hiring a group of ‘M’ candidates:

1) Every candidate in the paid group should be paid in the ratio of their skill compared to other candidates in the paid group.
2) The minimum salary expectation of every candidate in the paid group should be fulfilled.

You have to return the minimum amount of money required to hire ‘M’ candidates as per the above-mentioned rules.

Note:

Answers which are within the range 10^-6 of the correct answer will be considered correct.
Try solving now
02
Round
Easy
Video Call
Duration60 Minutes
Interview date22 Jul 2021
Coding problem1

It was an online interview round. The round was based on problem-solving and DSA (Data Structures & Algorithms).

Timing: 4:00 PM - 5:00 PM
Environment: Google Meet
Interviewer was an SDE-2 at ShareChat was very helpful.

1. LCA Of Binary Tree

Moderate
10m average time
90% success
0/80
Asked in companies
GrabDisney + HotstarShareChat

You have been given a Binary Tree of distinct integers and two nodes ‘X’ and ‘Y’. You are supposed to return the LCA (Lowest Common Ancestor) of ‘X’ and ‘Y’.


The LCA of ‘X’ and ‘Y’ in the binary tree is the shared ancestor of ‘X’ and ‘Y’ that is located farthest from the root.


Note :
You may assume that given ‘X’ and ‘Y’ definitely exist in the given binary tree.
For example :
For the given binary tree

Example

LCA of ‘X’ and ‘Y’ is highlighted in yellow colour.
Problem approach

Approach:
Following is the simple approach for Least Common Ancestor for any number of nodes.

For every node calculate the matching number of nodes at that node and its sub-tree.
-> If root is also a matching node (matchingNodes = matchingNodes in left sub-tree + matchingNodes in right sub-tree + 1)
-> If root is not a matching node (matchingNodes = matchingNodes in left sub-tree + matchingNodes in right-subtree)
-> If matching Nodes count at any node is equal to number of keys then add that node into the Ancestors list.
-> The First node in the Ancestors List is the Least Common Ancestor of all the given keys.

Try solving now
03
Round
Medium
Video Call
Duration60 Minutes
Interview date28 Jul 2021
Coding problem1

This was the last hiring manager round.
Timing: 6:00 PM - 7:00 PM
Environment: Google meet
The interviewer was an Engineering Manager in ShareChat and was an experienced, guy.

1. URL Shortener

Easy
10m average time
90% success
0/40
Asked in companies
AdobeMakeMyTripShareChat

You have given a URL id – 'N' consisting of only digits. Your task is to generate a short URL for the given URL id.

To generate a short URL, you need to convert the given URL id to 62 base number where digits of the number are:[“0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ”] i.e “0” corresponds to 0, “a” corresponds to 10, “Z” corresponds to 61, and “10” corresponds to 62, “11” corresponds to 63, and so on….

Follow Up:
Can you solve this in logarithmic time and space complexity?
Problem approach

Approach:
1. We can use hashing to hash the long URL into a short URL. That's one approach.
2. We can also create a short URL with just 7 characters, and lowercase English characters. Corresponding to every
long URL, we can generate a short URL of length 7 with 7 randomly chosen characters. Since (26^7) is very high,
so the chances of the collision are very low and there can be a large pool of long URLs for which you will be able to
create short URLs.

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 | 5 problems
Interviewed by ShareChat
1672 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 6 problems
Interviewed by ShareChat
1190 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by ShareChat
1260 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 7 problems
Interviewed by ShareChat
2195 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