Quikr
Prasadam Restaurant Interview Questions and Answers
Q1. If there is a website run by 2 servers. These 2 servers balances the load using Load Balancer.So, if 1 session is created on 1 server and say load is shift to another server immediately, then how session is mai...
read moreSession is maintained through session affinity or sticky sessions.
Session affinity ensures that a user's session is always directed to the same server.
Sticky sessions use cookies to track the user's session and direct them to the same server.
Load balancers can also use IP-based affinity to maintain sessions.
Session persistence can be configured based on time or number of requests.
Without session affinity, users may experience issues with lost data or inconsistent behavior.
Q2. 1. Given a wood of some size. It burns from 1 end to another and takes 30 min. How to burn the same wood in 15 min.?
To burn a wood of some size in 15 min instead of 30 min, split it into two halves and burn them simultaneously.
Split the wood into two halves
Burn both halves simultaneously
Use a larger flame or accelerant to increase the burning rate
Q3. How to implement Critical section in Java and on which variable?
To implement critical section in Java, use synchronized keyword on the shared variable.
Use synchronized keyword to ensure only one thread can access the shared variable at a time.
The shared variable should be the object on which the synchronized keyword is applied.
Example: synchronized(sharedObject) { //critical section code }
Q4. Find missing element in an array of elements from 0 to n-1. Different approaches asked(about 3 to 4 approaches)?
Find missing element in an array of elements from 0 to n-1 using different approaches.
Approach 1: Sum of n natural numbers - sum of array elements
Approach 2: XOR all array elements and XOR with n natural numbers
Approach 3: Binary search for missing element
Approach 4: Using a hash table to store array elements
Q5. Find the first non repetitive character in a string
Find the first non-repeating character in a string.
Create a hash table to store character frequency
Iterate through the string and check frequency in hash table
Return the first character with frequency 1
Q6. What is connection pooling
Connection pooling is a technique of reusing database connections to improve performance.
Connection pooling reduces the overhead of creating and destroying database connections.
It maintains a pool of open connections that can be reused by multiple clients.
It improves application scalability and reduces the chances of database connection errors.
Examples of connection pooling libraries are HikariCP, Apache DBCP, and C3P0.
More about working at Quikr
Top HR Questions asked in Prasadam Restaurant
Interview Process at Prasadam Restaurant
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month