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

Senior Software Engineer

UST Global
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, Algorithms, System Design, DBMS, OOPS
Tip
Tip

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.

Application process
Where: Referral
Eligibility: Above 2 years of experience
Resume Tip
Resume tip

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.

Interview rounds

01
Round
Medium
Video Call
Duration60 minutes
Interview date27 Oct 2021
Coding problem2

Standard Data Structures and Algorithms round. One has to be fairly comfortable in solving algorithmic problems to pass this round with ease.

1. Print all pairs with given sum

Easy
10m average time
90% success
0/40
Asked in companies
Chegg Inc.FacebookAmazon

You are given an array of integers 'ARR' of length 'N' and an integer Target. Your task is to return all pairs of elements such that they add up to Target.

Note:

We cannot use the element at a given index twice.

Follow Up:

Try to do this problem in O(N) time complexity. 
Problem approach

Naive Solution :

A simple solution is to traverse each element and check if there’s another number in the array which can be added to it to give sum.

TC: O(n^2)
SC: O(1)


Efficient Solution (Using Hashing ) :

We create an empty hash table. Now we traverse through the array and check for pairs in the hash table. If a matching element is found, we print the pair number of times equal to the number of occurrences of the matching element.

TC: O(k+n) where k is the count of pairs with given sum
SC: O(n)

Try solving now

2. Sorted Array to Balanced BST

Easy
15m average time
85% success
0/40
Asked in companies
WalmartAngel One WealthUST Global

You have been given a sorted array of length ‘N’. You need to construct a balanced binary search tree from the array. If there can be more than one possible tree, then you can return any.

Note:

1. A balanced binary tree is a binary tree structure in which the left and right subtrees of every node differ in height by no more than 1.

2. A binary search tree is a binary tree data structure, with the following properties
    a. The left subtree of any node contains nodes with value less than the node’s value.
    b. The right subtree of any node contains nodes with values equal to or greater than the node’s value.
    c. Right, and left subtrees are also binary search trees.

Example:

Below tree, is a balanced binary search tree

1

Below tree is not a balanced tree as the height of the left subtree and right subtree of node ‘5’ differs by more than 1. Moreover, the tree is also not a BST as node ‘2’ is less than node ‘3’ but ‘2’ is the right child of ‘3’.

1

Problem approach

Algorithm :

1) Create a recursive function (say TreeNode*build(arr,start,end) ) which returns the root of the newly cretaed BST . The parameters of this function will be the sorted array , left end of the array , right end of the array .

2) Now, find the mid element of the array and make it as the root i.e., TreeNode*root=new TreeNode(arr[mid]); where mid=(start+end)/2

3) Call the build function again for the left half of the array and store the result in root->left . i.e. , root->left=func(arr,start,mid-1);

4) Similarly , call the build function for the right half of the array and store the result in root->right . i.e. , root->right=func(arr,mid+1,end);

5) Finally , return root .

Note : Base Case for this function would be , if start > end then we need to return NULL .

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date27 Oct 2021
Coding problem2

Again a DSA specific round, where I was given two problems to solve ranging from Medium to Hard. Major topics discussed were Binary Trees and Dynamic Programming.

1. Top view of Binary Tree

Moderate
25m average time
70% success
0/80
Asked in companies
MicrosoftThought WorksSamsung R&D Institute

You are given a Binary Tree of 'n' nodes.


The Top view of the binary tree is the set of nodes visible when we see the tree from the top.


Find the top view of the given binary tree, from left to right.


Example :
Input: Let the binary tree be:

Example

Output: [10, 4, 2, 1, 3, 6]

Explanation: Consider the vertical lines in the figure. The top view contains the topmost node from each vertical line.
Problem approach

The approach is to use the preorder traversal of the tree to traverse the tree and check that we have visited the current vertical level and if visited then we can check for the smaller horizontal level node and store it. Else we can just update the vertical level as visited and store the node and horizontal level of the current node.

1) We have to create the map to check whether the horizontal level is visited or not as it will state the horizontal distance of the node from the root node. Where key will represent the horizontal distance and the value is the pair containing the value and level of each node.

2) We will traverse the tree using the preorder traversal.

3) Every time we check if the level of the current horizontal distance is less than the max level seen till now then we will update the value and the level for this horizontal distance.

4) We will pass level-1 for the left child and level+1 for the right child to get the vertical level.

5) Print the values present in the map.

Try solving now

2. Minimum number of jumps to reach end

Moderate
15m average time
85% success
0/80
Asked in companies
ZSOLX GroupDisney + Hotstar

You have been given an array 'ARR' of ‘N’ integers. You have to return the minimum number of jumps needed to reach the last index of the array i.e ‘N - 1’.


From index ‘i’, we can jump to an index ‘i + k’ such that 1<= ‘k’ <= ARR[i] .


'ARR[i]' represents the maximum distance you can jump from the current index.


If it is not possible to reach the last index, return -1.


Note:
Consider 0-based indexing.
Example:
Consider the array 1, 2, 3, 4, 5, 6 
We can Jump from index 0 to index 1
Then we jump from index 1 to index 2
Then finally make a jump of 3 to reach index N-1

There is also another path where
We can Jump from index 0 to index 1
Then we jump from index 1 to index 3
Then finally make a jump of 2 to reach index N-1

So multiple paths may exist but we need to return the minimum number of jumps in a path to end which here is 3.
Problem approach

Approach 1 : Dynamic Programming - Tabulation

We can solve this iteratively as well. For this, we start from the last index. We need 0 jumps from nums[n-1] to reach the end. We store this as dp[n - 1] = 0 and then iteratively solve this for each previous index till the 0th index. Here dp[i] denotes minimum jumps required from current index to reach till the end.

1) For each index, we explore all the possible jump sizes available with us.

2) The minimum jumps required to reach the end from the current index would be - min(dp[jumpLen]), where 1 <= jumpLen <= nums[currentPostion]


TC : O(n^2)
SC : O(n)


Approach 2 : Most optimal - Greedy-BFS

We can iterate over all indices maintaining the furthest reachable position from current index - maxReachable and currently furthest reached position - lastJumpedPos. Everytime we will try to update lastJumpedPos to furthest possible reachable index - maxReachable.

Updating the lastJumpedPos separately from maxReachable allows us to maintain track of minimum jumps required. Each time lastJumpedPos is updated, jumps will also be updated and store the minimum jumps required to reach lastJumpedPos (On the contrary, updating jumps with maxReachable won't give the optimal (minimum possible)
value of jumps required).

We will just return it as soon as lastJumpedPos reaches(or exceeds) last index.


TC : O(n)
SC : O(1)

Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date27 Oct 2021
Coding problem2

This round majorly focused on past projects and experiences from my Resume and some standard System Design + LLD questions + some basic OS questions.

1. System Design Question

Design a URL Shortener

Problem approach

Tip 1: Firstly, remember that the system design round is extremely open-ended and there’s no such thing as a standard answer. Even for the same question, you’ll have a totally different discussion with different interviewers.

Tip 2: Before you jump into the solution always clarify all the assumptions you’re making at the beginning of the interview. Ask questions to identify the scope of the system. This will clear the initial doubt, and you will get to know what are specific detail the interviewer wants to consider in this service.

Some standard requirements for this problem would be :

1) Given a long URL, the service should generate a shorter and unique alias of it.

2) When the user hits a short link, the service should redirect to the original link.

3) Links will expire after a standard default time span.

4) The system should be highly available. This is really important to consider because if the service goes down, all the URL redirection will start failing.

5) URL redirection should happen in real-time with minimal latency.

6) Shortened links should not be predictable.


Tip 3: Now knowing about the requirements, note down all the important factors to take into consideration while solving this problem . Most common factors include :
1) Traffic
2) URL Length
3) Data Capacity Modeling
4) URL Shortening Logic (Encoding basically) - Standard Hashing Techniques like Base62 , MD5 should be known
5) Choice of Database - SQL vs NoSQL


Finally, for acing System Design Rounds I would suggest watching Gaurav Sen's System Design Videos on YouTube and for hands on practice there is a Guided Path solely for System Design on CodeStudio which is very useful while preparing for these type of rounds.

2. Operating System Question

Print 1 to 100 using more than two threads(optimized approach).

Problem approach

Prerequisite to solve this problem : Multithreading

The idea is to create two threads and print even numbers with one thread and odd numbers with another thread.

Below are the steps :

1) Create two threads T1 and T2 , where T1 and T2 are used to print odd and even numbers respectively.

2) Maintain a global counter variable and start both threads.

3) If the counter is even in the Thread T1, then wait for thread T2 to print that even number. Otherwise, print that odd number, increment the counter and notify to Thread T2 .

4) If the counter is odd in the Thread T2, then wait for the thread T1 to print that even number. Otherwise, print that even number, increment the counter and notify the Thread T1.

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
Senior Software Engineer
3 rounds | 15 problems
Interviewed by UST Global
2174 views
0 comments
0 upvotes
Senior Software Engineer
3 rounds | 14 problems
Interviewed by UST Global
3056 views
0 comments
0 upvotes
Selenium Automation Tester
3 rounds | 18 problems
Interviewed by UST Global
2980 views
0 comments
0 upvotes
Senior Systems Engineer
3 rounds | 23 problems
Interviewed by UST Global
1617 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Senior Software Engineer
1 rounds | 6 problems
Interviewed by Arcesium
3734 views
0 comments
0 upvotes
company logo
Senior Software Engineer
3 rounds | 3 problems
Interviewed by Ernst & Young (EY)
4984 views
0 comments
0 upvotes
company logo
Senior Software Engineer
3 rounds | 3 problems
Interviewed by HCL Technologies
3013 views
3 comments
0 upvotes