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

SDE - Intern

Josh Technology Group
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 12 Months
Topics: Data structures, oops, algorithms, dynamic programming, trees, operating system, DBMS
Tip
Tip

Tip 1 : For every topic of DSA do at least 30 question so that you get good grasp on each topic
Tip 2 : Must go through OOPS, DBMS in details as they are very much asked in interview
Tip 3 : Also you should have complete knowledge of the technology used in your personal projects.

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

Tip 1 : Your resume must be of 1 page only
Tip 2 : You must have projects in your resume along with the practical impact it is making

Interview rounds

01
Round
Medium
Video Call
Duration75 minutes
Interview date11 Aug 2021
Coding problem2

Round held at 12 noon. There were 2 interviewers

1. Zig - Zag Array

Easy
0/40
Asked in companies
AmazonJosh Technology Group

You are given an array of distinct elements, and you have to rearrange the array elements in a zig-zag fashion. In other words, for every odd position ‘i’ in the array 'ARR,' 'ARR'[i] should be greater than 'ARR'[i-1] and 'ARR'[i] should be greater than 'ARR'[i+1].

For example:

Given ‘N’ = 4, 
'ARR' = { 4, 3, 2, 1} 
Then a possible array is 3, 4, 1, 2.
Note:
You are supposed to return the array, which is in a zig-zag fashion.

Since there can be multiple answers for a particular array, any of the possible solutions are accepted.

It can be proved. A zig-zag array is always possible for a given array.
Problem approach

Step 1 : Since we have to solve this problem in O(N) time that is single traversal, so we rearrange given array in required order while traversing
Step 2 : Now whenever we are at odd index(0-based indexing), we check if it's greater than it's left element, if not we swap.
Step 3 : Similarly for every odd and even index we satisfy the given condition using swap operation

Try solving now

2. Sum root to leaf

Easy
10m average time
90% success
0/40
Asked in companies
MicrosoftUnacademyMorgan Stanley

You are given an arbitrary binary tree consisting of N nodes where each node is associated with a certain integer value from 1 to 9. Consider each root to leaf path as a number.

For example:

       1
      /  \
     2    3

The root to leaf path 1->2 represents the number 12.
The root to leaf path 1->3 represents the number 13.

Your task is to find the total sum of all the possible root to leaf paths.

In the above example,

The total sum of all the possible root to leaf paths is 12+13 = 25
Note:
The output may be very large, return the answer after taking modulus with (10^9+7).
Problem approach

Step 1 : We call a function with arguments as node and integer 0. Here integer 0 represents number till node N(From root to given node)
Step 2 : If node=NULL, we return 0, else we update value as value*10+node->value
Step 3 : If given node is leaf node, we return value else we call same function for left and right child

Try solving now
02
Round
Easy
Video Call
Duration120 minutes
Interview date11 Aug 2021
Coding problem2

Round held at 4pm. There were 2 interviewers

1. Reverse List In K Groups

Hard
15m average time
85% success
0/120
Asked in companies
SAP LabsSamsungIBM

You are given a linked list of 'n' nodes and an integer 'k', where 'k' is less than or equal to 'n'.


Your task is to reverse the order of each group of 'k' consecutive nodes, if 'n' is not divisible by 'k', then the last group of nodes should remain unchanged.


For example, if the linked list is 1->2->3->4->5, and 'k' is 3, we have to reverse the first three elements, and leave the last two elements unchanged. Thus, the final linked list being 3->2->1->4->5.


Implement a function that performs this reversal, and returns the head of the modified linked list.


Example:
Input: 'list' = [1, 2, 3, 4], 'k' = 2

Output: 2 1 4 3

Explanation:
We have to reverse the given list 'k' at a time, which is 2 in this case. So we reverse the first 2 elements then the next 2 elements, giving us 2->1->4->3.


Note:
All the node values will be distinct.


Problem approach

Step 1 : We first traverse till kth node, keep track of next node and call function to reverse the first k nodes
Step 2 : For reversing we use 3 pointers to reverse the linkedlist

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 we find all the nodes which are below the given node and at a distance k. This is easy to implement because as we go 1 node down we decrement k and if k==0, we print that nodes
Step 2 : To find nodes which are not in subtree of given node, we find distance of all it's ancestors from given node, let it be x, now we go to other subtree(if present) for that ancestor and search for nodes at distance k-x by using Step 1 approach

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 - Intern
6 rounds | 14 problems
Interviewed by Josh Technology Group
5585 views
0 comments
0 upvotes
company logo
SDE - Intern
5 rounds | 6 problems
Interviewed by Josh Technology Group
3264 views
0 comments
0 upvotes
company logo
SDE - Intern
7 rounds | 7 problems
Interviewed by Josh Technology Group
1138 views
0 comments
0 upvotes
company logo
SDE - Intern
6 rounds | 16 problems
Interviewed by Josh Technology Group
4082 views
3 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Arcesium
3739 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