INTERVIEW EXPERIENCE
Samsung
INTERNSHIP
2020
How many rounds were there? Describe briefly.
There were 3 Rounds, 1 Coding round + 2 Personal Interview rounds.
What questions were asked? Describe briefly.
Coding round 3 questions 70 minutes. 1.) A 2D matrix is given, and you have to sort the matrix row-wise. [Easy] 2.) A binary tree is given and you have to replace the data value of all the nodes with the sum of data of its subtree excluding the node itself.[Easy] 3.) A company need some employees to maintain its business. Due to up-downs in business, the number of employees required changes every month. An array A[] of length N is given to you where each i [1, N] signifies the minimum number of employees required in the i-th month. The company may hire some employees with cost HIRE and fire some employees with severance pay S. SALARY is the salary of the employees in each month. Now you have to find MINIMUM COST TO COMPANY so that the Company can run for N months. Initially, the Company has 0 employees. Constraints : 1 <= A[i] <= 41 Sample Input A[] = {10, 5, 6, 2} HIRE = 10 S = 15 SALARY = 10 Sample Output 440 Hint: Just brute force all possible cases.using dynamic programming. [Medium] Personal Interview : Round 1 After introducing myself and my explaining my projects, he asked a coding question Coding Question: 1.) Given a natural number N(N<1e8), and an array of M integers A,Give the count of nos [1,N] which is divisible by any of the array elements. Solution Approach: Apply Inclusion-Exclusion principle iterating over all subsets of the array. (I had to write code for this solution) 2.) Just an extension of the last problem. You are given an array of M elements, Find the K-th element which is divisible by any of the array elements. Solution Approach: Same as the previous one. Just binary search over the numbers to find the K-th element. Then the interviewer asked some more C/C++ oriented questions. What is the forward function in C++? What are derived data types in C? (I could not answer both the above question but solved the coding questions) Round 2 : He asked why had I used MongoDB (Advantage of MongoDB over MySQL). Then he asked a coding question. You are given N strings. You have to find 100 strings which have occurred the most number of times. I had given him 3 approaches. First Approach: Just applied brute force. Second Approach: Comparision of the strings can be done using Hashing just an improvement of the first approach. Third Approach: Using the Trie data structure. He was quite satisfied with me.
Any advice for future aspirants?
Coding helps a lot. Doing Competitive programming on codeforces and codechef helped me THE MOST in this selection. They ask questions related to your resume. So whatever you write in your resume, be very confortable in those topics.