
LimeRoad

LimeRoad Interview Questions and Answers
Q1. Word Ladder Problem Statement
Given two strings, BEGIN
and END
, along with an array of strings DICT
, determine the length of the shortest transformation sequence from BEGIN
to END
. Each transformation involves ...read more
The Word Ladder problem involves finding the shortest transformation sequence from one word to another by changing one letter at a time.
Use breadth-first search to find the shortest transformation sequence.
Create a graph where each word is a node and words that can be transformed into each other are connected.
Keep track of visited words to avoid cycles and optimize the search process.
Return -1 if no transformation sequence is possible.
Example: For input 'hit', 'cog', and dict...read more
Q2. Buy and Sell Stock - III Problem Statement
Given an array prices
where the ith element represents the price of a stock on the ith day, your task is to determine the maximum profit that can be achieved at the en...read more
Determine the maximum profit that can be achieved by selling stocks with at most two transactions.
Iterate through the array and calculate the maximum profit that can be achieved by selling stocks at each day.
Keep track of the maximum profit after the first transaction and the maximum profit after the second transaction.
Return the maximum profit that can be achieved overall.
Q3. Group Anagrams Problem Statement
Given an array or list of strings called inputStr
, your task is to return the strings grouped as anagrams. Each group should contain strings that are anagrams of one another.
An...read more
Group anagrams in an array of strings based on their characters.
Iterate through each string in the input array
Sort the characters of each string and use the sorted string as a key in a hashmap to group anagrams
Return the values of the hashmap as the grouped anagrams
Q4. Problem: Ninja's Robot
The Ninja has a robot which navigates an infinite number line starting at position 0 with an initial speed of +1. The robot follows a set of instructions which includes ‘A’ (Accelerate) a...read more
Determine the minimum length of instruction sequence for a robot to reach a given target on an infinite number line.
Start at position 0 with speed +1, update position and speed based on 'A' and 'R' instructions
For each test case, find the shortest sequence of instructions to reach the target
Consider both positive and negative positions for the robot
Return the minimum length of instruction sequence for each test case
Q5. Valid Parentheses Problem Statement
Given a string 'STR' consisting solely of the characters “{”, “}”, “(”, “)”, “[” and “]”, determine if the parentheses are balanced.
Input:
The first line contains an integer...read more
The task is to determine if a given string of parentheses is balanced or not.
Iterate through each character in the string and use a stack to keep track of opening parentheses
If a closing parenthesis is encountered, check if it matches the top of the stack. If not, the string is not balanced
If all parentheses are matched correctly and the stack is empty at the end, the string is balanced
Q6. check the garment made tax report
The garment tax report needs to be checked.
Review the garment tax report for accuracy and completeness.
Ensure that all tax calculations are correct.
Verify that the report includes all necessary information, such as tax rates and applicable exemptions.
Cross-check the report with relevant documentation, such as invoices and receipts.
Identify any discrepancies or errors and take appropriate actions to rectify them.
Q7. Subset sum to k
Given an array of integers, determine if there is a subset that sums up to a given target value.
Use a recursive approach to explore all possible subsets
At each step, either include the current element or exclude it
If the target value is reached, return true
If all elements are exhausted and the target value is not reached, return false
Interview Process at LimeRoad

Top Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

