Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6833869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:02:10+00:00 2026-05-26T23:02:10+00:00

I was asked this question in a job interview recently. I answered that I

  • 0

I was asked this question in a job interview recently. I answered that I wud use a hash data structure to begin with designing the system. But couldn’t answer that well. I think the interviewer was looking for answers like how will i design a page table for this.

I would like to know how to answer this question. Like for each page size being 4K how many pages would be needed for 1Gb? Also, what other considerations I should keep in my mind to design it efficiently.

  • 1 1 Answer
  • 4 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:02:11+00:00Added an answer on May 26, 2026 at 11:02 pm

    This question makes sense in the context of CPUs where the TLBs are
    “manually” loaded and there are no predetermined page table
    structures, like some models of MIPS, ARM, PowerPC.

    So, some rough thoughts:

    1G is 2^30 bytes or 2^18 = 256K 4K pages

    Say, 4-byte entry per page, that’s 1M for a single level page
    table. Fast, but a bit wasteful on memory.

    What can we do to reduce memory and still make it reasonably fast.

    We need 18 bits per page frame number, cannot squeeze it in 2 bytes,
    but can use 3-bytes per PTE, with 6 bits to spare to encode – access
    rights, presence, COW, etc. That’s 768K.

    Instead of the whole page frame number we can keep only 16-bits of it,
    with the remaining two determined by a 4-entry upper level page table
    with a format like this:

    • 2 MSB of the physical page number
    • 21 bits for second level page table (30 bit address, aligned on 512K
      boundary)
    • spare bits

    No place for per-page bits though, so lets move a few more address
    bits to the upper level table to obtain

    Second level page table entry (4K 2-byte entries = 8K)

    • 4 bits for random flags
    • 12 LSB of the page frame address

    First level page table entry format (64 4-byte entries = 256 bytes):

    • 6 MSB of the page frame address
    • 17 bits for second level page table address (30-bit address aligned
      at 8K)
    • spare bits
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was asked this question recently during my job interview, and I couldn't answer
This is a question that I was asked on a job interview some time
Recently in a job interview I was asked this following question (for Java): Given:
I was asked this question in a job interview, and I'd like to know
This question was asked in the written round of a job interview: #include<alloc.h> #define
This was a question that was asked to my friend in a Google interview
I was asked this question in a job interview. The interviewer and I disagreed
I was asked this question in a .net/C# interview: If we have two threads
Just been asked this question as a true / false in a telephone job
I just recently asked this question: https://stackoverflow.com/questions/6359367/running-a-bash-program-every-day-at-the-same-time The solution of using crontab -e to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.