Samsung Coding Questions and Answers

Samsung Coding Questions with Solutions

Samsung Coding Questions and Answers is a most searched topic by the freshers who are preparing for Samsung’s Placement Assessments. Here you will find Samsung Coding Questions and Answers, asked in Technical Interviews during the Hiring Process of the company along with Job Profile, CTC Offered, and Job location.

About Samsung

Samsung Electronics is a South Korean Company that is the largest producer of Electronic Devices. This company also have a Research Division in various countries, called Samsung Research, an Advanced facility for the R&D purpose of different products manufactured by the company.

This part of the company mainly focuses on the advancement of the vast range of Technical Areas like AI & Robotics, Security & Privacy and its most common manufacturing unit called Samsung Electronics. 

About Samsung Recruitment Process

This Hiring process consists of following steps :

  1. Written Test [ MCQs Based ]
  2. Technical Test
  3. Technical and HR Interview

Details of  Samsung Recruitment Exam :

Samsung Number of Questions Time
Aptitude Test 25 Questions 45 Minutes
Technical Test 2 – 3 Questions ~ 60 – 90 Minutes

For more details on Samsung Recruitment Process, we have given all the necessary details in the following Tabular Form

Samsung Related Information
Position : Software Engineer Intern
Course :
  • Eligible Batch – 2022
  • B.Tech – CS, IT or Electronics.
Eligibility Criteria / Academic Qualification Required : Minimum 75 % required throughout 10th, 12th, and Graduation.
Cost to Company (CTC)
  • Stipend During Internship: ₹ 30,000 /- Per Month
  • After Conversion to Full Time: ₹ 8,18,000 /- P.A.
Selection Process :
  1. Global Samsung Aptitude Test (GSAT)
  2. Technical Test
  3. Technical Interview
  4. HR Interview
Joining Location : Noida

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Samsung Coding Questions

Question 1: Hostel warden

Problem Statement :

There is a hostel warden in some XYZ hostel. He is very strict with students. He has some set of rules to allow students to let them out.
Students are in random order but warden don’t allow them in that way.
Rule 1- whose initial is a prime value should go out before whose initial is a composite value.
Rule 2- if two students have prime value , a student with less value goes out first
Rule 3- if two students have composite value , a student with greater value goes out first
NOTE:- consider the ASCII value of the initial to find it is prime or composite.

Input format:
The first line of input contains the number of students N
The second line of input contains random order of the students S.
(students at index zero goes out first and students at index N-1 goes last)

Constraints
1<=number of students <=105
33<=ASCII Of Characters<=126

Output Format
The single line of output should contain the required modified order of students to go out.

Sample Input
13
Kkunjkhahorin

Sample Output
akkuronnjihhK

Explanation
For primes: a<k
For Composite: K<h<i<j<n<o<r<u
Adding up logic, the required answer is akkuronnjihhK

Question 2 : Jagannath and his Brothers

Problem Statement :

Jagannath was with two of his young brothers in work. He wants to work less, and wants his brothers to work more, as he is a lazy person. Now, in the work field, there is an array of buildings, from where they can earn money. So that there arises no conflict between his brothers that who earns more, he arrives in one building, tells his brother that the very building will bring the most money (Which may not be true), and tells one of his brothers to go to the left and another one to go to the right.
You have to write a program so that you can predict which building will be getting Jagannath, and how much money each of his friends are gonna earn.

Input Format:
First line saying the number of test cases, n.
Then next n pairs of lines, first one depicting the number of buildings k and second one containing k space separated integers denoting the number of earnings possible.

Constraints
1 <= n <= 10 ^ 6
1 <= k < n
-10 ^ 9 <= a[i] <= 10 ^ 9 (Earnings)
1 <= t <= 25

Output Format:
n lines, with the index of building jagannath working, space separately the money His brothers each making. If the combination is not possible, answers are 0.

Sample Input:
1
5
1 2 2 4 5
Sample Output:
4 5
Explanation:
Jagannath will work in the 4th building, and his brothers are making 5 rupees each.

