OLX
HDFC Bank Interview Questions and Answers
Q1. Design a database schema for a chat application where user can send message to an individual or in group
Design a database schema for a chat application with individual and group messaging.
Create a 'users' table with unique user IDs
Create a 'messages' table with message IDs, sender and receiver IDs, message content, and timestamp
Create a 'groups' table with unique group IDs and group names
Create a 'group_members' table with group ID and user ID to track group membership
Use foreign keys to link tables together
Consider indexing frequently queried columns for performance
Q2. Write sql to retrieve all unread messages when user sign in
SQL query to retrieve all unread messages upon user sign in
Use a JOIN statement to combine the messages and user tables
Filter the results to only show messages that have not been read by the user
Use the user's sign in information to identify which messages are unread
Q3. How much is the web traffic on your site etc
Our website receives an average of 10,000 unique visitors per day.
Our website has a steady flow of traffic with a consistent number of unique visitors per day.
We use Google Analytics to track our web traffic and analyze user behavior.
Our peak traffic times are during weekdays from 9am to 5pm.
We have noticed an increase in mobile traffic over the past year.
Our website's traffic is primarily driven by organic search and social media.
Q4. Array of first n numbers.One number is missing.Find missing number?
To find missing number in an array of first n numbers.
Calculate the sum of first n numbers using formula n*(n+1)/2
Calculate the sum of given array using loop
Subtract the sum of array from sum of first n numbers to get the missing number
Q5. Difference between include_once and require_once?
include_once and require_once are PHP functions used to include files. The difference is in how they handle errors.
include_once will only include the file once, and will not throw a fatal error if the file is not found
require_once will also only include the file once, but will throw a fatal error if the file is not found
Both functions are used to include files that contain functions or variables that are needed in the current script
Q6. sessions vs cookie. Detailed discussion
Sessions and cookies are both used for maintaining user state, but sessions are server-side and cookies are client-side.
Sessions store user data on the server, while cookies store data on the client's browser
Sessions are more secure than cookies because the data is not accessible to the client
Cookies can be used for tracking user behavior and preferences
Sessions are typically used for authentication and authorization purposes
Cookies can be set to expire after a certain amount...read more
Q7. Indexes in mysql
Indexes in MySQL are used to improve query performance by allowing faster data retrieval.
Indexes are created on one or more columns of a table.
They work by creating a separate data structure that allows for faster data retrieval.
Indexes can be created using the CREATE INDEX statement.
Indexes can also be dropped using the DROP INDEX statement.
Indexes can be used to speed up SELECT, UPDATE, and DELETE statements.
Indexes can also be used to enforce uniqueness on a column or set ...read more
More about working at OLX
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month