Samsung Prism Interview Experience 2022
Last Updated :
02 Aug, 2022
Samsung conducted a test for Samsung Prism
Process:1 coding round consisting of 3 questions
CGPA: No criteria as such, but asked to fill during the test.
QUESTION 1: Given an array of numbers, rearrange the numbers to form the largest permutation, you may also need to rearrange the digits, and return it as a String.
ex: Input: 49 58 63
Output: 986543
Hint: Hash Map
Question 2:Given a binary search tree and a number k, find several pairs with a sum of k.
HINT-Powerful Inorder traversal(giving sorted array), then two pointers.
QUESTION 3:GIVEN A BINARY TREE FIND maxOfMinTree(Node* root)
function maxOfMinTree returns the largest of all the smallest values at each level.
Let me simplify it, Find the minimum at each level, and then return a max of those.
***FINDING IT SIMPLE NA, HAHA IT’S NOT THAT(BFS YAYYY), YOU CAN’T USE EXTRA MEMORY(RECURSION STACK ALLOWED)
Solution-use recursion
handle base cases
int l=fn(root->left);
int r=fn(root->right);
return max(root->data,l,r);
SO I SOLVED ALL 3 IN 45 MINUTES
RESULT: AWAITED!!, BUT BACKLOG:(
Share your thoughts in the comments
Please Login to comment...