Question 3 : Simple problem

Problem Statement :

Mr X is a teacher of maths. He came across a very simple problem. In the problem you have to arrange the numbers in an ascending order and calculate the total number of swaps required. The number of swaps must be minimum. But Mr X is busy with some other tasks and you being his favourite student , so he asks you to solve this problem.

Constraints:

1<=T<=100
1<=N<=100
1<=A[ ] <=1000
Examples

Input :
4
4 3 1 2
Output:
2
Explanation: Swap index 0 with 3 and 1 with 2 to form the sorted array {1, 2, 3, 4}.

Input :
5
1 5 4 3 2
Output :
2

Question 4: Shushil’s Madness

Problem Statement :

Shushil has gone crazy after he lost a big amount of his money in the share market. Now he keeps all the money he has distributed in his room and calculates them in a very problematic way. Every time he calculates hisnetworth, he writes it down adding with the last 3 rooms he has one.
Then after that when he reaches the next room he adds the last 3 rooms’s money with the money found in that room and adds again. Suppose he is in ith room, he will add i-1,i-2 and i-3th rooms money with ith one and add it into his net worth (if the rooms exist).
Given an array of money in the rooms, find what will he calculate as his net worth?
Input Format:
First line saying the number of rooms, r
Next line r space separated money amounts in each room
Next line contains an m, denoting a number that we will use to take module of the final value

Constraints:

1<= r <= 1018
1<= a[i] <= min(600,r)
1<= M <= 1018

Output Format:
Print the answer on the first line

Sample Input:
5
1 2 3 4 5
100

Sample Output:
34

Question 5: Strange rule

Problem Statement :

There are two friends Ram and Shyam. They saw each other after a very long time. Then they remember the rule they make when they are of very small age. They have decided that whenever they see each other they will move towards each other in a very dramatic way.
Let’s say Ram and Shyam are ‘D’ meters apart.
Ram moves 1 meter in each step he takes but Shyam moves are increases linearly starting from 1, i.e., he moves 1 meter in his first step then 2 meters on the second, 3 meters on the third step and so on till he cannot take a step.

Assume they both take steps simultaneously till shyam is able to make a step. Whenever shyam can’t make a step, he waits patiently at that place and the rest of the distance is covered by Ram.

Calculate the minimum number of steps they take in total before meeting each other.

Your task is to output the minimum number of total steps required before Ram and Shyam can meet each other.
Input Format:

The first line contains the number of test cases ‘T’.
The next ‘T’ line contains the distance ‘D’.

Constraints:

1 T 105

1 D 105

Output Format:

Output ‘T’ lines with each line containing a single integer denoting the minimum number of jumps they take before hugging each other for each test case.

Sample Input
1
3

Sample Output
3

Explanation

Let Ram be at position 0 of x-axis and Shyam be at position 3 of the x-axis.

Ram jumps to position 1 and simultaneously Shyam jumps to position 2.

Now Shyam can’t make a jump because if he does so, then he will be jumping over Ram which is undesirable. So she patiently waits at position 2.

Finally, Ram jumps to position 2 and they hug each other

You can clearly see 3 jumps are required. Two by Ram and One by Shyam.

So the output is 3.

Sample Input
1

5

Sample Output
4

FAQs related to Samsung Coding Questions

Question 1: Does Samsung asks coding questions in there Recruitment Process?

Yes, Samsung always asks Coding Questions in there Technical Test and Technical Interview for Hiring the suitable candidates.

Question 2: What kind of roles are available at Samsung in India?

Samsung offers various Job profiles in the field of industry electronics, including appliances, digital media devices, semiconductors, memory chips, and integrated systems as Software Engineer, UI – UX Designer, System Engineer, etc.

Question 3: What is the recruitment process at Samsung India?

The recruitment process at Samsung India typically involves multiple stages, including Global Samsung Aptitude Test, technical assessments, technical interviews and HR Interview. The specific process may vary depending on the role and location.

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription