DTCC interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

DTCC
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
My personal journey has been very challenging. Coming from a middle-class family, I did not have access to a computer for a long time. I first came to know about computers when I joined college, and from then on, I never looked back.
Application story
This is an on-campus placement opportunity for me. The company visited my campus for the placement.
Why selected/rejected for the role?
This was a great experience for me. I performed well, and I am satisfied with the effort I have put forward.
Preparation
Duration: 6 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1: Prepare your resume well.

Tip 2: Deploy your projects so that the interviewer can view them. Also, provide a hyperlink on your resume.

Tip 3: Be thorough with data structures and algorithms. Also, prepare well for topics such as OS and DBMS.

Application process
Where: Campus
Eligibility: Above 6 CGPA
Resume Tip
Resume tip

Tip 1: Deploy your projects so that the interviewer can view them. Also, provide a hyperlink on your resume.

Tip 2: It's not necessary to have fancy projects. Only mention those you're confident about.

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date27 May 2023
Coding problem2

The interviewers focused on our knowledge of memory management in C++ and asked questions about dynamic memory allocation, memory leaks, and smart pointers. We were expected to discuss the differences between stack and heap memory and demonstrate an understanding of memory deallocation.

1. Distribute N candies among K people

Easy
15m average time
85% success
0/40
Asked in companies
GeeksforGeeksOlaIntuit

Sanyam has ‘N’ candies, he wants to distribute that into ‘K’ of his friends. He made his ‘K’ friends stand in line, in increasing order of his likeness. Not being so smart he gives 1 candy to the first friend, 2 to the second person, and so on till the kth person. In the next turn, the first person gets ‘K + 1’ candies, the second person gets ‘K + 2’ candies, and so on.

While distributing the candies, if at a turn, the number of candies to be given to a friend is less than the required candies, then that friend gets all the remaining candies and Sanyam stops the distribution.

Your task is to find the total number of candies every person has at the end.

Problem approach

I solved this using permutations and combinations. The approach was to calculate the total ways to distribute N items among three people and then subtract invalid distribution from the total ways will result in the required answer.

Try solving now

2. Replace ‘O’ with ‘X’

Moderate
35m average time
60% success
0/80
Asked in companies
RazorpayIntuitDTCC

Given a 2D array grid G of 'O's and 'X's. The task is to replace all 'O' with 'X' contained in each island. Where, an island is a set of 'O's connected horizontally or vertically and surrounded by 'X' from all of it's boundaries. (Boundary means top, bottom, left and right)

Example:
{{X, X, O, X, X, X},
 {X, X, O, X, O, X},
 {X, X, X, O, O, X},
 {X, O, X, X, X, X},
 {O, X, O, O, X, X},
 {X, X, X, X, O, X}}

In the above example, there are 3 islands. Considering Zero based indexing of rows and columns, in the following islands described here, (x,y) represents the element in xth row and yth column.

Island 1: Formed by three elements at (1, 4), (2, 3), (2, 4) positions.

Island 2: Formed by a single element at (3, 1) position.

Island 3: Formed by two elements at (4, 2), (4, 3) positions.

Note:

In the above example, elements at positions (0, 2) and (1,2) do not form an island as there is no 'X' surronding it from the top.
Problem approach

I solved this question using the Flood-fill algorithm by replacing ‘O’ with a special character and applying Flood-fill for every edge of the matrix by traversing it.

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date27 May 2023
Coding problem2

In addition to DBMS questions, we encountered queries related to database administration and performance tuning. We were asked to discuss techniques for optimizing query execution plans, database indexing strategies, and backup and recovery procedures. We were evaluated on our ability to handle large datasets and ensure efficient and reliable database operations.

1. Smallest Subarray with K Distinct Elements

Easy
20m average time
80% success
0/40
Asked in companies
IntuitUberGoldman Sachs

Given an array 'A' consisting of 'N' integers, find the smallest subarray of 'A' containing exactly 'K' distinct integers.

Note :
If more than one such contiguous subarrays exist, consider the subarray having the smallest leftmost index.

For example - if A is [1, 2, 2, 3, 1, 3 ] and k = 2 then the subarrays: [1,2], [2,3], [3,1], [1,3] are the smallest subarrays containing 2 distinct elements. In this case, we will consider the starting and ending index of subarray [1,2] i.e. 0 and 1.
Problem approach

I used the concept of the sliding window to solve this question. I initialized the start pointer and end pointer to 0, then moved the end pointer to a position where the number of distinct elements between the start and end pointers equaled k. I tracked this using a map. Next, I moved the start pointer forward until the number of distinct elements between the start and end pointers equalled k - 1. I stored the minimum difference between the end and start pointers over the entire array. After explaining the algorithm, I wrote neatly commented code and performed a dry run on test cases provided by the interviewer.

Try solving now

2. Palindrome Linked List

Easy
20m average time
90% success
0/40
Asked in companies
Livekeeping (An IndiaMART Company)AppleThought Works

You are given a singly Linked List of integers. Your task is to return true if the given singly linked list is a palindrome otherwise returns false.

For example:
The given linked list is 1 -> 2 -> 3 -> 2-> 1-> NULL.

It is a palindrome linked list because the given linked list has the same order of elements when traversed forwards and backward​.
Follow Up:
Can you solve the problem in O(N) time complexity and O(1) space complexity iteratively?
Problem approach
  • I used a stack to solve this problem.
  • Traverse the given list from head to tail and push every visited node onto the stack.
  • Traverse the list again. For every visited node, pop a node from the stack and compare the data of the popped node with the currently visited node.
  • If all nodes match, then return true; otherwise, return false.
Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date27 May 2023
Coding problem2

1. Unique Paths

Moderate
25m average time
80% success
0/80
Asked in companies
BNY MellonCoinDCXAmazon

You are present at point ‘A’ which is the top-left cell of an M X N matrix, your destination is point ‘B’, which is the bottom-right cell of the same matrix. Your task is to find the total number of unique paths from point ‘A’ to point ‘B’.In other words, you will be given the dimensions of the matrix as integers ‘M’ and ‘N’, your task is to find the total number of unique paths from the cell MATRIX[0][0] to MATRIX['M' - 1]['N' - 1].

To traverse in the matrix, you can either move Right or Down at each step. For example in a given point MATRIX[i] [j], you can move to either MATRIX[i + 1][j] or MATRIX[i][j + 1].

Problem approach

The recursive formula is as follows:
int numberOfPaths(int m, int n)
{
if (m == 1 || n == 1)
return 1;
return numberOfPaths(m - 1, n) + numberOfPaths(m, n - 1);
}
However there are overlapping problems hence, we use DP to further optimize it.

Try solving now

2. Find Number of Islands

Moderate
34m average time
60% success
0/80
Asked in companies
MicrosoftAmazonUber

You are given a 2-dimensional array/list having N rows and M columns, which is filled with ones(1) and zeroes(0). 1 signifies land, and 0 signifies water.

A cell is said to be connected to another cell, if one cell lies immediately next to the other cell, in any of the eight directions (two vertical, two horizontal, and four diagonals).

A group of connected cells having value 1 is called an island. Your task is to find the number of such islands present in the matrix.

Problem approach

A cell in a 2D matrix can be connected to 8 neighbours. Therefore, we can recursively call for 8 neighbours only. We keep track of the visited '1's so they are not revisited. I provided solutions using both BFS and DFS, and I had to code both methods. This question was followed by questions related to graphs.

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
SDE - 1
3 rounds | 6 problems
Interviewed by DTCC
991 views
0 comments
0 upvotes
SDE - 1
3 rounds | 6 problems
Interviewed by DTCC
868 views
0 comments
0 upvotes
SDE - 1
2 rounds | 4 problems
Interviewed by DTCC
1088 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3451 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114579 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57825 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34961 views
7 comments
0 upvotes