
Nagarro


Nagarro Associate Engineer Interview Questions and Answers for Freshers
Q1. Count Ways To Reach The N-th Stair Problem Statement
You are given a number of stairs, N
. Starting at the 0th stair, you need to reach the Nth stair. Each time you can either climb one step or two steps. You ha...read more
The problem involves finding the number of distinct ways to climb to the Nth stair by taking one or two steps at a time.
Use dynamic programming to solve this problem efficiently.
The number of ways to reach the Nth stair is the sum of the number of ways to reach the (N-1)th stair and the (N-2)th stair.
Handle large inputs by taking modulo 10^9+7 to avoid overflow.
Example: For N=3, there are 3 ways to climb to the third stair: (0, 1, 2, 3), (0, 2, 3), and (0, 1, 3).
Q2. Trailing Zeros in Factorial Problem
Find the number of trailing zeroes in the factorial of a given number N
.
Input:
The first line contains an integer T
representing the number of test cases.
Each of the followi...read more
Count the number of trailing zeros in the factorial of a given number.
To find the number of trailing zeros in N!, count the number of factors of 5 in the prime factorization of N.
Each factor of 5 contributes to a trailing zero in the factorial.
For example, for N=10, there are 2 factors of 5 in the prime factorization (5 and 10), so there are 2 trailing zeros.
Q3. Quick and merge time complexity and when worst case happens in quick sort
Quick sort has O(n log n) time complexity on average, O(n^2) worst case. Merge sort has O(n log n) time complexity always.
Quick sort has an average time complexity of O(n log n) due to its divide-and-conquer approach.
Worst case for quick sort occurs when the pivot element is either the smallest or largest element in the array, leading to O(n^2) time complexity.
Merge sort always has a time complexity of O(n log n) due to its consistent splitting and merging of subarrays.
Q4. Remove a linked list node without head or tail pointer given
Removing a node from a linked list without head or tail pointer
Use the node to be removed's next node to copy its data and then delete the next node
Update the current node's next pointer to skip the next node
Q5. Your favorite programming language and why
My favorite programming language is Python because of its simplicity, readability, and versatility.
Python is known for its clean and readable syntax, making it easy to learn and understand.
Python has a large standard library and many third-party libraries, allowing for rapid development of a wide range of applications.
Python is versatile and can be used for web development, data analysis, machine learning, automation, and more.
Q6. Remove nth element from array
Remove the nth element from an array of strings
Use the splice method to remove the element at the specified index
Remember that array indices start at 0
Example: array.splice(n, 1) will remove the element at index n
More about working at Nagarro







Top HR Questions asked in Nagarro Associate Engineer for Freshers
Interview Process at Nagarro Associate Engineer for Freshers

Top Associate Engineer Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

