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

SDE - 1

ValueLabs
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
In the beginning, I started learning about basic DSA concepts. These included topics like array, string, stack, queue, and solving questions on coding platforms. After practicing enough on that, I moved to advanced DSA topics, including LinkedList, Tree, Graph, DP, etc. Then, I also gave some mock interviews, which helped me prepare for interviews.
Application story
It is an on-campus opportunity for me. There were 4 rounds in total: the first one is an online assessment, followed by two rounds of DSA, and then the cultural fitment round.
Why selected/rejected for the role?
My basic concepts of all the topics were clear, and I also prepared for HR questions through mock interviews. I practiced all the basic to medium coding questions before the interview.
Preparation
Duration: 3 months
Topics: Array, Dp, string, Tree, graph and other important coding questions
Tip
Tip

Tip 1 : Work hard and prepare well.
Tip 2 : Prepare resume well.

Application process
Where: Campus
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1: Have good projects on your resume; the definition of "good" is not tough. It simply means what you create. You should be able to explain it.

Tip 2: Try to work on a project that solves a real-life problem. It can be anything (for example, a contest reminder, as I frequently miss my contests and decided to do a project on it).

Tip 3: Never put things you don’t know on your resume. It’s not about quantity; it’s about quality.

Interview rounds

01
Round
Easy
Online Coding Test
Duration60 min
Interview date27 Jan 2023
Coding problem2

- Morning time.
- Environment was good.
- Interviewer was good.

1. Level Order Traversal

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

You have been given a Binary Tree of integers. You are supposed to return the level order traversal of the given tree.

For example:
For the given binary tree

Example

The level order traversal will be {1,2,3,4,5,6,7}.
Problem approach

Again, I had already done this question in the course itself, so it was a cakewalk for me.
Solution:
Step 1: Create an empty queue that accepts BinaryTreeNode.
Step 2: Put the root of the binary tree in the queue.
Step 3: Loop while the queue is not empty:
3a. Store the current size of the queue, which will help us know how many nodes are there that need to be printed at one level.
3b. Dequeue the first node from the queue.
3c. Print its data.
3d. If the dequeued node has a left or right child, enqueue it to the queue.
3e. Print a line as we move to the next level.

Try solving now

2. Kth ancestor of a node in binary tree

Hard
50m average time
35% success
0/120
Asked in companies
Goldman SachsHCL TechnologiesHCL Technologies

You are given an arbitrary binary tree consisting of N nodes numbered from 1 to N, an integer 'K', and a node 'TARGET_NODE_VAL' from the tree. You need to find the Kth ancestor of the node 'TARGET_NODE_VAL'. If there is no such ancestor, then print -1.

The Kth ancestor of a node in a binary tree is the Kth node in the path going up from the given node to the root of the tree. Refer to sample test cases for further explanation.

Note:
1. The given node 'TARGET_NODE_VAL' is always present in the tree.
2. The value of each node in the tree is unique.
3. Notice that the Kth ancestor node if present will always be unique.
Problem approach

I solved this question recursively. 

Step 1: Find the given node in the tree. 

Step 2: If the node is not found, simply return null; otherwise, check if K is greater than 0. If yes, that means we haven't found the Kth ancestor yet, so we decrement the value of K. 

Also, check if the K value is 0. If so, we have found the Kth ancestor, and we print it and return null. In the base case, if the root is null, we return.

Try solving now
02
Round
Easy
Face to Face
Duration60 min
Interview date15 Feb 2023
Coding problem2

- Morning time.
- Environment was good.
- Interviewer was good.

1. Longest Valid Parentheses

Moderate
10m average time
90% success
0/80
Asked in companies
Goldman SachsDunzoAmazon

You are given a string ‘S’ containing only the characters ‘)’ and ‘(‘. You need to find the length of the longest valid i.e. well-formed parentheses substring.

For example:
Let the given string be “(()())((”.

Here the valid parentheses substrings are: “()”, “()” and “(()())”. Out of these the longest valid string is “(()())” which has a length 6.
Problem approach

It is a recursive problem, so I first thought in that direction. Then, I found that there were overlapping subproblems, so I thought about using dynamic programming.

Try solving now

2. Equilibrium Index

Easy
0/40
Asked in companies
Expedia GroupCoinbaseGoldman Sachs

You are given an array Arr consisting of N integers. You need to find the equilibrium index of the array.

An index is considered as an equilibrium index if the sum of elements of the array to the left of that index is equal to the sum of elements to the right of it.

Note:

1. The array follows 0-based indexing, so you need to return the 0-based index of the element.
2. Note that the element at the equilibrium index won’t be considered for either left sum or right sum.
3. If there are multiple indices which satisfy the given condition, then return the left-most index i.e if there are indices i,j,k…. which are equilibrium indices, return the minimum among them
4. If no such index is present in the array, return -1.
Problem approach

Step 1: I made a helper function where I passed the root node and 0, which worked as the sum in it.
Step 2: I made a base case; if the root is null, return.
Step 3: I went to the rightmost node of the tree, as the rightmost node is the only node that will have the highest value in the whole BST.
Step 4: I added the root's data to the sum variable, which was passed to the helper function.
Step 5: After adding the root's data to the sum variable, I updated the current root's data with that sum.
Step 6: I called the function recursively on the left side of the tree by sending root. Left as the root node and the updated sum in the helper function.

Try solving now
03
Round
Easy
HR Round
Duration60 min
Interview date11 Apr 2023
Coding problem1

- Morning time
- Environment was good.
- Interviewer was good

1. HR Questions

1. What were my favourite subjects in my academics?
2. Which project I am proud of?
3. Why do I want to join DUNZO? Why not any other organisation?
4. What difficulties did I face when I learned the new tech stack and how did I overcome it?
5. How do I keep myself updated?
6. Which Data Structures I am currently studying?
7. Then he asked me if I have any questions for him. I asked two questions.

Problem approach

Tip 1 : Walkthrough in the code of project so you must know about project properly.
Tip 2 : Read about behavioural questions before.
Tip 3 : Brush up your knowledge on DSA.

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
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4657 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by ValueLabs
980 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6450 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3452 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by BNY Mellon
6261 views
3 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by BNY Mellon
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by CIS - Cyber Infrastructure
2159 views
0 comments
0 upvotes