Tekion
10+ greytHR Interview Questions and Answers
Q1. Can you describe the coding challenge you participated in, including the JavaScript concepts that were tested, such as currying and object flattening?
I participated in a coding challenge that tested JavaScript concepts like currying and object flattening.
The coding challenge involved implementing a function that demonstrates currying in JavaScript.
Another part of the challenge required flattening nested objects using recursion.
I used higher-order functions and closures to achieve currying in the challenge.
The challenge also tested my understanding of object manipulation and traversal in JavaScript.
Q2. DSA round: Find pair of integers equalling a sum k
Use a hashmap to store seen elements and check if complement exists in the hashmap.
Create a hashmap to store seen elements.
Iterate through the array and for each element, check if the complement (k - current element) exists in the hashmap.
If complement exists, return the pair of integers.
Example: For array [2, 7, 11, 15] and sum 9, the pair of integers is (2, 7).
Q3. difference between useMemo vs useCallback
useMemo is used to memoize a value, while useCallback is used to memoize a function.
useMemo is used to optimize expensive calculations by caching the result.
useCallback is used to optimize the rendering of child components by memoizing event handlers.
useMemo returns the cached value, while useCallback returns the memoized function.
Both hooks take a dependency array to determine when to recalculate or re-render.
Q4. DSA round: Find anagrams of a string
Anagrams of a string are words or phrases formed by rearranging the letters of the original string.
Create a hashmap to store the frequency of characters in the input string
Iterate through the array of strings and check if the frequency of characters matches with the input string
Add the strings that are anagrams of the input string to the result array
Q5. Prepare Low level Design machine coding
Low level design machine coding involves writing detailed code for specific functions or algorithms.
Identify the specific functionality or algorithm to be implemented
Break down the functionality into smaller components
Write detailed code for each component, considering efficiency and optimization
Test and debug the code to ensure it works as expected
Q6. Progress bar designing in react
Progress bar in React can be designed using CSS and state management.
Use CSS to style the progress bar
Use state management to update the progress value dynamically
Consider using libraries like react-progress-bar to simplify implementation
Q7. what is useState
useState is a hook in React that allows functional components to manage state.
useState is a built-in hook in React.
It allows functional components to have stateful logic.
useState returns an array with two elements: the current state value and a function to update it.
The initial state value is passed as an argument to useState.
The state value can be of any data type, including objects and arrays.
The update function returned by useState can be called to modify the state value.
C...read more
Q8. how we use useEffect
useEffect is a React Hook used to perform side effects in functional components.
useEffect is used to handle side effects like data fetching, subscriptions, or manually changing the DOM.
It takes two arguments: a function that contains the side effect logic, and an optional array of dependencies.
The function inside useEffect is executed after the component renders and after every update, unless dependencies are specified.
If dependencies are provided, the effect will only be re-...read more
Q9. Design Uber supplier dispatch
Design Uber supplier dispatch
Create a system to match drivers with riders based on location and availability
Use real-time data to optimize dispatching and reduce wait times
Implement a rating system to ensure quality service from drivers
Integrate with payment and mapping systems for seamless user experience
Q10. Easy tree traversal problem
Implement tree traversal algorithm to visit each node in a tree structure
Use depth-first search (DFS) or breadth-first search (BFS) to traverse the tree
DFS can be implemented using recursion or a stack data structure
BFS can be implemented using a queue data structure
Example: Inorder traversal of a binary tree - left, root, right
Q11. Design a in memory database
An in-memory database is a database that primarily relies on main memory for data storage and retrieval.
Utilize data structures like hash tables or trees for fast data access
Implement caching mechanisms to optimize performance
Consider data persistence strategies for durability
Support for transactions and concurrency control
Example: Redis, Memcached
Q12. Design notification Service
Design a notification service for sending alerts to users.
Use a scalable messaging system like Kafka or RabbitMQ to handle high volume of notifications.
Implement a user subscription system to allow users to choose which notifications they want to receive.
Include different channels for notifications such as email, SMS, and push notifications.
Consider implementing a scheduling system to send notifications at specific times.
Ensure notifications are personalized and relevant to e...read more
Q13. Implement LLD of Splitwise
Splitwise is a bill splitting application where users can track and split expenses with friends.
Design classes for User, Expense, Group, and Transaction
Implement functions for adding expenses, settling debts, and generating reports
Consider scalability and data storage options like databases
Handle currency conversions and real-time updates for balances
Q14. Timer in react Js
In React JS, timers can be implemented using setInterval or setTimeout functions.
Use setInterval for recurring timers
Use setTimeout for one-time timers
Remember to clear the timer using clearInterval or clearTimeout when component unmounts
Q15. Path of longest sum
Find the path in a matrix with the longest sum of elements
Start from the top-left corner of the matrix
Move only right or down in the matrix
Keep track of the sum of elements in each path
Return the path with the longest sum
Interview Process at greytHR
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month