Tip 1 : Practice DSA a lot
Tip 2 : Have good knowledge about your projects and don't copy them.
Tip 3 : Revise core subjects before the interview
Tip 1 : Write only those things that you know well.
Tip 2 : Do not exaggerate your skills
Tip 3 : Include your projects at least two minimum
The timing was 4-6 pm
It was an online round ,questions were easy to hard


1. The sizes will range from 1 to ‘N’ and will be integers.
2. The sum of the pieces cut should be equal to ‘N’.
3. Consider 1-based indexing.
Method 1 : A naive solution to this problem is to generate all configurations of different pieces and find the highest-priced configuration. This solution is exponential in terms of time complexity. Let us see how this problem possesses both important properties of a Dynamic Programming (DP) Problem and can efficiently be solved using Dynamic Programming.



‘N’ = 3, ‘coins’ = {1, 2, 3}, ‘freq’ = {1, 1, 3}, ‘V’ = 6
For the given example, we can make six by using the following coins:
{1, 2, 3}
{3. 3}
Hence, the answer is 2.
We have 2 choices for a coin of a particular denomination, either i) to include, or ii) to exclude.
If we are at coins[n-1], we can take as many instances of that coin ( unbounded inclusion ) i.e count(coins, n, sum – coins[n-1] ); then we move to coins[n-2].
After moving to coins[n-2], we can’t move back and can’t make choices for coins[n-1] i.e count(coins, n-1, sum).
Finally, as we have to find the total number of ways, so we will add these 2 possible choices, i.e count(coins, n, sum – coins[n-1] ) + count(coins, n-1, sum );
Asked some DSA questions and one programming logic questions



Consider If N = 2, then there can be 4 different ways to color fences such that at most 2 adjacent fences have the same color-:
[ [0, 1],
[1, 0],
[1, 1],
[0, 0] ]
Hence, the answer is 4.
diff = no of ways when color of last
two posts is different
same = no of ways when color of last
two posts is same
total ways = diff + same
for n = 1
diff = k, same = 0
total = k
for n = 2
diff = k * (k-1) //k choices for
first post, k-1 for next
same = k //k choices for common
color of two posts
total = k + k * (k-1)
for n = 3
diff = k * (k-1)* (k-1)
//(k-1) choices for the first place
// k choices for the second place
//(k-1) choices for the third place
same = k * (k-1) * 2
// 2 is multiplied because consider two color R and B
// R R B or B R R
// B B R or R B B
c'' != c, (k-1) choices for it
Hence we deduce that,
total[i] = same[i] + diff[i]
same[i] = diff[i-1]
diff[i] = (diff[i-1] + diff[i-2]) * (k-1)
= total[i-1] * (k-1)

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?