CSD

CSD Interview Questions and Answers

Updated 16 Jul 2025
4d ago

Q. Swap Kth Elements in an Array

Given an array ARR of size N, perform the operation to swap the Kth element from the beginning with the Kth element from the end of the array.

Example:

Input:
N = 5, K = 2
ARR = [1,...read more
Ans.

Swap Kth elements from the beginning and end of an array.

  • Create a temporary variable to store the Kth element from the beginning

  • Swap the Kth element from the beginning with the Kth element from the end

  • Return the modified array

Asked in Nagarro

3d ago

Q. Count Derangements

Determine the number of derangements possible for a set of 'N' elements. A derangement is a permutation where no element appears in its original position.

Input:

An integer 'T' representing t...read more
Ans.

Count the number of derangements possible for a set of 'N' elements.

  • Use dynamic programming to calculate the number of derangements for each test case

  • The formula for derangements is D(n) = (n-1)*(D(n-1) + D(n-2)), with base cases D(1) = 0 and D(2) = 1

  • Calculate derangements modulo (10^9 + 7) to avoid overflow issues

2d ago

Q. Find the Second Largest Element

Given an array or list of integers 'ARR', identify the second largest element in 'ARR'.

If a second largest element does not exist, return -1.

Example:

Input:
ARR = [2, 4, 5, 6, ...read more
Ans.

Find the second largest element in an array of integers.

  • Iterate through the array to find the largest and second largest elements.

  • Handle cases where all elements are identical by returning -1.

  • Consider edge cases like empty array or array with less than 2 elements.

Asked in SAP

4d ago
Q. What is normalization in the context of database management systems?
Ans.

Normalization in database management systems is the process of organizing data in a database to reduce redundancy and improve data integrity.

  • Normalization involves breaking down a database into smaller, more manageable tables.

  • It helps in reducing data redundancy by storing data in a structured manner.

  • Normalization ensures data integrity by minimizing data anomalies.

  • There are different normal forms such as 1NF, 2NF, 3NF, and BCNF that define the level of normalization.

  • For exam...read more

Are these interview questions helpful?

Interview Experiences of Popular Companies

Nagarro Logo
3.9
 • 793 Interviews
Reliance Trends Logo
4.1
 • 112 Interviews
View all
Interview Tips & Stories
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
CSD Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits