Tip 1 : Prepared well for how to approach the solution of problem.
Tip 2 : Start with bruit-force approach and gradually optimize further.
Tip 1 : Whatever you write in resume, make sure you are enough confident and ready to explain it in a detail.
Tip 2 : Keep your resume as simple as possible. Don't go with highly designed format.
It was in the evening 08:00 PM. Environment was quite good and no any additional disturbance was there. Internet connectivity was also decent and I was very confident about this round.



1. The time starts from zero.
2. Before completing one task another task can not be started.
3. The reward for doing a task can be negative.


Example:-
INPUT : M = 123 , K = 1
OUTPUT: 312
In the above example, K = 1, hence only 1 swap operation is available.
Operation 1: Swap 1 with 3 so the integer becomes 312
INPUT : M = 567392 , K = 3
OUTPUT: 976532
In the above example, K = 3, hence a maximum of 3 swap operation available
Operation 1: Swap 5 with 9 so the integer becomes 967352
Operation 2: Swap 6 with 7 so the integer becomes 976352
Operation 3: Swap 3 with 5 so the integer becomes 976532
INPUT : M = 751, K = 2
OUTPUT: 751
In the above example, No swaps are required as it is already the maximum possible integer with that set of digits.
INPUT : M = 3849 , K = 0
OUTPUT: 3849
In the above example, K = 0, hence no swap operations are available.
- Create a global variable that will store the maximum string or number.
- Define a recursive function that takes the string as a number, the value of k, and the current index.
- Find the index of the maximum element in the range current index to end.
- if the index of the maximum element is not equal to the current index then decrement the value of k.
- Run a loop from the current index to the end of the array
- If the ith digit is equal to the maximum element
- Swap the ith and element at the current index and check if the string is now maximum and update the
maximum string.
- Call the function recursively with parameters: string and k.
- Now again swap back the ith and element at the current index.



1. All four numbers should exist at different indices in the given array.
2. The answer is case-sensitive.
- Initialize the counter count to store the total quadruplets with the given sum S and a map to store all possible
sums for the first two elements of each possible quadruplet.
- Traverse the given array over the range [0, N – 1] using the variable i where arr[i] is the fixed 3rd element.
- Then for each element arr[i] in the above step, traverse the given array over the range [i + 1, N – 1] using the
variable j and increment the counter count by map[arr[i] + arr[j]].
- After traversing from the above loop, for each element arr[i], traverse the array arr[] from j = 0 to i – 1 and
increment the frequency of any sum arr[i] + arr[j] of the first two elements of any possible quadruplet by 1 i.e.,
increment map[arr[i] + arr[j]] by 1.
- Repeat the above steps for each element arr[i] and then print the counter count as the total number of
quadruplets with the given sum S.



1. INSERT(key, value): Inserts an integer value to the data structure against a string type key if not already present. If already present, it updates the value of the key with the new one. This function will not return anything.
2. DELETE(key): Removes the key from the data structure if present. It doesn't return anything.
3. SEARCH(key): It searches for the key in the data structure. In case it is present, return true. Otherwise, return false.
4. GET(key): It returns the integer value stored against the given key. If the key is not present, return -1.
5. GET_SIZE(): It returns an integer value denoting the size of the data structure.
6. IS_EMPTY(): It returns a boolean value, denoting whether the data structure is empty or not.
1. Key is always a string value.
2. Value can never be -1.
First(Denoted by integer value 1): Insertion to the Data Structure. It is done in a pair of (key, value).
Second(Denoted by integer value 2): Deletion of a key from the Data Structure.
Third(Denoted by integer value 3): Search a given key in the Data Structure.
Fourth(Denoted by integer value 4): Retrieve the value for a given key from the Data Structure.
Fifth(Denoted by integer value 5): Retrieve the size of the Data Structure.
Sixth(Denoted by integer value 6): Retrieve whether the Data Structure is empty or not.
There are two jugs each of 4 and 3 liters respectively , without any measuring marks. how many minimum steps are required to have 2 liters of water into the 4 litre jug (the jugs can be filled any number of times with water, and they can be emptied any number of times).
As we want 2litre water in a 4liter mug, this can be achieved by the following last states:
1. Having 1litre in a 3litre mug
2. Having 2litre in 4litre mug
1. First one as easy to think as the difference between the mugs (4-3 =1)
Step 1 : Fill 4-litre jug with water completely
Step 2 : Empty water from 4-litre jug into 3-litre (leaving 1L in 4litre mug and 3L in 3 litre mug)
Step 3 : Empty water from 3-litre
Step 4 : pour water from 4-litre jug into 3-litre jug (leaving 0L in 4litre mug and 1L in 3 litre mug)
Step 5 : Fill 4-litre jug with water completely again.
Step 6: Transfer water of 4-litre jug to 3-litre jug, resulting in 2 litre water in 4-litre jug.
2. Second approach:
Step 1 : Fill 3-litre jug with water completely
Step 2 : Empty water from 3-litre jug into 4-litre
Step 3 : Again, fill 3-litre jug with water completely
Step 4 : And pour water from 3-litre jug into 4-litre jug until 4-litre jug becomes full
Step 5 : Empty the 4-litre jug. Now, we are left with 2 litre water in 3-litre jug and 4-litre jug is empty.
Step 6: Transfer water of 3-litre jug to 4-litre jug, resulting in 2 litre water in 4-litre jug.
- What is good thing about you?
- Why do you want to join RBS?
- What do you know about our company?
- Which are the latest technology available in the world?
- What are your hobbies and the reason?
- What motivates you to join our company?

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