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

Backend Developer

Tbo
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
First of all, I got selected for a Tier 1 college from there, my journey in coding started. I have done most of my coding in my final years only, but I till now regret that I should have started a little bit earlier
Application story
This is a campus opportunity this company visited our college and take OA, which is a little bit harder.
Why selected/rejected for the role?
I was rejected because i do not have some decent projects in my resume and i was not confirtable in answering all the questions answers
Preparation
Duration: 4 months
Topics: Data Structures, Computer Network, DevOps, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Do 500 good quality questions
Tip 2 : Have some decent project in your resume

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

Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Hard
Video Call
Duration60 minutes
Interview date13 Jan 2023
Coding problem2

1. Boundary Traversal of Binary Tree

Hard
20m average time
85% success
0/120
Asked in companies
MicrosoftAmazonInfo Edge India (Naukri.com)

You are given a binary tree having 'n' nodes.


The boundary nodes of a binary tree include the nodes from the left and right boundaries and the leaf nodes, each node considered once.


Figure out the boundary nodes of this binary tree in an Anti-Clockwise direction starting from the root node.


Example :
Input: Consider the binary tree A as shown in the figure:

alt text

Output: [10, 5, 3, 7, 18, 25, 20]

Explanation: As shown in the figure

The nodes on the left boundary are [10, 5, 3]

The nodes on the right boundary are [10, 20, 25]

The leaf nodes are [3, 7, 18, 25].

Please note that nodes 3 and 25 appear in two places but are considered once.
Problem approach

You have been given a binary tree of integers. Your task is to print the boundary nodes of this binary tree in Anti-Clockwise direction starting from the root node.

Try solving now

2. Maximum sum two non-overlapping subarrays of a given size

Moderate
15m average time
85% success
0/80
Asked in companies
MicrosoftExpedia GroupAdobe

You are given an array/list ARR of integers and a positive integer ‘K’. Your task is to find two non-overlapping subarrays (contiguous) each of length ‘K’ such that the total sum of these subarrays is maximum.

For Example:
If you are given ARR = [2, 5, 1, 2, 7, 3, 0] and K = 2, the output is 17. 

We can choose non-overlapping subarrays [2, 5] and [7, 3] to get a total sum of 17 (i.e. 2 + 5 + 7 + 3) which is the maximum possible sum.

You can assume that the array will always contain at least two non-overlapping subarrays with size ‘K’. So, the answer will always exist.

Problem approach

You are given an array/list ARR of integers and a positive integer ‘K’. Your task is to find two non-overlapping subarrays (contiguous) each of length ‘K’ such that the total sum of these subarrays is maximum.

Try solving now
02
Round
Hard
Video Call
Duration60 minutes
Interview date13 Jan 2023
Coding problem2

1. Knight Probability in Chessboard

Moderate
20m average time
80% success
0/80
Asked in companies
Goldman SachsPhonePeAmazon

You are given an N x N chessboard and a knight. On a chessboard, the knight can supposedly move in 8 different positions from its original position i.e. if the knight is originally at (i,j) then it can move to (i + 2, j + 1), (i + 2, j - 1), (i - 2, j + 1), (i - 2, j - 1), (i + 1, j + 2), (i + 1, j - 2), (i - 1, j + 2), (i - 1, j - 2).

The rows and columns are 0 indexed, so the top-left square is (0, 0), and the bottom-right square is (N - 1, N - 1).

chessboard

(X is the Knight’s current position, O is the position Knight can visit in 1 move)

You have to make K such moves from the initial position of the knight and tell the probability of the knight being within the boundaries of the chessboard i.e you have to consider all possibilities of K moves and determine the probability that after these moves the knight will remain within the chess grid.

Note:

Print output up to 6 decimal places.
Problem approach

You are given an N x N chessboard and a knight. On a chessboard, the knight can supposedly move in 8 different positions from its original position i.e. if the knight is originally at (i,j) then it can move to (i + 2, j + 1), (i + 2, j - 1), (i - 2, j + 1), (i - 2, j - 1), (i + 1, j + 2), (i + 1, j - 2), (i - 1, j + 2), (i - 1, j - 2).
The rows and columns are 0 indexed, so the top-left square is (0, 0), and the bottom-right square is (N - 1, N - 1).

Try solving now

2. Convert A Given Binary Tree To Doubly Linked List

Moderate
15m average time
80% success
0/80
Asked in companies
RazorpayAmazonGoldman Sachs

Given a Binary Tree, convert this binary tree to a Doubly Linked List.

A Binary Tree (BT) is a data structure in which each node has at most two children.

A Doubly Linked List contains a previous pointer, along with the next pointer and data.

The order of nodes in Doubly Linked List must be the same as Inorder of the given Binary Tree.

The doubly linked list should be returned by taking the next pointer as right and the previous pointer as left.

You need to return the head of the Doubly Linked List.

For the given binary tree :

alt txt

You need to return the head to the doubly linked list.
The doubly linked list would be: 1 2 3 4 5 and can be represented as:

alt txt

Problem approach

Given a Binary Tree, convert this binary tree to a Doubly Linked List.
A Binary Tree (BT) is a data structure in which each node has at most two children.
A Doubly Linked List contains a previous pointer, along with the next pointer and data.
The order of nodes in Doubly Linked List must be the same as Inorder of the given Binary Tree.
The doubly linked list should be returned by taking the next pointer as right and the previous pointer as left.
You need to return the head of the Doubly Linked List.

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

Which SQL clause is used to specify the conditions in a query?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4742 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Amazon
1001 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6514 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3525 views
0 comments
0 upvotes