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

SDE - 1

Samsung
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 Months
Topics: Data Structures, OOPS, Algorithms, Dynamic Programming, Trees, Graphs
Tip
Tip

Tip 1 : While Parcticing build a strong base of easy and medium questions
Tip 2 : Do 2 projects atleast
Tip 3 : Copetitive Programming helps

Application process
Where: Campus
Eligibility: 7cgpa
Resume Tip
Resume tip

Tip 1 : Put only those things about which you are confident enough
Tip 2 : Keep it simple and short

Interview rounds

01
Round
Medium
Online Coding Interview
Duration70 Minutes
Interview date25 Dec 2021
Coding problem2

It was at 10AM and in online mode.

1. BFS in Graph

Easy
10m average time
90% success
0/40
Asked in companies
Morgan StanleySamsung R&D InstituteRubrik, Inc.

Given an adjacency list representation of a directed graph with ‘n’ vertices and ‘m’ edges. Your task is to return a list consisting of Breadth-First Traversal (BFS) starting from vertex 0.


In this traversal, one can move from vertex 'u' to vertex 'v' only if there is an edge from 'u' to 'v'. The BFS traversal should include all nodes directly or indirectly connected to vertex 0.


Note:
The traversal should proceed from left to right according to the input adjacency list.


Example:
Adjacency list: { {1,2,3},{4}, {5}, {},{},{}}

The interpretation of this adjacency list is as follows:
Vertex 0 has directed edges towards vertices 1, 2, and 3.
Vertex 1 has a directed edge towards vertex 4.
Vertex 2 has a directed edge towards vertex 5.
Vertices 3, 4, and 5 have no outgoing edges.

We can also see this in the diagram below.

BFS traversal: 0 1 2 3 4 5

example

Problem approach

Declare a queue and insert the starting vertex.
Initialize a visited array and mark the starting vertex as visited.
Follow the below process till the queue becomes empty:
Remove the first vertex of the queue.
Mark that vertex as visited.
Insert all the unvisited neighbours of the vertex into the queue.

Try solving now

2. Right View

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

You have been given a Binary Tree of integers.

Your task is to print the Right view of it.

The right view of a Binary Tree is a set of nodes visible when the tree is viewed from the Right side and the nodes are printed from top to bottom order.

Problem approach

If we observe carefully, we will see that our main task is to print the right most node of every level. So, we will do a level order traversal on the tree and print the last node at every level

Try solving now
02
Round
Medium
Video Call
Duration50 minutes
Interview date5 Aug 2022
Coding problem2

Its was at 3pm, The interviewer was 10 years+ experienced employee and eas very friendly. Helped me get comfortable also.

1. Left View Of Binary Tree

Moderate
30m average time
60% success
0/80
Asked in companies
WalmartSalesforceDelhivery

You have been given a Binary Tree of 'n' nodes, where the nodes have integer values



Example :
If the input tree is as depicted in the picture: 

alt text

The Left View of the tree will be:  2 35 2 
Problem approach

If we observe carefully, we will see that our main task is to print the left most node of every level. So, we will do a level order traversal on the tree and print the leftmost node at every level.

Try solving now

2. Symmetric Tree

Moderate
25m average time
70% success
0/80
Asked in companies
SamsungArcesiumHCL Technologies

You have been given a Binary Tree having 'n' nodes.


A Symmetric tree is a binary tree whose mirror image is the same as the original tree.


Find out whether the given tree is symmetric or not.


Example :
Input: Let the binary tree be:

sym_tree

Output: YES

Explanation: As we can see in the image, the original tree is the same as the mirrored tree.
Problem approach

The idea is to write a recursive function isMirror() that takes two trees as an argument and returns true if trees are the mirror and false if trees are not mirrored. The isMirror() function recursively checks two roots and subtrees under the root.

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