Tip 1: Practised topic-wise CodeStudio questions from basics
Tip 2: Watched so many system design mock interviews
Tip 3: I did mock interviews with friends for DSA and system design rounds.
Tip 1 : Have some projects on resume.
Tip 2: Do not put false things on resume.



Given 'N' : 5 (number of packets) and 'M' : 3 (number of students)

And chocolates in each packet is : {8, 11, 7, 15, 2}
All possible way to distribute 5 packets of chocolates among 3 students are -
( 8,15, 7 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 8, 15, 2 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 8, 15, 11 ) difference of maximum-minimum is ‘15 - 8’ = ‘7’
( 8, 7, 2 ) difference of maximum-minimum is ‘8 - 2’ = ‘6’
( 8, 7, 11 ) difference of maximum-minimum is ‘11 - 7’ = ‘4’
( 8, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
( 15, 7, 2 ) difference of maximum-minimum is ‘15 - 2’ = 13’
( 15, 7, 11 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 15, 2, 11 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 7, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
Hence there are 10 possible ways to distribute ‘5’ packets of chocolate among the ‘3’ students and difference of combination (8, 7, 11) is ‘maximum - minimum’ = ‘11 - 7’ = ‘4’ is minimum in all of the above.
Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the task is to distribute the chocolate to their students. Distribute chocolate in such a way that:
1. Each student gets at least one packet of chocolate.
2. The difference between the maximum number of chocolate in a packet and the minimum number of chocolate in a packet given to the students is minimum.

Input: ‘N’ = 3, ‘M’ = 3, ‘A’ = aba, ‘B’ = aab
Output: 3
One of the valid strings with minimum cost after merging ‘A’ and ‘B’ is ‘aaabba’. The order of characters of string ‘A’ as well as ‘B’ is maintained in the string ‘aaabba’ and the cost of this string is (1 + 2) = 3.
You are given two strings ‘A’ and ‘B’ of length ‘N’ and ‘M’ respectively. You need to construct a new string ‘C’ by merging both strings in such a way that the relative order of characters in ‘A’ and ‘B’ is the same in string ‘C’.
For example, if the string ‘A’ is of length 3 then the first character of string ‘A’ should be placed before the second and third characters of string ‘A’ in string ‘C’. Similarly, the second character of string ‘A’ should be placed after the first character and before the third character of string ‘A’ in string ‘C’.
The cost of merging the strings is given by the number of consecutive characters in string ‘C’ that are not equal + 1, i.e. ‘C[ i ] != ‘C[ i + 1]’.
Find the minimum cost of merging both strings.



You are given a positive integer ‘N’. Your task is to print all prime numbers less than or equal to N.
Note: A prime number is a natural number that is divisible only by 1 and itself. Example - 2, 3, 17, etc.
You can assume that the value of N will always be greater than 1. So, the answer will always exist.



If the given input string is "Welcome to Coding Ninjas", then you should return "Ninjas Coding to Welcome" as the reversed string has only a single space between two words and there is no leading or trailing space.
Your task is to reverse the original string word by word.There can be multiple spaces between two words and there can be leading or trailing spaces but in the output reversed string you need to put a single space between two words, and your reversed string should not contain leading or trailing spaces.
Why Shorthills?
List your weaknesses and Strengths.
Are you willing to relocate to Noida or Gurugram?
Are you a team player?

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?