Josh Technology Group interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

Josh Technology Group
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Try to solve some good questions from every topic.
Tip 2 : If not have much time, then you can solve top interview questions from Leetcode.
Tip 3 : Made 2-3 good projects using any technology

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

Tip 1 : Keep resume short and crispy.
Tip 2 : Add coding profile handles and github link.

Interview rounds

01
Round
Hard
Online Coding Test
Duration60 min
Interview date14 Jun 2022
Coding problem1

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

1. Validate Binary Tree Nodes

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

You are given ‘N’ binary tree nodes numbered from 0 to N - 1 where node ‘i’ has two children LEFT_CHILD[i] and RIGHT_CODE[i]. Return ‘True’ if and only if all the given nodes form exactly one valid binary tree. If node ‘i’ has no left child then 'LEFT_CHILD[i]' will equal -1, similarly for the right child.

Example:

Let’s say we have n=4 nodes, 'LEFT_CHILD' = {1, -1, 3, -1} and 
RIGHT_CHILD = {2, -1, -1, -1}. So the resulting tree will look like this:

It will return True as there is only one valid binary tree and each node has only one parent and there is only one root.
Problem approach

s1- I used level order traversal concept to solve this problem
s2- Apply sorting on the alphabetical order

Try solving now
02
Round
Medium
Online Coding Test
Duration60 min
Interview date11 May 2022
Coding problem4

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

1. Number of balanced binary trees

Easy
10m average time
90% success
0/40
Asked in companies
MobiKwikJosh Technology GroupBlackrock

You are given an integer ‘N’, you are supposed to find the number of balanced binary trees with height ‘N’. Since the answer can be very large, return the answer modulo 10^9+7.

Note :
A binary tree is considered balanced if the difference between the left subtree’s height and the right subtree’s height is less than or equal to 1, for all non-leaf nodes.

Example:

Consider N=2, there are three different binary trees.

Example

Problem approach

s1- I used postorder tee traversal to solve this problem.
s2- first go on left subtree and return the height, similarly gets height of right subtree and check if absolute difference is less than or equal to 1.

Try solving now

2. Sort an array in wave form

Easy
10m average time
85% success
0/40
Asked in companies
AmazonSAP LabsExpedia Group

You have been given an unsorted array ‘ARR’.

Your task is to sort the array in such a way that the array looks like a wave array.

Example:
If the given sequence ‘ARR’ has ‘N’ elements then the sorted wave array looks like - 
‘ARR[0] >= ARR[1]’ and ‘ARR[1] <= ARR[2]’
‘ARR[2] >= ARR[3]’ and ‘ARR[3] <= ARR[4]’
‘ARR[4] >= ARR[5]’ and ‘ARR[5] <= ARR[6]’  And so on.
Note:
1. ‘ARR[0]’ must be greater than or equal to ‘ARR[1]’.

2. There can be multiple arrays that look like a wave array but you have to return only one.

3. We have an internal function that will check your solution and return 'True' in case your array is one of the solutions otherwise return 'False'.

Explanation

The given array ‘ ARR = { 4, 3, 5, 2, 3, 1, 2 } ’
The below figure is a visual representation of the given ‘ARR’ and you can see we can express ‘ARR’ in a waveform array because 
4>3 and 3<5 
5>2 and 2<3
3>1 and 1<2
And it follows the condition of wave array.

subsequence

Follow up:
Try to solve this problem in linear time complexity.
Problem approach

Step 1 : I explained her naive approach by sorting the linked list in O(n.log(n)) TC.,
Step 2 : interviewer asked me to optimise it.
Step 3 : After thinking sometime I told her the solution in O(n) TC, this time she seems to be happy and asked me to write the code

Try solving now

3. Pair Sum in BST

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

You are given a Binary Search Tree (BST) and a target value ‘K’. Your task is to return true if there exist two nodes in the given BST such that the sum of their values is equal to the given target ‘K’, else return false.


A binary search tree (BST) is a binary tree data structure which has the following properties.

• The left subtree of a node contains only nodes with data less than the node’s data.

• The right subtree of a node contains only nodes with data greater than the node’s data.

• Both the left and right subtrees must also be binary search trees.


Note:
1. All the elements of the Binary Search Tree are unique.

2. You can’t use the same node value/element of BST twice.


For example:
tree: 8 5 10 2 6 -1 -1 -1 -1 -1 7 -1 -1
'K' = 13,

The nodes with values 8 and 5 as shown in the above figure gives sum equal to the given target 13. 

Therefore, the output will be “true” i.e it is possible to find a pair in the given BST having sum equal to ‘K’.
Problem approach

Step 1 : Earlier, this question seems to be very easy, I told the approach using O(n) TC and O(n) SC, then interviewer asked me to optimise the SC.

Step 2 : I told the another approach using O(n(logn)) TC and O(1) SC, but again interviewer was not happy and this time she asked me to optimise TC.

Step 3 : After lot of thinking, I cam up with the solution using Stack DS, that takes O(n) TC and O(heigh_of_tree) SC, this was the approach interviewer was looking for, he asked me to write the code

Try solving now
Hard
20m average time
80% success
0/120
Asked in companies
Goldman SachsUberApple

You are given an arbitrary binary tree, a node of the tree, and an integer 'K'. You need to find all such nodes which have a distance K from the given node and return the list of these nodes.


Distance between two nodes in a binary tree is defined as the number of connections/edges in the path between the two nodes.


Note:

1. A binary tree is a tree in which each node has at most two children. 
2. The given tree will be non-empty.
3. The given tree can have multiple nodes with the same value.
4. If there are no nodes in the tree which are at distance = K from the given node, return an empty list.
5. You can return the list of values of valid nodes in any order. For example if the valid nodes have values 1,2,3, then you can return {1,2,3} or {3,1,2} etc.
Example :

Sample Output 2 explanation

Consider this tree above. The target node is 5 and K = 3. The nodes at distance 1 from node 5 are {2}, nodes at distance 2 from node 5 are {1, 4} and nodes at distance 3 from node 5 are {6, 3}.
Problem approach

Step 1 : Firstly, I gave BFS solution, first find the parent of every node of tree and then push pair of target_node, distance(k) in the queue, run the loop till queue is not empty and each time pop the top pair from queue and check if pair.second(distance) is 0 then add pair.first(node) in answer vector otherwise push pair.first right, left and parent(if exists), dis-1 in the queue.

Step 2 : Interviewer asked me to optimise the SC.

Step 3 : I told the approach using DFS in constant space, this time interviewer asked me to write the code.

Try solving now
03
Round
Medium
HR Round
Duration20 min
Interview date6 Jul 2022
Coding problem1

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

1. Basic HR Questions

 How do you feel about working weekends and night shifts?
- Where do you see yourself 3 years from now? or Where do you see yourself in 5 years?
- Give an example of a time you had to respond to an unhappy manager/ customer/ colleague/ professor/ friend.
- How quickly do you adapt to new technology?- 
- What software packages are you familiar with?
- On a scale of 1 to 10 how would you rate yourself as a leader?

Problem approach

Tip 1: Practice mock interview
Tip 2: Practice by college

Here's your problem of the day

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

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
6 rounds | 14 problems
Interviewed by Josh Technology Group
5584 views
0 comments
0 upvotes
company logo
SDE - Intern
5 rounds | 6 problems
Interviewed by Josh Technology Group
3263 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Josh Technology Group
1140 views
1 comments
0 upvotes
company logo
SDE - Intern
7 rounds | 7 problems
Interviewed by Josh Technology Group
1137 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Arcesium
3738 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by Arcesium
2683 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by BNY Mellon
2348 views
0 comments
0 upvotes