Advertisement
shaikat0088

SAMSUNG_ADVANCE_question

Apr 22nd, 2019
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.82 KB | None | 0 0
  1.  
  2. 1. Given an array of elements and change the array in such a way that all the elements on the array are distinct. if you are replacing a value, then the replacing value should be great than the previous value and after modification sum of the elements should be as less as possible. Example: arr[1, 2, 3, 4, 5, 5, 5] and the result should be [1, 2, 3, 4, 5, 6, 7] example 2 [1, 2, 5, 7, 8, 8, 7] then the result should be [1, 2, 5, 7, 8, 9, 10] or 1, 2, 5, 7, 8, 10, 9]
  3. https://leetcode.com/problems/minimum-increment-to-make-array-unique/ (Solved)
  4.  
  5. 2. The second question is similar to LCS with a slight modification. that is Find the longest common subsequence that all the characters present in the subsequence should be of vowels.
  6. Example: input abcef, ffiocd then the answer should be 3 (abc, ioc)
  7. 3. https://practice.geeksforgeeks.org/explore/?company%5B%5D=Samsung&page=1&sortBy=accuracy (not important)
  8. 4. We are given m*n matrix which can have a number between 0 and 7. Each number represents a pipe. Two pipes are considered connected if their end points connect.
  9. Example:
  10. If matrix is as follows:
  11. 0040
  12. 1360
  13. 5000
  14. Pipe 1 and 3{1 opens to right. 3 opens to left} are connected. Other connected pipes are 3 and 6(3 opens to right. 6 opens to left). 4 and 6 are not connected as 6 does not open to top, and 4 does not open to bottom. 1 and 5 are also not connected as even though 1 opens to bottom, 5 is not open to top. Given this matrix, start point (X, Y) and length of probe tool “L”, find out how many pipes{matrix elements} can be reached. https://www.geeksforgeeks.org/samsung-semiconductor-institute-of-researchssir-software-intern-fte-set-3/
  15. 5. The question was sort of, given a 2 D matrix where 1 represent the places where the frog can jump and 0 represent the empty spaces, the frog can move freely in horizontal direction (on 1’s only) without incurring any cost (jump).A vertical jump from a given point of the matrix to other point on the matrix can be taken (on 1’s only) with cost as the number of jumps taken. Given a source and destination, the frog has to reach the destination minimizing the cost (jump).
  16. https://www.geeksforgeeks.org/samsung-interview-experience-set-16-campus/ or https://leetcode.com/problems/frog-jump/ or https://www.geeksforgeeks.org/minimum-number-of-jumps-to-reach-end-of-a-given-array/ or https://www.geeksforgeeks.org/minimum-number-jumps-reach-endset-2on-solution/
  17.  
  18. 6. https://www.geeksforgeeks.org/burst-balloon-to-maximize-coins/ or https://leetcode.com/problems/burst-balloons/
  19. 7. https://leetcode.com/problems/is-graph-bipartite/ (Solved)
  20. 8. There are N fishing spots and 3 gates. At each gate there are some fishermen waiting to reach the nearest unoccupied fishing spot. (Total no of fisherman <=N). Distance between consecutive spots = distance between gate and nearest spot = 1 m .Only 1 gate can be opened at a time and all fishermen of that gate must occupy the spots before the next gate is opened. Distance is calculated as gate to nearest spot + nearest spot to closest vacant spot. Find the total sum of minimum distances need to walk for all the fishermen.
  21. https://www.geeksforgeeks.org/samsung-semiconductor-institute-of-research-ssir-software-intern-fte-set-1/
  22. 9. You have to place an electronic banner of a company as high as it can be, so that whole the city can view the banner standing on top of TWO PILLERS. The height of two pillers are to be chosen from given array.. say [1, 2, 3, 4, 6]. We have to maximise the height of the two pillars standing side by side, so that the pillars are of EQUAL HEIGHT and banner can be placed on top of it. In the above array, (1, 2, 3, 4, 6) we can choose pillars like this, say two pillars as p1 and p2.. Then pillars can be,
  23. p1 = 3 unit… Choosing element (3) from array,
  24. Similarly p2 = 3 choosing (2 + 1) from array.
  25. Since, two pillars are equal, we can put board on it…
  26. But we have two maximise the height of the pillars,
  27. And if we check for other heights, we can see p1 = 6 p2 = 4 + 2 which is greater than 3 ( the previous height)..
  28. We have to see if we can further maximize the height… Yes it can be 8.
  29. I.e. p1 = 6 + 2 = 8. p2 = 4 + 3 + 1 = 8.
  30. Both pillars are equal and banner can be placed… And since this is the maximum height attainable for two pillars, we print the answer as 8. In case, there is no combination possible, print 0 (zero).
  31. INPUT :
  32. 1
  33. 5
  34. 1 2 3 4 6
  35. First line is T number of test cases to be followed.
  36. Second line of input is number of different pillars.
  37. Third line of input is different available heights of pillars.
  38. Note : heights of given pillars can be same .. I.e. array can have same elements repeated.
  39. Output. 8
  40. https://www.geeksforgeeks.org/samsung-r-d-noida-question-september-2018/
  41. 10. You are given the positions of a horse and other pieces in a chess board. Find out the number of situations where the horse takes out a chess piece in one move provided that no piece is blocking its path.
  42. 11. Given a directed graph find if there is any cycle exists in the graph or not. If there is no cycle then print -1 in a new line and if exists then print the number of nodes forming that cycle and also print the nodes in sorted order of their values. (Solved)
  43. 12. There is one spaceship. X and Y co-ordinate of source of spaceship and destination co-ordinates of spaceship is given. There are N number of warmholes and each warmhole has 5 values. First 2 values are starting co-ordinate of warmhole and after that value no. 3 and 4 represents ending co-ordinate of warmhole and last 5th value is represents cost to pass through this warmhole. Now these warmholes are bi-directional. Also to go from co-ordinate (x1, y1) to (x2, y2), the cost is abs(x1-x2)+abs(y1-y2). The main problem here is to find minimum cost to reach spaceship from source to destination co-ordinate using any number of warm-hole. It is ok if you wont use any warmhole.
  44. 13. Company A is discarding product numbers that contain few specific digits a specific number of time or more than that. You are given a range and you need to find product numbers that are possible. Example- Range: 24 to 12943 . Numbers that should not come: 1, 3, 5 . Number of times these number should not occur: 3 or more .In above case all two digit numbers are valid. In three digit: 111, 113, 115, 311, 331, 333, 511, 533, 555 are not valid. In four digit: All the numbers containing above 3 digit numbers are not valid. Eg: 11223 is not valid, 11222 is valid.
  45. https://www.geeksforgeeks.org/samsung-interview-experience-set-40-campus-white-box-testing/
  46. 14. A Doctor travels from a division to other division where divisions are connected like a graph(directed graph) and the edge weights are the probabilities of the doctor going from that division to other connected division but the doctor stays 10mins at each division now there will be given time and had to find the division in which he will be staying by that time and is determined by finding division which has high probability.
  47. Input is number of test cases followed by the number of nodes, edges, time after which we need to find the division in which he will be there, the edges starting point, end point, probability.
  48. https://www.geeksforgeeks.org/samsung-interview-experience-set-39-campus-r-d-noida/
  49. 15. https://www.geeksforgeeks.org/samsung-rd-interview-experience-set-37-developer-profile/
  50. 16. https://www.geeksforgeeks.org/samsung-interview-experience-set-35-campus/
  51. 17. https://www.geeksforgeeks.org/samsung-interview-experience-set-34-campus-rd-noida/
  52. 18. https://www.geeksforgeeks.org/m-coloring-problem-backtracking-5/ (Solved)
  53. 19. https://www.geeksforgeeks.org/shortest-path-in-a-binary-maze/
  54. 20. https://www.geeksforgeeks.org/samsung-rd-sri-noida-interview-experience-set-9-on-campus/
  55. 21. https://www.geeksforgeeks.org/samsung-rd-sri-noida-on-campus-interview-experience/
  56. 22. https://www.geeksforgeeks.org/minimum-positive-points-to-reach-destination/ (Solved)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement