DP World interview question

Online Round 2 SQL queries (easy) 10 MCQ (5 easy, 5 hard) Q1 Given an integer K and integer array (weight) find maximum amount of weight that can be lifted without crossing the capacity K. (K = 10^9) (knapsack with space optimization) Ex [4,5,8,9] Greedy will give 17, answer is 18 Q2 Given an array of integers [1,4,8,4], assume this priority array, convert this array so that priority remains same. but in minimized number Ex [1,4,8,4] to [1,2,3,2] Ex [1,4,7,3,5] to [1,3,5,2,4] (priority remained same, but in minimized format) 1st Round (Looking for precise code approach and optimized code) Q1 Design system to Get Random, Find, Delete, Insert on O(1) Q2 Given Linked L0 L1 L2 L3 L4 … Ln convert it to L0 Ln L1 Ln-1 L2 Ln-2…. 2nd Round (Looking for machine ready code with optimization) Q1 Find the next largest number Q2 Print all the palindromic substring (“abba” -> a,b,b,a, bb, abba) 3rd Round (Looking for precise code approach, optimized code, clear concept [why you add method in 1st class and not in other one]) (syntax was not an issue ) Q1 Design coffee machine (With class-diagram and use-case), Basic concepts of OOPS Q2 Some questions related to thread Q3 Work I do in current organization (in great depth) Q4 Some behavioral question (why DP world and many such, the focus is on why for each and every thing, why we use groovy only and why not java, why ODI, why behind everything)