Freshworks
10+ Shri Priyaji Agro Oils Interview Questions and Answers
Q1. Triplets with Given Sum Problem
Given an array or list ARR
consisting of N
integers, your task is to identify all distinct triplets within the array that sum up to a specified number K
.
Explanation:
A triplet i...read more
Q2. K-th Largest Number in a BST
Given a binary search tree (BST) consisting of integers and containing 'N' nodes, your task is to find and return the K-th largest element in this BST.
If there is no K-th largest e...read more
Q3. Count Ways to Reach the N-th Stair Problem Statement
You are provided with a number of stairs, and initially, you are located at the 0th stair. You need to reach the Nth stair, and you can climb one or two step...read more
Q6. How do you build a tiny URL Application?
A tiny URL application is built by generating short aliases for long URLs, storing them in a database, and redirecting users to the original URL when the alias is accessed.
Generate a unique short alias for each long URL
Store the alias and corresponding long URL in a database
Implement a redirect mechanism to redirect users from the alias to the original URL
Handle edge cases like duplicate URLs, expired aliases, and invalid URLs
Q7. Count pair whose sum is perfect square.
Count pairs in an array whose sum is a perfect square.
Iterate through the array and calculate the sum of each pair.
Check if the sum is a perfect square using a function.
Increment a counter if the sum is a perfect square.
Return the final count of pairs.
Q8. Immediate higher number to right
The immediate higher number to the right of each element in an array
Iterate through the array from right to left
For each element, compare it with the elements to its right to find the immediate higher number
Store the immediate higher number in a new array
Q9. Kth largest number in BST
To find the Kth largest number in a Binary Search Tree (BST), we can perform an in-order traversal and keep track of the Kth largest element.
Perform an in-order traversal of the BST to get the elements in non-decreasing order.
Keep track of the Kth largest element while traversing the BST.
Return the Kth largest element once found.
Q10. Implement debounce function
Debounce function delays the execution of a function until after a specified amount of time has passed since the last time it was invoked.
Create a function that takes a function and a delay time as parameters
Use setTimeout to delay the execution of the function
Use clearTimeout to reset the timer if the function is invoked again within the delay time
More about working at Freshworks
Interview Process at Shri Priyaji Agro Oils
Top Senior Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month