Interview Question






Comment hidden because of low score. Click to expand.
2
of 2 vote

As the "secondary" in the question suggests and it is assumed that it is slower than primary memory it is shown here with example that large page tables can be written to secondary storage and hence has the potential of being slower.

Most often primary memory is referred to as DRAM and secondary memory is the disk with a magnitude higher in access times. When an application has demands on more memory in DRAM operating systems will take some of the unused memory (LRU) and write its contents into disks and then provide that space to the calling application. All of this is done in the context of the memory access request. when the original process who owned the memory tries to access it again then the memory subsystem performs a page fault leading to the handler in reading the contents of memory from secondary storage into primary and then completing the request to application. It maybe noted that this process of page fault does add to the additional latency in accessing memory. The aspect of performance penalty will be observed when the number of page faults are frequent enough that the operating system is constantly in the process of reading and writing contents to secondary storage i.e. a imbalance in system resources due to the application demand on the available resources.

- RS August 03, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

as the name suggests "secondary" in itself implies a relatively slower medium which may involve one or more operations to be able to retrieve the data. Consider the case of DRAM being the primary storage and disk being the secondary storage. In that case if the data structure in DRAM has to be written to disk for freeing up space in DRAM would need to be retrieved from the disk and put in memory before the access request can be fulfilled. This is done through the process of page fault handler and is commonly used to scale DRAM by supplementing it through a backing store on disk. Please note from a performance perspective higher the number of page faults, has a direct impact in terms of latency in your application

- RS August 03, 2016 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More