Tip 1 : Prepare on DSA, practice regularly
Tip 2 : Concentrate on design
Tip 1 : Put in all projects
Tip 2 : Highlight impact



The Number of elements smaller than 4 on its right side is 2.
The Number of elements smaller than 2 on its right side is 1.
The Number of elements smaller than 1 on its right side is 0.
The Number of elements smaller than 5 on its right side is 0.
Hence the count array is [2,1,0,0]
Sample data:
Input 1: arr[] = {12, 1, 2, 3, 0, 11, 4}
Output 1: countSmaller[] = {6, 1, 1, 1, 0, 1, 0}
Input 2: arr[] = {1, 2, 3, 4, 5}
Output 2: countSmaller[] = {0, 0, 0, 0, 0}
Notification Reminder for movie with Customizable time
APIs:
Create
Update
Delete
Read
Webhook
Reminder
Reminder
--------------
id
execution_time
created_time
updated_time
user_id
template_id
ticket_id
Ticket
--------
Template
------------
id
message
created_time
updated_time
User
-------
id
name
...
Logs
-------
timestamp
reminder_id
API:
Create:
{
execution_time: T+5:30,
template_id: “123”
}
Update:
{
id: “12”,
template_id: “1234”,
execution_time: T+5:30
}
Delete:
/ids=123
Read:
reminders/get
Designing a chatbot system
Three actors in the system, platform, business and the end user
Chatbot which is an abstract entity in the platform, query resolution system
End users come and ask queries on the chatbot and the reply is sent
Business to define the queries and the replies specific to the chatbot.
Platforms task is to keep the chatbot running
Set of queries - Stand. Responses -> Configured by business
User management -> business -> can have multiple bots
Audit logs
Query Counter -> Analytics
User
-------
id : (Auto generated)
name: Sting
business_id : PK of Business
Business
------------
id : (Auto generated)
name
Bots
------
id: (Auto generated)
name
business_id : PK of Business
created_by: PK of user
created_time: Epoch time stamp
updated_by: PK of user
updated_time: Epoch time stamp
Query Responses
---------------
id: (Auto generated)
query: Text
response: Text
bot_id: PK of bot
created_by: PK of user
created_time: Epoch time stamp
updated_by: PK of user
updated_time: Epoch time stamp
Counter
-----------
query_id: PK of Query Responses
count: int
API
POST /business
PUT /business
{
id: “123”,
...
}
POST /user
{
business_id: “123”
}
PUT /user
{
id: “456”,
name: “”
...
}
POST /bot
{
business_id: “123”,
name: “bot 1”
}
PUT /bot
{
id: “123”,
name: “bot 1”
}
GET /bot/
{
id: “123”,
name: “bot 1”,
questionarrie: [
{
query: “what is it?”,
response: “this is it”,
created_time: Timestamp+Timezone
created_by: “123” (user id)
}
]
}
DELETE /bot?ids=123
POST /bot/123/query
{
query: “what is it?”,
response: “this is it”
}
PUT /bot/123/questionre
{
questionarrie_id: “890”,
query: “what is it?”,
response: “this is it”
}
GET /bot/123/questionre/890
{
questionarrie_id: “890”,
query: “what is it?”,
response: “this is it”,
created_time: Timestamp+Timezone
created_by: “123” (user id),
modified_time: Timestamp+Timezone
modified_by: “123” (user id),
count: 670 (Number of times it has asked)
}
DELETE /bot/123/questionre?ids=890
User API
GET /bot/123?query=”What is TOM?”
{
response: “TOM is a cat”
}
Elastic search
”What si TOM?” ->
{
”What si TOM?”
}
{
bot: “123”,
“bot.questionre.query”: ”What si TOM?”
}
Redis for counters (qustionre_id->counter)
Multiple Clusters
Elastic search for (Query -> id)
Multiple clusters
Images -> S3 -> CDN
Design
Client -> CDN (Images)
-> Load balancer -> Quering service (Multiple servers) -> RDBMS
-> Bot Conffiguration -> REDIS
-> User management -> Elasticsearch
-> Analytics

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What does HTML stand for?