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

SDE - 1

Shipsy
upvote
share-icon
1 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : OOPS - You should be well versed with basic OOPS principles
Tip 2 : You should be confident and have profound knowledge about the projects you worked on
Tip 3 : Basic DB concepts like joins, normalisation

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

Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Easy
Video Call
Duration45 mins
Interview date17 Nov 2022
Coding problem3

1. Friends Pairing Problem

Easy
10m average time
90% success
0/40
Asked in companies
Goldman SachsPayPalHCL Technologies

You are given an integer ‘N’, which denotes there are ‘N’ friends. You are supposed to form some pairs them satisfying the following conditions:

1. Each friend can be paired with some other friend or remain single.

2. Each friend can be a part of at most one pair.

You are supposed to find the total number of ways in which the pairing can be done satisfying both conditions. Since the number of ways can be quite large, you should find the answer modulo 1000000007(10^9+7).

Note:
1. Return the final answer by doing a mod with 10^9 + 7.
2. Pairs {A, B} and {B, A} are considered the same.
Problem approach

You are given an integer ‘N’, which denotes there are ‘N’ friends. You are supposed to form some pairs them satisfying the following conditions:
1. Each friend can be paired with some other friend or remain single.
2. Each friend can be a part of at most one pair.
You are supposed to find the total number of ways in which the pairing can be done satisfying both conditions. Since the number of ways can be quite large, you should find the answer modulo 1000000007(10^9+7).

Try solving now

2. Vertical Order Traversal

Moderate
35m average time
65% success
0/80
Asked in companies
MakeMyTripAppleSalesforce

Given a binary tree, return the vertical order traversal of the values of the nodes of the given tree.

For each node at position (X, Y), (X-1, Y-1) will be its left child position while (X+1, Y-1) will be the right child position.

Running a vertical line from X = -infinity to X = +infinity, now whenever this vertical line touches some nodes, we need to add those values of the nodes in order starting from top to bottom with the decreasing ‘Y’ coordinates.

Note:
If two nodes have the same position, then the value of the node that is added first will be the value that is on the left side.
For example:
For the binary tree in the image below.

alt text

The vertical order traversal will be {2, 7, 5, 2, 6, 5, 11, 4, 9}.
Problem approach

The Ultimate Ninja Ankush is a straightforward, no-nonsense guy and loves binary Trees, and he has given you a binary tree, and you have to return the vertical order traversal of the values of the nodes of the given tree.
For each node at position (‘X’, ‘Y’), (‘X’-1, ‘Y’-1) will be its left child position while (‘X’+1, ‘Y’-1) will be the right child position.
Running a vertical line from X = -infinity to X = +infinity, now whenever this vertical line touches some nodes, we need to add those values of the nodes in order starting from top to bottom with the decreasing ‘Y’ coordinates.
Print the vertical order of the tree, to make the Ultimate Ninja Happy.

Try solving now

3. Divide Two Integers

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

You are given two integers, ‘dividend’ and ‘divisor’.


You are required to divide the integers without using multiplication, division, and modular operators.


Your task is to return the quotient after dividing ‘dividend’ by ‘divisor’.


Note :

In cases where the dividend is not perfectly divisible by the divisor, you are required to return the integer value of the quotient which is closer to zero.

For example - If the answer is '8.34', we return the integer part, i.e., '8'. Also, If the answer is '-2.67', we return the integer part, i.e., '-2'.

Assume we're dealing with a system that can only store integers in the 32-bit signed integer range: [2^31, 2^31-1]. If the quotient is higher than 2^31 - 1, return 2^31 - 1; if it is less than -2^31, return -2^31. 

For example :

If the answer is ‘9.333’, then return ‘9’, or if the answer is ‘-8.123’, then return ‘-8’.
Problem approach

You are given two integers ‘dividend’ and ‘divisor’. You are required is to divide the integers without using multiplication, division and modular operators. Your task is to return the quotient after dividing ‘dividend’ by ‘divisor’.
Note :
In cases where the dividend is not perfectly divisible by the divisor, you are required to return the floored value of the quotient.
For example :
If the answer is ‘9.333’ then return ‘9’ or if the answer is ‘-8.123’ then return ‘-8’.

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
3 rounds | 7 problems
Interviewed by OYO
4657 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6450 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3452 views
0 comments
0 upvotes
Software Engineer
2 rounds | 2 problems
Interviewed by Shipsy
385 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