Add office photos
Deutsche Bank logo
Employer?
Claim Account for FREE

Deutsche Bank

3.9
based on 3.5k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Software Developer Intern
Fresher
Skills
Clear (1)

10+ Deutsche Bank Software Developer Intern Interview Questions and Answers

Updated 5 Feb 2024

Q1. Longest Consecutive Sequence Problem Statement

You are provided with an unsorted array/list ARR of N integers. Your task is to determine the length of the longest consecutive sequence present in the array.

Expl...read more

Ans.

Find the length of the longest consecutive sequence in an unsorted array of integers.

  • Iterate through the array and store all elements in a set for constant time lookups.

  • For each element, check if it is the start of a sequence by looking for its previous number in the set.

  • Update the length of the current sequence and the maximum length found so far.

  • Return the maximum length of consecutive sequence found.

Add your answer
right arrow

Q2. Find the Minimum Cost to Reach Destination via Train

Given 'N' stations on a train route, where the train travels from station 0 to 'N'-1, determine the minimum cost to reach the final station using given ticke...read more

Ans.

Find the minimum cost to reach the destination via train using given ticket costs for each pair of stations.

  • Create a 2D array to store the costs from each station to the final destination.

  • Use dynamic programming to calculate the minimum cost to reach each station.

  • Iterate through the stations and update the minimum cost based on the previous stations.

  • Return the minimum cost to reach the final station.

Add your answer
right arrow
Deutsche Bank Software Developer Intern Interview Questions and Answers for Freshers
illustration image

Q3. Next Smaller Palindrome Problem Statement

You are provided with a palindrome number 'N' presented as a string 'S'. The task is to determine the largest palindrome number that is strictly less than 'N'.

Input:

T...read more
Ans.

Given a palindrome number 'N' as a string, find the largest palindrome number strictly less than 'N'.

  • Iterate from the middle towards the start and end of the number to find the next smaller palindrome.

  • Handle cases where the middle digit is 0 by borrowing from adjacent digits.

  • Ensure the resulting number does not have leading zeros, except when the answer is 0.

Add your answer
right arrow

Q4. Matrix Bit Flipping Problem

In this task, you're provided with a binary square matrix of size 'N * N' named MAT. The task requires you to perform row and column flips whenever a zero (0) is encountered in the m...read more

Ans.

Count the total number of flips required in a binary matrix when encountering zeros.

  • Iterate through the matrix and whenever a zero is encountered, flip all 1s in the corresponding row and column.

  • Keep track of the total number of flips required.

  • Return the total count of flips at the end.

Add your answer
right arrow
Discover Deutsche Bank interview dos and don'ts from real experiences

Q5. Jump Game Problem Statement

In this problem, you are given an array ARR consisting of N integers. Your task is to determine the minimum number of jumps required to reach the last index of the array N - 1. At an...read more

Ans.

The problem involves finding the minimum number of jumps required to reach the last index of an array, where each element represents the maximum distance that can be jumped from that index.

  • Start from index 0 and keep track of the maximum reachable index at each step.

  • Update the maximum reachable index as you iterate through the array.

  • Increment the jump count when you reach the end of the current reachable range.

  • Continue until the last index is reached.

Add your answer
right arrow

Q6. Query and Matrix Problem Statement

You are given a binary matrix with 'M' rows and 'N' columns, initially consisting of all 0s. You will receive 'Q' queries, which can be of four types:

Query 1: 1 R index
Query ...read more
Ans.

Implement a function to process queries on a binary matrix by flipping rows/columns and counting zeros.

  • Create a binary matrix with all zeros initially.

  • Process queries by flipping rows/columns and counting zeros as per query type.

  • Return the count of zeros for type 2 queries.

  • Handle constraints efficiently to optimize the solution.

  • Example: For input M=3, N=3 and queries 1R1, 1R2, 2C1, the output should be 1.

Add your answer
right arrow
Are these interview questions helpful?

Q7. Sort a Stack Problem Statement

You are provided with a stack consisting of 'N' integers. The goal is to sort this stack in descending order by utilizing recursion.

Allowed Stack Operations:

is_empty(S) : Check ...read more
Ans.

Sort a stack in descending order using recursion without using loop constructs.

  • Implement a recursive function to sort the stack in descending order.

  • Use the provided stack operations to manipulate the stack.

  • Recursively pop elements from the original stack and insert them in the correct order in a temporary stack.

  • Once all elements are sorted in the temporary stack, move them back to the original stack.

  • Repeat the process until the original stack is sorted in descending order.

Add your answer
right arrow

Q8. Rooks Placing Problem Statement

You are given an n×n chessboard where rows and columns are numbered from 0 to n-1. Each cell (r, c) is located at the intersection of row 'r' and column 'c'. A rook is a chess pi...read more

Ans.

Given a chessboard with rooks placed, determine the maximum number of additional rooks that can be added without attacking each other.

  • Iterate through each row and column to find empty cells where additional rooks can be placed.

  • Keep track of the number of additional rooks that can be added and their positions.

  • Output the maximum number of additional rooks and their positions in lexicographical order.

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop

Q9. Merge Sort Problem Statement

You are given a sequence of numbers, ARR. Your task is to return a sorted sequence of ARR in non-descending order using the Merge Sort algorithm.

