Coinbase | IC5 | HackerRank | Phone Screen Tech Round | Reject
1 hour google hangouts meeting with a senior engineer. I've seen a lot of people mention Karat interviews, but this was not the case for me. I wrote my code over hackerrank and we had webcams over google hangouts
It was the design a file system question here: https://leetcode.com/problems/design-in-memory-file-system/
They didn't ask for an ls but they asked for mkdir, write to file, and read from file.
I mentioned how I always start these kinds of questions by thinking about the data structure and that my mind usually goes to graphs first. Because this is an ordered/dependency type question, a trie makes sense. I built a trie, discussed my thoughts thoroughly about this structure and moved through the exercise pretty quickly, although I think I did a very good job stopping to consider edge cases and slow myself down to double check my reasoning.
Since I did go through this pretty quickly, including successful tests, we had about 25 minutes to talk. He proceeded to ask questions I wasn't too prepared for (lots of system design theoreticals.) I was mostly prepping leetcode stuff and saving a lot of systems design thoughts for the next round. Although his questions were pretty high level, I believe this is where he disqualified me. So here's the follow up questions:
-> "What if we wanted an api for this" was a bit...broad or simple as a high level question. I wasn't too sure how to answer other than we would probably want it restful....post for mkdir....a patch for writing to the file...a get for read file...body for the args... My answer was as broad as the question I guess but he didn't seem upset by that. I asked him if I was being too vague or simplifying it too much and he said no this was fine.
-> "What if we want to host this in the cloud, what would that design start to look like": This was also broad and without much requirements so I just gave him something equally broad "A load balancer like api gateway...host in something like EBS...we probably don't need a DB but if we did there's lots of options there..shouldn't need too much else at this point.
-> "What if there's way more requests than submissions and we were hosting this in the cloud" I said something like a cache for commonly requested file reads might be a good start...he was happy there and didn't ask much more. I started to mention how if we kept in memory then backing the trie with a different structure might be a good idea but a HashMap should absolutely still be fine.
-> He asked what else I would consider using and I did mention maybe a priority queue could be used as a makeshift cache at each Trie Node to be quickly scanned for commonly searched sub-queries. I thought this was clever and he asked me to start coding it but I got a little nervous and started second guessing myself and he said it was fine we should move on and for the sake of time.
-> Next he suggested maybe we could revisit areas that I mentioned I could refactor / reuse code. I suggested a function for finding lowest existing descendent of a query might be really useful, wrote it up. I think it was an acceptable but not great idea (abstracted things a bit just for the sake of removing a bit of redundant code.)...I discussed the tradeoffs there. This area could have been where he disqualified me but I don't know.
-> He then asked if we were going to store the data what a good solution would be....I said there's probably nothing wrong with RDS for this project but I'm sure there's some graph database in aws (Neptune btw, but I have never used it) that I just can't think of, but it's probably more expensive and overkill, but I'm sure it would be an option worth looking into. Still there would be the benefit of more people being familiar with some sql option. I talked broadly about why I thought NoSql options may not scale well (specifically for deep paths it might get messy, and it's just so easy to do in a relational DB.)
I definitely wasn't quite prepared to spend nearly half of our time on related systems design questions. I think he was trying to fill the time but eventually disqualified me based on these system design questions. The prep email they sent me specifically said this would exclusively be a coding aptitude test and the next round would have a heavy emphasis on systems design, so I do feel that I was a bit lead astray. I'm a littttttle salty about this, but I have other good options in motion so I'll shrug it off. Probably should have been prepared for these questions anyway.
Anyway my advice would absolutely be to prepare for this question, and be prepared for a lottttt of follow up system design questions about hosting this in the cloud and many DB questions.
I'd paste my solution but it was nearly identical to any others you can search for in the discussions here.