Rubrik | Onsite | System Coding I/O
Anonymous User
2375

A small requesst to you to share your experience and questions as well.
System Coding Question:
Expectation is to write a class which uses below mentioned APIs to implement. I think this has many minor cases to take care of.

int write(void *dataPtr, size_t len);
int read(void *dataPtr, size_t len);
int seek(size_t location);
// To execute C++, please define "int main()"
// Goal: Implement byte based IO over a block based interface.
// Consider a system that supports block based IO. 

// Following APIs are provided by underneath block based Interface to you:


//  int bSeek(size_t blockNum);
//  int bWrite(void *blockPtr);
//  int bRead(void *blockPtr);
//  int bBlockSize();
// Example input:
//   seek(12)  : seeks to x byte
//   write(data1, 15)
//   write(data2, 16)
//   seek(17)
//   read(data3, 2) : read 2 bytes from <seek> into data3
Comments (5)