Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
PharmEasy interview experience Real time questions & tips from candidates to crack your interview

# SDE - 1

PharmEasy
2 rounds | 4 Coding problems

## Interview preparation journey

Preparation
Duration: 3 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip

Tip 1 : Practise 5 problems daily from websites like hackerrank, codechef, codeforces
Tip 2 : Participate in codechef, codeforces contest.
Tip 3 : Attend mock interviews and should have good communication skills.

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume tip

Tip 1 : Maintain atleast 2 different projects, write powerful summary statement.
Tip 2 : Maintain skills relevant to job description, include relevant experience.

## Interview rounds

01
Round
Medium
Video Call
Duration45 minutes
Interview date6 Sep 2022
Coding problem2

### 1. Square Root Of An Integer

Easy
20m average time
80% success
0/40

#### Square of a number is the product of the ...

View more
Problem approach

You are given an integer ‘A’. Your task is to find the greatest non-negative integer whose square is less than or equal to ‘A’.
Square of a number is the product of the number with itself. For e.g. square of 3 is 9.
Input Format
The first line of input contains an integer ‘T’ denoting the number of test cases to run. Then the test cases follow.

The first line of each test case c...

View more

### 2. LCA - Lowest Common Ancestor

Hard
40m average time
70% success
0/120

#### The lowest common ancestor (LCA) is a concept in graph theory and computer science.

View more
Problem approach

The lowest common ancestor (LCA) is a concept in graph theory and computer science.
Let ‘T’ be a rooted tree with ‘N’ nodes. The lowest common ancestor is defined between two nodes, ‘u’ and ‘v’, as the lowest node in ‘T’ that has both ‘u’ and ‘v’ as descendants (where we allow a node to be a descendant of itself). - Wikipedia

For the given tree, The LCA of nodes 5 and 8 will be node 2...

View more
02
Round
Medium
Video Call
Duration45 minutes
Interview date6 Sep 2022
Coding problem2

### 1. Maximum profit

Moderate
40m average time
75% success
0/80

#### Ninja is a poor but an intelligent boy. He has a rod of length ‘N’ units. He wants to earn...

View more
Problem approach

Ninja is a poor but an intelligent boy. He has a rod of length ‘N’ units. He wants to earn maximum money by selling this rod in the market. So he cuts the rod into different sizes and each size has a cost associated with it. Determine the maximum money he can earn by cutting the rod and selling its pieces.

### 2. Minimum Sum of Absolute Differences

Easy
10m average time
90% success
0/40

#### You have been given two arrays/lists 'ARR1' and 'ARR2' of length 'N'. Your task is to pair each element of 'ARR1' to an element of 'ARR2' such that the sum...

View more
Problem approach

You have been given two arrays/lists 'ARR1' and 'ARR2' of length 'N'. Your task is to pair each element of 'ARR1' to an element of 'ARR2' such that the sum of the absolute difference of all pairs is minimum.
Example:
If 'ARR1' = [0, 2, 1], and 'ARR2' = [8, 10, 4] then the most optimal pairing will be (0, 4) , (1, 8) and (2, 10). The sum of absolute difference will be 4 + 7 + 8 = 19.

Here's your problem of the day

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

What is the result of 4 % 2?

Start a Discussion
Similar interview experiences
4 rounds | 5 problems
2268 views
SDE - 1
2 rounds | 4 problems
Interviewed by PharmEasy
626 views
SDE - 1
2 rounds | 4 problems
Interviewed by PharmEasy
938 views
Product Engineer
3 rounds | 5 problems
1398 views
Companies with similar interview experiences
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
103831 views