Explanation:

The Merge Sort algorit...read more

Ans.

Implement Merge Sort algorithm to sort a sequence of numbers in non-descending order.

  • Divide the input array into two halves recursively until each array has only one element.

  • Merge the sorted halves to produce a completely sorted array.

  • Time complexity of Merge Sort is O(n log n).

  • Example: Input: [3, 1, 4, 1, 5], Output: [1, 1, 3, 4, 5]

Add your answer
right arrow

Q10. Dijkstra's Shortest Path Problem

Given an undirected graph with ‘V’ vertices (labeled 0, 1, ... , V-1) and ‘E’ edges, where each edge has a weight representing the distance between two connected nodes (X, Y).

Y...read more

Ans.

Dijkstra's algorithm is used to find the shortest path from a source node to all other nodes in a graph with weighted edges.

  • Implement Dijkstra's algorithm to find the shortest path distances from the source node to all other nodes.

  • Use a priority queue to efficiently select the next node with the shortest distance.

  • Update the distances of neighboring nodes based on the current node's distance and edge weights.

  • Handle disconnected vertices by assigning a large value (e.g., 214748...read more

Add your answer
right arrow

Q11. Rat in a Maze Problem Statement

You need to determine all possible paths for a rat starting at position (0, 0) in a square maze to reach its destination at (N-1, N-1). The maze is represented as an N*N matrix w...read more

Ans.

Find all possible paths for a rat in a maze from source to destination.

  • Use backtracking to explore all possible paths in the maze.

  • Keep track of visited cells to avoid revisiting them.

  • Recursively try moving in all directions (up, down, left, right) until reaching the destination.

  • Add the path to the result list when the destination is reached.

  • Sort the result list in alphabetical order before returning.

Add your answer
right arrow

Q12. Cycle Detection in a Singly Linked List

Determine if a given Singly Linked List of integers contains a cycle.

Explanation:

A cycle in a linked list occurs when a node's next pointer points back to a previous no...read more

Ans.

Detect if a singly linked list contains a cycle using Floyd's Tortoise and Hare algorithm.

  • Use Floyd's Tortoise and Hare algorithm to detect cycle in a linked list

  • Initialize two pointers, slow and fast, and move them at different speeds

  • If there is a cycle, the two pointers will eventually meet

  • Time complexity: O(N), Space complexity: O(1)

Add your answer
right arrow

Q13. Consecutive Sum Representation of a Number

Find the number of ways the given number 'N' can be expressed as the sum of two or more consecutive natural numbers.

Example:

Input:
N = 9
Output:
2
Explanation:

The n...read more

Ans.

Find the number of ways a given number can be expressed as the sum of two or more consecutive natural numbers.

  • Use a sliding window approach to iterate through consecutive numbers and check if their sum equals the given number.

  • Keep track of the count of valid consecutive sums found.

  • Return the count of valid consecutive sums as the final answer.

Add your answer
right arrow

Q14. Remove the Kth Node from the End of a Linked List

You are given a singly Linked List with 'N' nodes containing integer data and an integer 'K'. Your task is to delete the Kth node from the end of this Linked Li...read more

Ans.

Implement a function to remove the Kth node from the end of a singly linked list.

  • Traverse the list to find the length 'N' of the linked list.

  • Calculate the position of the node to be removed from the beginning as 'N - K + 1'.

  • Traverse the list again and remove the node at the calculated position.

Add your answer
right arrow
Q15. Write a SQL query to select all the people who are below the age of 75 from a set of people.
Ans.

SQL query to select people below age 75

  • Use SELECT statement to retrieve data

  • Use WHERE clause to filter out people above age 75

  • Example: SELECT * FROM people WHERE age < 75

Add your answer
right arrow
Q16. What is the diamond problem in Object-Oriented Programming?
Ans.

The diamond problem occurs in multiple inheritance when a class inherits from two classes that have a common ancestor.

  • Occurs in multiple inheritance when a class inherits from two classes that have a common ancestor

  • Results in ambiguity in the inheritance hierarchy

  • Can lead to conflicts in method resolution

Add your answer
right arrow
Q17. Can you explain how heaps are implemented?
Ans.

Heaps are implemented using arrays with a binary tree structure.

  • Heaps are complete binary trees where each node has a value greater than or equal to its children in a max heap, or less than or equal to its children in a min heap.

  • The root of the heap is stored at index 0 in the array, and for any node at index i, its left child is at index 2i+1 and its right child is at index 2i+2.

  • Heap operations like insertion and deletion are performed by maintaining the heap property throug...read more

Add your answer
right arrow
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Intern Interview Questions from Similar Companies

View all
Recently Viewed
INTERVIEWS
Le Passage to India Tours & Travels
No Interviews
LIST OF COMPANIES
Discover companies
Find best workplace
SALARIES
Country Holidays Inn & Suites
INTERVIEWS
Country Holidays Inn & Suites
No Interviews
SALARIES
Impresario Entertainment & Hospitality
SALARIES
Country Holidays Inn & Suites
SALARIES
Country Holidays Inn & Suites
LIST OF COMPANIES
THE LEELA PALACES HOTELS & RESORTS
Locations
LIST OF COMPANIES
Zairo International
Locations
SALARIES
Country Holidays Inn & Suites
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