Add office photos
Nagarro logo
Engaged Employer

Nagarro

Verified
4.0
based on 4.1k Reviews
Video summary
Filter interviews by
SDE
Fresher
Clear (1)

Nagarro SDE Interview Questions and Answers

Updated 5 Feb 2024
Asked in
SDE Interview

Q1. Partition to K Equal Sum Subsets Problem

Given an array of integers and a positive integer 'K', determine if it is possible to divide the array into 'K' non-empty subsets such that the sum of elements in each s...read more

Ans.

The problem involves dividing an array into K subsets with equal sum.

  • Use backtracking to try all possible combinations of subsets.

  • Keep track of the sum of elements in each subset and check if they are equal to the target sum.

  • Optimize by sorting the array in descending order and assigning elements to subsets greedily.

  • Handle edge cases like when the sum of elements is not divisible by K.

Add your answer
right arrow
Asked in
SDE Interview

Q2. Sort a "K" Sorted Doubly Linked List

Given a doubly-linked list with N nodes, where each node’s position deviates at most K positions from its position in the sorted list, your task is to sort this given doubly...read more

Ans.

Sort a doubly linked list where each node's position deviates at most K positions from its position in the sorted list.

  • Iterate through the doubly linked list and maintain a min-heap of size K+1 to keep track of the next smallest element.

  • Remove the smallest element from the heap and add it to the sorted list. Update the heap with the next element from the removed node's next position.

  • Continue this process until all nodes are added to the sorted list.

Add your answer
right arrow
Nagarro SDE Interview Questions and Answers for Freshers
illustration image
Asked in
SDE Interview

Q3. Maximum Meetings Selection

You are tasked with scheduling meetings in a single meeting room. Given N meetings, each with a start time Start[i] and end time End[i], determine the maximum number of meetings that ...read more

Ans.

Given start and end times of meetings, find the maximum number of meetings that can be scheduled in a single room.

  • Sort the meetings based on their end times in ascending order.

  • Iterate through the sorted meetings and select the ones that do not overlap with the previously selected meetings.

  • Keep track of the selected meetings and return their indices.

Add your answer
right arrow
Asked in
SDE Interview

Q4. Merge k Sorted Linked Lists

You are provided with 'K' sorted linked lists, each sorted in increasing order. Your task is to merge all these lists into one single sorted linked list and return the head of the re...read more

Ans.

Merge k sorted linked lists into one single sorted linked list.

  • Create a min-heap to store the heads of all linked lists.

  • Pop the smallest element from the heap and add it to the result list.

  • If the popped element has a next element, push it back to the heap.

  • Repeat until all elements are merged into a single sorted list.

Add your answer
right arrow
Discover Nagarro interview dos and don'ts from real experiences
Asked in
SDE Interview

Q5. Duplicate Subtrees Problem Statement

Given a binary tree, return the root values of all duplicate subtrees. Two subtrees are considered duplicate if they have the same structure with identical node values. For ...read more

Ans.

Find root values of duplicate subtrees in a binary tree.

  • Traverse the tree in a bottom-up manner to identify duplicate subtrees.

  • Use a hashmap to store the subtree structures and their frequencies.

  • Return the root values of duplicate subtrees based on hashmap entries.

Add your answer
right arrow
Asked in
SDE Interview
Q6. Can you explain the concept of keys in database management systems?
Ans.

Keys in database management systems are unique identifiers for rows in a table.

  • Keys ensure data integrity by enforcing uniqueness and relationships between tables.

  • Primary key uniquely identifies each record in a table (e.g. employee ID).

  • Foreign key establishes a link between two tables by referencing the primary key of another table.

Add your answer
right arrow

More about working at Nagarro

Back
Awards Leaf
AmbitionBox Logo
#2 Best Large Company - 2022
Awards Leaf
Awards Leaf
AmbitionBox Logo
#1 Best IT/ITES Company - 2022
Awards Leaf
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Nagarro SDE

based on 1 interviews
Interview experience
4.0
Good
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top SDE Interview Questions from Similar Companies

Amazon Logo
4.1
 • 47 Interview Questions
Microsoft Corporation Logo
4.0
 • 14 Interview Questions
Facebook Logo
4.3
 • 14 Interview Questions
View all
Recently Viewed
DESIGNATION
INTERVIEWS
Publicis Sapient
No Interviews
SALARIES
ServiceNow
INTERVIEWS
Societe Generale Global Solution Centre
No Interviews
SALARIES
ServiceNow
INTERVIEWS
ServiceNow
No Interviews
INTERVIEWS
JSW One Platforms
No Interviews
SALARIES
ServiceNow
DESIGNATION
DESIGNATION
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter