The Agile Zone is brought to you in partnership with DZone Software. Build your own privately managed community, like Stack Overflow, for your team with AnswerHub, a DZone Software product.
Speaking of unfair interview questions, this would be a pretty evil one.
public MemoryMapPager(string file, FlushMode flushMode = FlushMode.Full)
_flushMode = flushMode;
var fileInfo = new FileInfo(file);
if (fileInfo.Exists == false || file.Length == 0)
_allocatedPages = 0;
_allocatedPages = file.Length / PageSize;
_fileStream = fileInfo.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.Read);
Can you see the bug? How would you fix it?
The Agile Zone is brought to you in partnership with DZone Software. Capture, organize, and share your team’s knowledge with AnswerHub, a DZone Software product. Designed for developer teams, by developers.
Published at DZone with permission of
, DZone MVB
Opinions expressed by DZone contributors are their own.