Google | Online | block driver
Anonymous User
1081

I went through Google interview loop process for potential L5/L6. Strangely my interviewer didnt ask any of the LC.
Question :
Implement block device writer, which take buffer, size and offset. Assume PAGE_SIZE is X. If we are writting partial page, then existing content ' which is not overwritten ' shouldnt be modified.
To write into any page, first page need to be flushed and then only it can be written
API available

page_read(int page_no, char *buffer);
page_write(int page_no, char *buffer, int buf_size)
page_flush(int page_no);

Implement

block_write(const char *buffer,  int offset, int buffer_size); // 
Comments (3)