Karat Interview-
5 System Design Questions:
2 You are working on Google Doc like system -
We have e-sign doc system (like docusign/echosign) and we need sign of 100+ people only after that document will be marked as complete. But due to a bug some people did not recieved notifications to sign the doc and those notifications are lost.
We have info - a) Table with records of all compelted docs b)logs from prod servers which are having details of successfully sent notifications only ( no failed ones)
Q- Post bug fix how to identify and send notification again to the failed ones? Consider a system with tens of millions of docs
We have a system pipeline with multiple stages ( components) to process the documents and each component has its own processing capacity, let say we have A,B,C and having processing capacity of 10,20,50 docs then Q- What is the thoughput of system?
Coding Question -
we have a office attendance logs with us and need to find who has violated the flow : entry -> exit -> entry -> exit is the right flow and entry -> entry is the wrong flow and exit -> exit is also wrong flow
find and return the list of names with entry and exit violations
records1 = [
["Arjun", "enter"],
["Riya", "exit"],
["Arjun", "enter"],
["Arjun", "exit"],
["Meera", "exit"],
["Kabir", "enter"],
["Meera", "enter"],
["Amit", "enter"],
["Meera", "exit"],
["Sneha", "enter"],
["Kabir", "enter"],
["Rahul", "exit"],
["Rahul", "enter"],
["Kabir", "exit"],
["Meera", "enter"],
["Meera", "exit"],
["Sneha", "exit"],
["Kabir", "enter"],
["Kabir", "enter"],
["Meera", "exit"],
["Kabir", "exit"],
["Kabir", "exit"]
]
Expected output: ["Amit", "Rahul", "Arjun", "Kabir"], ["Meera", "Riya", "Rahul", "Kabir"]
records2 = [
["Arjun", "enter"],
["Arjun", "exit"],
]
Expected output: [], []
records3 = [
["Arjun", "enter"],
["Arjun", "enter"],
["Arjun", "exit"],
["Arjun", "exit"],
]
Expected output: ["Arjun"], ["Arjun"]