Question: Nagarro | Recent Online Assessment 2026 | Magical Pathway | Maximum Fruits | Cracking the Nagarro Coding Round | Dynamic Programming & Combinatorics
0
Entering edit mode

Question 1: Magical Pathway Puzzle

Problem Statement:

Ella is exploring a magical forest filled with glowing stones arranged in a line. These stones are numbered from 1 to N, with the first stone at position 1 and the last at position N. Ella starts outside the forest, just before the first stone. She can step forward to either the next stone or skip a stone to land two stones ahead. However, some stones are cursed and cannot be stepped on. If Ella steps on a cursed stone, she will be teleported back to the start.

Your task is to help Ella find and return an integer value representing the number of ways she can safely reach the $N^{th}$ stone without stepping on any cursed stones. If there is no possible way to reach the last stone, return 0.

Note:

  • The answer may be large, so return the answer modulo 10^9 + 7.

  • The array follows 1-based indexing.

Input Specification:

  • input1: An integer value N, representing the total number of stones.

    (Additional inputs for cursed stones would follow).

Question 2: Maximum Fruits to Collect

Problem Statement:

Evan is planning to collect some fruits from a garden. The garden is described in a M \times N matrix, where every element of the matrix represents the number of fruits in that cell.

Evan is initially in the X^{th} row and Y^{th} column and can only take K steps to collect the fruits. In every step, he can move to any one of the four adjacent cells and can collect the fruit present in that cell.

Your task is to find and return an integer value representing the maximum number of fruits that Evan can collect in K steps.

Note:

  • Each cell can be visited only once.
  • The starting position of Evan will always have 0 fruits.
  • The matrix has 1-based indexing.

Input Specification:

  • input1: An integer value M representing the number of rows in the matrix.
  • input2: An integer value N representing the number of columns in the matrix.
    (Inputs for X, Y, K, and the matrix grid would follow).

Question 3: Project Launch

Problem Statement:

As a project manager, Emily is overseeing the launch of several marketing campaigns. She has X different campaign ideas and can combine these ideas to create a powerful new marketing strategy. She can use at most Y ideas in any combination to craft a new marketing approach.

Your task is to help Emily determine how many different marketing combinations she can craft from the existing campaign ideas and return an integer representing the total number of possible strategies, including the original ideas.

Note:

  • Return answer modulo 10000.

Input Specification:

  • input1: An integer value X, representing the number of different campaign ideas.
  • input2: An integer value Y, representing the maximum number of ideas that can be used to create a new marketing strategy.
ADD COMMENTlink 8 hours ago admin 1.8k

Login before adding your answer.

Similar Posts
Loading Similar Posts