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

SDE - 1

Samsung
upvote
share-icon
1 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 1.5 month
Topics: Data Structures, Operating Systems, Computer Networks, OOPs, Intern Project
Tip
Tip

Tip 1 : Mainly focus on understanding the problem statement and the purpose of doing your project.
Tip 2 : DSA training will be given by Samsung to clear the online round. Solve all the model questions given.
Tip 3 : If you have good manager feedback, you just need to clear the coding round. You will not have any interviews.

Application process
Where: Campus
Eligibility: Existing Intern at Samsung
Resume Tip
Resume tip

Tip 1: Only write things that you are confident about
Tip 2: Resume must be in a single page pdf format

Interview rounds

01
Round
Easy
Online Coding Test
Duration180 minutes
Interview date23 Jun 2022
Coding problem3

It is an online coding round having 1 question only. The time given is 3 hours and there are 50 test cases. The intern must pass all 50 cases to move to the next round. I am adding 3 questions that I got to know. The next round of interview will happen only if the manager's feedback is bad. Else PPO will be offered directly on passing this round.

Three attempts will be given to every intern to clear this coding round in a span of two months. I failed on the first attempt on June 16. I passed the test during my second attempt on 23 June.

1. Partition Array for Maximum Sum

Moderate
0/80
Asked in companies
SamsungHCL Technologies

You are given an array 'arr' of 'n' integers.


You have to divide the array into some subarrays such that each element is present in exactly one of the subarrays.


The length of each subarray should be at most 'k'. After partitioning all the elements of each subarray will be changed to the maximum element present in that subarray.


Find the maximum possible sum of all the elements after partitioning.


Note:

Input is given such that the answer will fit in a 32-bit integer.


Example:
Input: 'k' = 3, 'arr' = [1, 20, 13, 4, 4, 1]

Output: 80

Explanation:
We can divide the array into the following subarrays
[1,20] max of this subarray is 20 so the contribution of 
this subarray in the final answer will be 20*2=40.
[13,4,4]  max of this subarray is 13 so the contribution of 
this subarray in the final answer will be 13*3=39.
[1]  max of this subarray is 1 so the contribution of this 
subarray in the final answer will be 1*1=1.

So, the answer will be 40 + 39 + 1 = 80.


Problem approach

Use dynamic Programming. This is just a variation of the MCM problem and can be understood just by building a recursion tree as we generally do for MCM-type problems. It is a standard problem, just we need to identify the pattern.

Try solving now

2. Maximum In Sliding Windows Of Size K

Moderate
20m average time
80% success
0/80
Asked in companies
AppleWalmartOYO

Given an array/list of integers of length ‘N’, there is a sliding window of size ‘K’ which moves from the beginning of the array, to the very end. You can only see the ‘K’ numbers in a particular window at a time. For each of the 'N'-'K'+1 different windows thus formed, you are supposed to return the maximum element in each of them, from the given array/list.

Problem approach

The idea is to maintain a maxHeap of size k. A number is to be evicted from this heap if the k-sized window moves past it.
-> If that number to be evicted is at the top, immediately pop the heap.
-> if not, then maintain a toDelete heap which will evict the number as soon as it reaches top in both. Keep discarding numbers from both these heaps until the tops don't match.

Try solving now

3. Shortest Common Supersequence

Hard
25m average time
0/120
Asked in companies
Dream11SamsungHCL Technologies

Given two strings, ‘A’ and ‘B’. Return the shortest supersequence string ‘S’, containing both ‘A’ and ‘B’ as its subsequences. If there are multiple answers, return any of them.

Note: A string 's' is a subsequence of string 't' if deleting some number of characters from 't' (possibly 0) results in the string 's'.

For example:
Suppose ‘A’ = “brute”, and ‘B’ = “groot”

The shortest supersequence will be “bgruoote”. As shown below, it contains both ‘A’ and ‘B’ as subsequences.

A   A A     A A
b g r u o o t e
  B B   B B B  

It can be proved that the length of supersequence for this input cannot be less than 8. So the output will be bgruoote.
Problem approach

For every string s we pre-calculate the length of the longest possible overlap between s and any other strings. 

Then for every possible subset A'of A, we could use the sum of the precalculated lengths as an upper bound to the total overlaps that can be obtained by combining all the strings in A'. 

Using this upper bound, we could give up early on many branches.

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
1222 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