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

SDE - 1

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

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Data Structures (Binary Trees extensively), Algorithms, System Design, Aptitude, OOPS
Tip
Tip

Tip 1 : For JTG, Binary Trees should be the primary focus while preparing DSA.
Tip 2 : Practicing 4-5 questions daily

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

Tip 1 : If applying for a Fresher position, do add your DSA ratings of different portals.
Tip 2 : When mentioning projects, also mention the highlights of your projects.

Interview rounds

01
Round
Easy
Face to Face
Duration60 minutes
Interview date6 Sep 2020
Coding problem2

This round started with 2 DSA Questions where we need to first explain the most optimal approach and then were asked to write code on paper. This was a followed by a short discussion on my projects mentioned in the resume

1. Maximum Subtree Sum

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

You are given an arbitrary binary tree consisting of N nodes. Your task is to find the largest subtree sum.

Note :

1. The value of any node will not be equal to zero.
2. Subtree of a node X is all the nodes that are below X and X itself.
3. For example in the tree given below, nodes 1, 2 and 3 are in subtree of 1.

altImage

4. Subtree sum of X is the sum value of all the nodes in subtree of X.  
5. Binary tree is a tree wherein each node has at most two children.  
6. Any two nodes may have the same value associated with it.
Problem approach

Initialize an Ans equal to negative infinity where we will store the max subarray sum.

 

Traverse all the nodes of the tree using preorder traversal.

 

  1. If we are at node current then call preorder traversal of left and right child of current.
  2. Calculate the subtree sum of the current node.
  3. Subtree sum of the current node is the sum of subtree sum of left and right child and val[current].
  4. If subtree sum of current is greater than Ans then update and.
  5. Return the subtree sum of the current so that we can calculate the subtree sum of its parent.
  6. When we complete the recursive traversal(or in other words when we return back from the preorder traversal function) return Ans.
Try solving now

2. Add One to Linked List

Easy
23m average time
0/40
Asked in companies
Josh Technology GroupPark+

You're given a positive integer represented in the form of a singly linked-list of digits. The length of the number is 'n'.


Add 1 to the number, i.e., increment the given number by one.


The digits are stored such that the most significant digit is at the head of the linked list and the least significant digit is at the tail of the linked list.


Example:
Input: Initial Linked List: 1 -> 5 -> 2

Output: Modified Linked List: 1 -> 5 -> 3

Explanation: Initially the number is 152. After incrementing it by 1, the number becomes 153.
Problem approach

Used recursion, and while falling back incremented the last number, if anything needed to carry forwarded, returned it from the function and then added it to previous digit.

Try solving now
02
Round
Medium
Face to Face
Duration60 minutes
Interview date4 Sep 2020
Coding problem2

2 DSA Questions
First we needed to tell the most optimal approach and then write the code on paper

1. Sort an array of 0 1 2

Easy
22m average time
0/40
Asked in companies
Expedia GroupWalmartHCL Technologies

You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.

Note :
Try to solve the problem in 'Single Scan'. ' Single Scan' refers to iterating over the array/list just once or to put it in other words, you will be visiting each element in the array/list just once.
Problem approach

Used 2 pointer to virtually divide array in 3 sections and used the second pointer to iterate and place each element in the correct place.

Try solving now

2. Remove Consecutive Duplicates

Easy
0/40
Asked in companies
OlaWalmartSamsung

You are given a string ‘str’ of size ‘N’. Your task is to remove consecutive duplicates from this string recursively.

For example:

If the input string is ‘str’ = ”aazbbby”, then your output will be “azby”.
Note that we are just removing adjacent duplicates.
Problem approach

Used recursion to traverse and kept check if it's a duplicate and removed it while traversing back.

Try solving now
03
Round
Hard
Face to Face
Duration90 minutes
Interview date4 Sep 2020
Coding problem2

2 Algorithmic Questions were asked in this round

1. Closest Leaf To Given Node In Binary Tree

Moderate
15m average time
85% success
0/80
Asked in companies
Cerner CorporationJosh Technology GroupGoDigitley

Ninja is stuck in a maze which is in a form of a binary tree. He needs your help in order to get out.

Ninja is presently at the node ‘X’. The only exit points of the maze are the leaf nodes of the tree. You need to tell him the distance to the nearest exit point from his current location. This will help him decide which path he should take in order to escape from the maze.

Example:

sample tree 1

Suppose, Ninja is stuck at node 62. The possible exit points in the maze are: 40, 10, and 20. From all the possible exit points the closest ones are 10 and 20 which are at a distance of 1 unit.
Problem approach

Used modified LCA to solve the question

Try solving now

2. Largest Number in Binary Tree

Moderate
36m average time
60% success
0/80
Asked in companies
SamsungSprinklrOLX Group

You have been given a Binary Tree of 'N' nodes where the nodes have integer values.

Your task is to find the largest number that could be formed by concatenating all its nodes values.

For example:
For the given binary tree:   

tree example

Output: 96553210    

Explanation: After concatenating all the numbers in the above binary tree this is the largest number that can be formed. 
Problem approach

A simple solution would be to store all the node values to the list/array by traversing the whole Binary Tree and the problem now is that given a list of non-negative integers, arrange them such that they form the largest number.

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

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

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Josh Technology Group
1522 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Josh Technology Group
1027 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 3 problems
Interviewed by Josh Technology Group
1486 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 7 problems
Interviewed by Josh Technology Group
1160 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by BNY Mellon
6365 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
2197 views
0 comments
0 upvotes