I had 5 design questions:
Consitant v/s eventual consistancy - bank transactopn/ cell phone /?forgot
Then a picture question with parrallel boxes and find bottleneck in througput. Where can we add more servers
database sharding of documents on some key - whats the problem( i forgot how it was sharded may be userID but answer was uneven distribution of users- all active users on one server)
Question1: I was only able to solve one but complete and passed
given and array of times [numOfpeople, time, enter/exit].
{.[ 12, time1, 1]. -> 12 people entered mall at time1 (third elements tells enter or exit]
[ 5, time2, 0] -> 5 people exit mall at time1 (third elements tells enter or exit]
[ 7, time1, 1]
[ 5, time1, 0]
When what time mall had maximum people.
similar Question when i tried second time -> people clock in and clock out of building
[{ A, time1, clockin}
{B, time2,clockout}
{C, time, clockin}]
print first 3 times of all users when they clockin/clocked out. Taking care of users who has less than 3 enteries.
**Onsite : **
System Design : tinyUrl
Coding same to Karat Question.
Basically 2 List given having related info. search using both lists:
example .
List One. "Code1":"value1"
"Code2":"value2
"Code3": "Value3"
"Code3": "ValueValue4"
List Two: "Customer1": "Code1"
"Customer2": "Code1"
"Customer3": "Code3"
"Customer4": "Customer1"
"Custimer5":"Customer6"
input output
Customer 1 Value1
Customer4. Value1(same as customer 1)
Customer5. null. ( not present in list1)
Customer3. value3 ( decide between value 3 and value value 3 based on date added)
Customer2. value1
Customer6. null