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

SDE - 1

Samsung
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
For getting selected by IT companies, I needed to be very special in my very coding skills and I knew this fact so I started to code even before the college classes started for the first year. I practiced around 380 questions in the first two years of graduation then I learned web Development in the last phase of the second year.
Application story
In the first year , everyone in the college wanted to get some internships, and I was one of them. I wanted to do an internship in big companies so that they could add up to my resume. So, Amazon visited our campus to hire Interns and It was an excellent opportunity for me. So, I applied to the post.
Why selected/rejected for the role?
I was giving correct explanation for my solutions in the coding round. I also built the optimal solution starting from the brute force algorithm which also added to my points.
Preparation
Duration: 2 months
Topics: Arrays, Linked List, Binary Search, Stack, Queue, DFS, BFS, String, Recursion
Tip
Tip

Tip 1 : Solve Leetcode/SDE sheet provided by Striver most problems came from the Sheet itself 
Tip 2 : Try to solve the 1st of the 2 questions as fast as possible as the time limit is 1 hour 
Tip 3 : Make sure you have projects and have done some internship's so that they can actually ask questions from the resume.

Application process
Where: Campus
Eligibility: 6
Resume Tip
Resume tip

Tip 1 : Have some projects on your resume
Tip 2 : It helps if you had even some small internship experience in the past

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 mins
Interview date6 Jan 2021
Coding problem2

Part 1. 7 Bug fixes 
Part 2. 2 DSA Medium Hard Questions
Part 3: Behavioral Questions MCQ

1. Container With Most Water

Moderate
15m average time
90% success
0/80
Asked in companies
BNY MellonAmazonSAP Labs

Given a sequence of ‘N’ space-separated non-negative integers A[1],A[2],A[3],......A[i]…...A[n]. Where each number of the sequence represents the height of the line drawn at point 'i'. Hence on the cartesian plane, each line is drawn from coordinate ('i',0) to coordinate ('i', 'A[i]'), here ‘i’ ranges from 1 to ‘N’. Find two lines, which, together with the x-axis forms a container, such that the container contains the most area of water.

Note :
1. You can not slant the container i.e. the height of the water is equal to the minimum height of the two lines which define the container.

2. Do not print anything, you just need to return the area of the container with maximum water.
Example

water-diagram

For the above Diagram, the first red marked line is formed between coordinates (2,0) and (2,10), and the second red-marked line is formed between coordinates (5,0) and (5,9). The area of water contained between these two lines is (height* width) = (5-2)* 9 = 27, which is the maximum area contained between any two lines present on the plane. So in this case, we will return 3* 9=27.
Problem approach

Solved using DP concept

Try solving now

2. Minimum Travel Cost

Moderate
40m average time
65% success
0/80
Asked in companies
AmazonSamsungErnst & Young (EY)

Ninjaland is a country having 'N' states numbered from 1 to 'N'. These 'N' states are connected by 'M' bidirectional roads. Each road connects to different states and has some cost to travel from one state to another. Now, the chief wants you to select 'N' - 1 roads in such a way that the tourist bus can travel to every state at least once at minimum 'COST'.

For example :
Consider a country having 4 states numbered from 1 to 4. These 4 states are connected by 5 bidirectional roads given as :
1 --- 2 with cost = 8
2 --- 3 with cost = 6
3 --- 4 with cost = 5
1 --- 4 with cost = 2
1 --- 3 with cost = 4

The map of the country can be represented as:

Now, the best way to choose 3 roads is:

The cost of travelling from any state to all other states is  2 + 4 + 6 i.e. 12.
Problem approach

Recursive graph approach

Try solving now
02
Round
Medium
Video Call
Duration50 mins
Interview date6 Jan 2021
Coding problem2

two dsa questions were asked by the interviewer

1. First Missing Positive

Moderate
18m average time
84% success
0/80
Asked in companies
DunzoHikeSamsung

You are given an array 'ARR' of integers of length N. Your task is to find the first missing positive integer in linear time and constant space. In other words, find the lowest positive integer that does not exist in the array. The array can have negative numbers as well.

For example, the input [3, 4, -1, 1] should give output 2 because it is the smallest positive number that is missing in the input array.

Problem approach

Simple array traversal

Try solving now

2. Simplify the Directory

Moderate
22m average time
70% success
0/80
Asked in companies
VisaGoldman SachsAmazon

You are given a path to a file/directory in Unix-style of length N, In a Unix-style file system, a dot(.) refers to the current directory. A double dot(..) refers to the previous directory in reference to the current directory. If there are multiple slashes between two directories you should consider it as a single slash.

Now, for a given directory path as a string, you are required to simplify the same and tell the final destination in the directory structure or the path.

The simplified path should always begin with a slash(/) and there must be a single slash between two directory names. There should not be a trailing slash.

Problem approach

String manipulation problem

Try solving now
03
Round
Medium
Video Call
Duration60 mins
Interview date6 Jan 2021
Coding problem2

1. Pair Sum

Easy
15m average time
90% success
0/40
Asked in companies
Media.netExpedia GroupQuikr

You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to return the list of all pairs of elements such that each sum of elements of each pair equals 'S'.

Note:

Each pair should be sorted i.e the first value should be less than or equals to the second value. 

Return the list of pairs sorted in non-decreasing order of their first value. In case if two pairs have the same first value, the pair with a smaller second value should come first.
Problem approach

1. First I gave the O(n^2) approach , then he asked to optimize it
2. Then I gave the map solution and he was satisfied with the approach

Try solving now

2. Frequency In A Sorted Array

Easy
15m average time
85% success
0/40
Asked in companies
SprinklrOlaUrban Company (UrbanClap)

You are given a sorted array 'ARR' and a number 'X'. Your task is to count the number of occurrences of 'X' in 'ARR'.

Note :
1. If 'X' is not found in the array, return 0.
2. The given array is sorted in non-decreasing order.
Problem approach

1. Gave a map based solution asked me to optimize space and time
2. Gave a linear solution with a counter with no extra space
3. Gave a binary search based solution with upper bound and lower bound. The difference between upper and lower bound will give the frequency.

Note :The interviewer asked me to implement upper and lower bound from scratch and with little to no time left I was unable to implement the upper and lower bound

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
4 rounds | 6 problems
Interviewed by Samsung
1921 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 4 problems
Interviewed by Samsung
1221 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Samsung
2230 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Samsung
419 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