First Interview
https://leetcode.com/problems/alien-dictionary (premium)
I did not see this question before, knew it is popular interview question. Should have gone through it once.
Second Interview:
I give you a box
What is maximum number of candy you can retrieve?
EXAMPLE
I gave you box A
A = { unlocked, 7 candy, boxes=[B, C], keys=[] }
B = { locked, 5 candy, boxes=[D], keys=[] }
C = { unlocked, 4 candy, boxes=[], keys=[B] }
D = { locked, 100 candy, boxes=[], keys=[] }
I give you box A, what is the maximum # of candy you can retrieve? 16
HINT 1: Think, what are the conditions in which a box is "ready" to be opened?
Did pretty bad in both the interviews. So sad that they expect intern to be as smart as their current software engineers. But, it is good that I realised I am dumb after this interview lol. Solution for 2nd question is appriciated.