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

SDE - 1

Samsung
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
Initially grappling with the syntax of languages like Python and Java, I gradually embraced the logic and problem-solving aspects of programming. Each milestone brought a sense of accomplishment as I delved into data structures, algorithms, and web development. Collaborating on projects with peers honed my teamwork and communication skills. Facing bugs and errors became opportunities for learning, fostering resilience. By the end of the initial phase of my coding journey, I had transformed from a novice into a more confident programmer, eager to explore the vast realms of software development that lay ahead.
Application story
This company conducted an initial online assessment followed by three rounds of interviews during their campus placement visit. The interview process consisted of two technical rounds and one round focused on human resources.
Why selected/rejected for the role?
Rejected
Preparation
Duration: 6 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1: Regularly participate in coding challenges on platforms like CodeStudio to enhance problem-solving skills and gain exposure to diverse coding scenarios.

Tip 2: Engage in collaborative coding projects focusing on real-world applications. This demonstrates practical coding abilities and enhances teamwork and project management skills, making you more appealing to potential employers.

Application process
Where: Campus
Eligibility: Above 7.5 CGPA
Resume Tip
Resume tip

Tip 1: Highlight quantifiable achievements and results in your resume, showcasing the impact of your contributions in previous roles, such as increased efficiency, cost savings, or successful project outcomes.

Tip 2: Tailor your resume for each job application, emphasizing relevant skills and experiences that align with the position's specific requirements. This customization enhances your chances of standing out to recruiters and aligning with the role's needs.

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date4 Aug 2022
Coding problem2

1. Maximum Subarray Sum

Moderate
35m average time
81% success
0/80
Asked in companies
QualcommUberAmazon

You are given an array 'arr' of length 'n', consisting of integers.


A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning and 0 or more integers from the end of an array.


Find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.


The sum of an empty subarray is 0.


Example :
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]

Output: 11

Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
Problem approach

The Maximum Subarray Sum problem involves finding the contiguous subarray within a given array of integers that has the largest sum. In other words, given an array of numbers, the task is to determine the subarray with the maximum sum of its elements.

Try solving now

2. Maximum Path Sum Between Two Leaves

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

You are given a non-empty binary tree where each node has a non-negative integer value. Return the maximum possible sum of path between any two leaves of the given tree.

The path is also inclusive of the leaf nodes and the maximum path sum may or may not go through the root of the given tree.

If there is only one leaf node in the tree, then return -1.

Problem approach

You are given a non-empty binary tree where every node has a positive value. Return the maximum possible path sum between any two leaves of the given tree.

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date6 Aug 2022
Coding problem2

1. M-Coloring Problem

Moderate
15m average time
85% success
0/80
Asked in companies
Bank Of AmericaSamsungEditorialist YX

You are given an undirected graph as an adjacency matrix consisting of 'v' vertices and an integer 'm'.


You need to return 'YES' if you can color the graph using at most 'm' colors so that no two adjacent vertices are the same. Else, return 'NO'.


For example:
Input:
If the given adjacency matrix is:
[0 1 0]
[1 0 1]
[0 1 0] and 'm' = 3.

alt.txt

Output: YES

Explanation:
The given adjacency matrix tells us that 1 is connected to 2 and 2 is connected to 3. We can use three different colors and color all three nodes.
Hence we return true.


Problem approach

One can see that the number of ways to traverse this tree is a product of factorials of the number of children of each node in an n-ary tree. We can use something like a level order traversal to count the children of a node, then calculate factorials at each node and multiply the factorials calculated at each node.

Try solving now

2. Chocolate Problem

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

Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the task is to distribute the chocolate to their students. Distribute chocolate in such a way that:

1. Each student gets at least one packet of chocolate.

2. The difference between the maximum number of chocolate in a packet and the minimum number of chocolate in a packet given to the students is minimum.

Example :

Given 'N' : 5 (number of packets) and 'M' : 3 (number of students)

subsequence

And chocolates in each packet is : {8, 11, 7, 15, 2}

All possible way to distribute 5 packets of chocolates among 3 students are -

( 8,15, 7 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 8, 15, 2 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’ 
( 8, 15, 11 ) difference of maximum-minimum is ‘15 - 8’ = ‘7’
( 8, 7, 2 ) difference of maximum-minimum is ‘8 - 2’ = ‘6’
( 8, 7, 11 ) difference of maximum-minimum is ‘11 - 7’ = ‘4’
( 8, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
( 15, 7, 2 ) difference of maximum-minimum is ‘15 - 2’ = 13’
( 15, 7, 11 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 15, 2, 11 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 7, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’

Hence there are 10 possible ways to distribute ‘5’ packets of chocolate among the ‘3’ students and difference of combination (8, 7, 11) is ‘maximum - minimum’ = ‘11 - 7’ = ‘4’ is minimum in all of the above.
Problem approach

Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are an ‘M’ number of students and the task is to distribute the chocolate to their students. Distribute chocolate in such a way that:
1. Each student gets at least one packet of chocolate.
2. The difference between the maximum number of chocolate in a packet and the minimum number of chocolate in a packet given to the students is minimal.

Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date11 Aug 2022
Coding problem1

1. Longest Palindromic Subsequence

Hard
45m average time
50% success
0/120
Asked in companies
QualcommHikeSAP Labs

You have been given a string ‘A’ consisting of lower case English letters. Your task is to find the length of the longest palindromic subsequence in ‘A’.

A subsequence is a sequence generated from a string after deleting some or no characters of the string without changing the order of the remaining string characters. (i.e. “ace” is a subsequence of “abcde” while “aec” is not).

A string is said to be palindrome if the reverse of the string is the same as the actual string. For example, “abba” is a palindrome, but “abbc” is not a palindrome.

Problem approach

Case1: Every single character is a palindrome of length 1
L(i, i) = 1 (for all indexes i in the given sequence)
Case2: If the first and last characters are not the same
If (X[i] != X[j]) L(i, j) = max{L(i + 1, j), L(i, j – 1)} 
Case3: If there are only 2 characters and both are the same
Else if (j == i + 1) L(i, j) = 2 
Case4: If there are more than two characters, and the first and last characters are the same
Else L(i, j) = L(i + 1, j – 1) + 2 

We can improve the time complexity using DP

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
2229 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Samsung
1427 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
58237 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes