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

Software Engineer

HackerEarth
upvote
share-icon
2 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
I Had some coding knowledge when i Joined college. Then was not working that till my 2 year but after 2 year i worked a lot on my coding skills. I Got an many offers and finally decided to join cisco as an intern in my 4 year after that got a PPO and have started working full time there.
Application story
There was an off campus opening for hackerearth, i applied on via the career's website and got the test link, cleared it and got a call for interviews
Why selected/rejected for the role?
Rejected, interviews went well but not sure why didn't got a call for next round maybe they found better candidates.
Preparation
Duration: 4 Months
Topics: Data Structures, Algorithms, DBMS, OOPS, Operating System
Tip
Tip

Tip 1 : Must do Previously asked Interviews as well as Online Test Questions.
Tip 2 : Must have good knowledge of DSA
Tip 3 : Do at least 2 good projects and you must know every bit of them.

Application process
Where: Other
Eligibility: No criteria
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
Online Coding Test
Duration90 Minutes
Interview date13 Jun 2022
Coding problem3

This round had 3 DSA problems ranging from medium to hard level

1. Decreasing Subsequences

Moderate
0/80
Asked in companies
IBMPegasystemsGoogle inc

Ninja is fond of sequences. He has a set of numbers and wants to make minimum decreasing subsequences such that all numbers are part of exactly one subsequence. Can you help Ninja with this challenge?

You are given an array ‘ARR’ having ‘N’ elements.Your task is to divide all ‘N’ elements of the array into a minimum number of strictly decreasing subsequences. Each number can be in one subsequence only. Find the minimum number of such strictly decreasing subsequences.

For Example
If 'ARR' is [4,2,1,3] ,it can be splitted into two subsequences as [4,2,1] , [3] or [4,3],[2,1].  
Try solving now

2. Maximum Product Subarray

Moderate
25m average time
75% success
0/80
Asked in companies
InnovaccerAmazonMicrosoft

You are given an array “arr'' of integers. Your task is to find the contiguous subarray within the array which has the largest product of its elements. You have to report this maximum product.

An array c is a subarray of array d if c can be obtained from d by deletion of several elements from the beginning and several elements from the end.

For e.g.- The non-empty subarrays of an array [1,2,3] will be- [1],[2],[3],[1,2],[2,3],[1,2,3]. 
For Example:
If arr = {-3,4,5}.
All the possible non-empty contiguous subarrays of “arr” are {-3}, {4}, {5}, {-3,4}, {4,5} and {-3,4,5}.
The product of these subarrays are -3, 4, 5, -12, 20 and -60 respectively.
The maximum product is 20. Hence, the answer is 20.
Follow Up:
Can you solve this in linear time and constant space complexity?
Try solving now

3. Minimum insertions to make a string palindrome

Moderate
30m average time
70% success
0/80
Asked in companies
FacebookAppleSamsung

A palindrome string is one that reads the same backward as well as forward.


You are given a string 'str'.


Find the minimum number of characters needed to insert in 'str' to make it a palindromic string.


Example :
Input: 'str' = "abca"

Output: 1

Explanation:
If we insert the character ‘b’ after ‘c’, we get the string "abcba", which is a palindromic string. Please note that there are also other ways possible.


Try solving now
02
Round
Easy
Video Call
Duration60 Minutes
Interview date17 Jun 2022
Coding problem2

HR called and asked if I am interested in interview, got the invite and this interviewer asked a lot of questions on projects, past work, and some problems checking Dsa knowledge

1. Reconstruct Itinerary

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

You are given a matrix of flight 'TICKETS', where the 'i'th row represents 'i’th flight ticket. 'TICKETS'[i] = [SOURCE, DESTINATION] represents that there is a one-way flight starting from the city 'SOURCE' and ending at city 'DESTINATION'. All the flight tickets belong to a man who is initially in city "DEL".

You are supposed to reconstruct the journey satisfying the following conditions:

1. He should begin his journey from “DEL”.

2. He should use all the tickets and complete the journey.

3. He must use all the tickets only once.

Note:
1. Journey means the order in which the cities will be visited.

2. The given tickets have at least one itinerary.

3. If multiple valid itineraries are possible, then return the itinerary that is a lexicographically smallest itinerary.
Problem approach

build a map to store each departure location and its destinations array.
sort the destinations array.
now we assume that the departure airport 'JFK' is the root node for this tree, and its destinations are the children. Since the destinations are sorted, the children are arranged alfabetically from left to right. For each destination, if it is also a departure airport, then its children are the related destinations. Hopefully by now you get an idea of the structure of the tree.
run a post order traversal of the tree , as a result, 'JFK' now is the last airport visited, hence the Greedy part.
finally we reverse the result as the return value.

Try solving now

2. K Most Frequent Elements

Moderate
10m average time
85% success
0/80
Asked in companies
WalmartOracleFacebook

You are given an Integer array ‘ARR’ and an Integer ‘K’.


Your task is to find the ‘K’ most frequent elements in ‘ARR’. Return the elements in any order.


For Example:

You are given ‘ARR’ = {1, 2, 2, 3, 3} and ‘K’ = 2. 

The answer will {2, 3} as 2 and 3 are the elements occurring most times.
Problem approach

Count the frequency of each string in the array and store it in a HashMap where the string is the key and frequency as the value.
Now, sort these keys according to their frequencies in ascending order, this is done to keep keys with the least frequencies at the top.
The strings with equal frequencies are prioritized alphabetically, i.e., the string which is alphabetically greater has a higher priority.
Delete the top N – K key-value pairs from the HashMap. By doing this the container is left with K keys with the highest frequencies, in reverse order.
Print the strings stored in the HashMap.

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

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4657 views
0 comments
0 upvotes
company logo
Technical Content Engineer
4 rounds | 6 problems
Interviewed by HackerEarth
1805 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6450 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3452 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Engineer
3 rounds | 7 problems
Interviewed by Optum
7874 views
1 comments
0 upvotes
company logo
Software Engineer
5 rounds | 5 problems
Interviewed by Microsoft
9973 views
1 comments
0 upvotes
company logo
Software Engineer
2 rounds | 4 problems
Interviewed by Amazon
4310 views
1 comments
0 upvotes