Phone screen
Coding round 1
- Evaluate variable expressions using + and -.
I was asked to evaluate variables from a list of expressions. Each expression assigns a variable an integer value or an expression containing other variables. Only addition and subtraction need to be supported.
Example input:
a = b + c
d = d + 5
c = 5
d = 10
The task is to calculate the values of variables that can be resolved and identify those that cannot.
Onsite:
Coding round 1
- Implement a Transactional Key-Value Store
Implement an in-memory key-value store supporting these commands:
- SET key value: assign a value to a key. Overwrite its existing value if present.
- GET key: return the key's current value, or NULL if it does not exist.
- BEGIN: start a transaction.
- COMMIT: permanently save the transaction's changes.
- ROLLBACK: discard the transaction's changes and restore the state before BEGIN.
SET x 10
GET x → 10
BEGIN
SET x 20
SET y 30
GET x → 20
GET y → 30
ROLLBACK
GET x → 10
GET y → NULL
BEGIN
SET x 50
COMMIT
GET x → 50
- Coding round 2
Implement a hash map like unordered_map in C++. Talked about collision handling with chaining. Discussed multithreading, and how this could be converted to a distributed system.
- System design:
Design a simulation / job scheduling platform based on hardware requirements.
- Lead chat (mostly behavioural, from school up to the current date)
Discussion
Loading comments…