Quince
10+ Pratiti Technologies Interview Questions and Answers
Q1. From the given list of strings, find the first k most occurring strings
Find the first k most occurring strings from a given list
Use a hashmap to store the frequency of each string
Sort the hashmap based on frequency in descending order
Return the first k keys from the sorted hashmap
Q2. data base schema design of train booking system
Design a database schema for a train booking system
Create tables for trains, stations, bookings, users, and tickets
Use foreign keys to establish relationships between tables
Include columns for train schedule, seat availability, and user information
Consider implementing indexes for faster query performance
Q3. Find a target element in a sorted array
Binary search algorithm can be used to find a target element in a sorted array.
Implement binary search algorithm to efficiently find the target element in a sorted array.
Compare the target element with the middle element of the array and adjust the search range accordingly.
Continue dividing the search range in half until the target element is found or the search range is empty.
Q4. react hooks explanation
React hooks are functions that let you use state and other React features without writing a class.
React hooks were introduced in React 16.8 to allow functional components to have state and lifecycle methods.
useState() is a hook that allows you to add state to functional components.
useEffect() is a hook that allows you to perform side effects in functional components.
Custom hooks are reusable functions that can contain logic and state.
Hooks should always be used at the top lev...read more
Q5. Detect Cycle in a graph. Remove edge from the graph to make it acyclic
Use Depth First Search (DFS) to detect cycle in a graph. Remove an edge from the cycle to make it acyclic.
Implement Depth First Search (DFS) to detect cycles in the graph
If a back edge is found during DFS traversal, it indicates a cycle in the graph
Remove an edge from the cycle to make the graph acyclic
Q6. Sliding window based question : maximum sum of distinct subarray with length k
Find maximum sum of distinct subarray with length k using sliding window technique.
Use a sliding window of size k to iterate through the array
Keep track of the sum of elements within the window
Maintain a set to keep track of distinct elements in the window
Slide the window by removing the leftmost element and adding the rightmost element
Update the maximum sum as you iterate through the array
Q7. Browser rendering process
Browser rendering process involves multiple steps from parsing HTML to displaying content on the screen.
HTML parsing: Browser parses HTML markup to create the Document Object Model (DOM).
CSS parsing: Stylesheets are parsed to create the CSS Object Model (CSSOM).
Render tree construction: DOM and CSSOM are combined to create the render tree.
Layout: The render tree is laid out to determine the position and size of each element.
Painting: Finally, the browser paints pixels on the ...read more
Q8. Sort array of 0,1,2
Sort an array of strings containing only '0', '1', and '2'.
Use a counting sort algorithm to count the occurrences of '0', '1', and '2'.
Create a new array based on the counts of each element.
Alternatively, use the Dutch National Flag algorithm to sort the array in-place.
Q9. Next greater element
Find the next greater element in an array
Iterate through the array and use a stack to keep track of elements
For each element, pop elements from the stack until finding a greater element
Store the next greater element in a result array
Q10. Dutch national flag algorithm
Dutch national flag algorithm is used to sort an array of 0s, 1s, and 2s in linear time complexity.
Initialize three pointers: low, mid, high
Iterate through the array and swap elements based on their values
Low pointer points to the start of 0s, mid pointer points to the start of 1s, high pointer points to the end of 2s
Interview Process at Pratiti Technologies
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month