Round 1
Questions: Implement a BufferedFileWriter class.
Write a wrapper class for the file object which allows us to buffer the writes in-memory. The wrapper class, BufferedFile, is initialized with a File class object and a buffer size. It has two methods: write and flush. The data should be flushed to disk when the buffer is full, or on demand with a method called flush. All bytes must be stored in the buffer first before being written to disk. The buffer cannot use more memory than the max bytes allowed.
interface FileOut { // Writes the whole buffer to file int write(char[] buf); }
Follow up: What if the write method is changed to write only given number of bytes e.g. write(char[] buf, int numBytes). You need to make the array you are using as a buffer a circular array. Could not fully implement the followup, but the interviewer agreed with the circular array approach.
Candidate's Approach
Implemented the BufferedFileWriter class with the required methods. Faced challenges with the follow-up question regarding the circular array but discussed the approach with the interviewer.
Interviewer's Feedback
No feedback provided.
Round 2
Questions: Parse query L, Q and show matching q in list of logs. Similar to this Leetcode question.
Pay close attention to handling the case of the text (upper/lower), I missed that in the problem statement and had to spend some time to figure that out.
Input
// livetail_stream = [ // "Q: database", // "Q: Stacktrace", // "Q: loading failed", // "L: Database service started", // "Q: snapshot loading", // "Q: fail", // "L: Started processing events", // "L: Loading main DB snapshot", // "L: Loading snapshot failed no stacktrace available", // ]
Expected Output
// livetail_output = [ // "ACK: database; ID=1", // "ACK: Stacktrace; ID=2", // "ACK: loading failed; ID=3", // "M: Database service started; Q=1", // "ACK: snapshot loading; ID=4", // "ACK: fail; ID=5", // "M: Loading main DB snapshot; Q=4", // "M: Loading snapshot failed no stacktrace available; Q=2,3,4", // ]
Candidate's Approach
Implemented the parsing logic for the queries and logs. Encountered issues with case sensitivity which caused delays in the implementation.
Interviewer's Feedback
No feedback provided.
System Design Round
Questions: Design a mint-like budgeting app, but it only had transactions from credit/debit cards and analytics and notification if transaction goes over a threshold.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Value Based Interview
Questions: Questions on the similar lines to Amazon's leadership principles.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Deep Dive Technical Experience
Questions: Discussion about past projects and your role.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.