Final Exam Questions and
Answers Updated 2026
GivenBtheBpageBtableBbelow,BforBeachBPTEB0~7,BmatchBthemBtoBoneBofBtheBfollowing
Bstatus:B-BAnswerBUnallocatedB->BWhereBValidBisB0BandBhasBNull
AllocatedBandBUncachedB->BWhereBvalidBisB0BandBisBinBtheBdisk/BvirtualBmemory
AllocatedBandBCachedB->BWhereBvalidBisB1BandBisBinBtheBdram/BphysicalBmemory
True/False:BPageBtablesBalwaysBmapBvirtualBmemoryBaddressesBtoBphysicalBaddressesBi
nBtheBRAM.B-BAnswerBFalse
AddressBtranslationBinBaBvirtualBmemoryBsystemBreceivesBaB_________BwhichBisBconve
rtedBintoBaBcorrespondingB_________BbeforeBitBisBsentBoffBtoBmainBmemory.B-
BAnswerB1.BVirtualBaddressBconvertedBintoBcorrespondingB2.BphysicalBaddress
True/False:BTheBvirtualBpageBnumberB(VPN)BcorrespondsBtoBanBindexBinBtheBpageBtabl
e.B-BAnswerBTrue
WhatBdoesBaBPageBTableBEntryB(PTE)Bcontain?B-
BAnswerBBothBaBvalidBbitBandBanBaddressBfield
WhatBisBtheBdedicatedBpieceBofBhardwareBthatBimplementsBaddressBtranslationBforBvirt
ualBmemory?B-BAnswerBMemoryBmanagementBunitB(MMU)
True/False:BAB"pageBhit"BmeansBthatBtheBpageBbeingBlookedBupBisBstoredBinBvirtualBm
emory,BasBopposedBtoBphysicalBmemoryB-BAnswerBFalse
,AssumeBaBvirtualBaddressBspaceBwithBcardinalityBNB=B232BandBaBphysicalBaddressBspac
eBwithBcardinalityBMB=B288.BComputeBtheBminimumBnumberBofBbitsBnecessaryBtoBrep
resentBaBPPNB--BthatBis,BaBphysicalBpageBnumberB--
BgivenBaBpageBsizeBofBPB=B1BMiBB=B220Bbytes.B-BAnswerBM(88)-P(20)
68
True/False:BWhenBanBentryBinBaBpageBtableBhasBitsBvalidBbitBsetBtoB"invalid"B(0),BtheB
"address"BfieldBofBthatBentryBmayBreferBtoBanBaddressBonBdiskB-BAnswerBTrue
GivenBtheBpageBtableBbelow,BaBreceivedBvirtualBaddress,BwhichBmapsBtoBPTEBx.BAnswe
rBPageBFaultBifBtheBaddressBcausesBPageBFault.BOtherwise,BAnswerBNone.B-
BAnswerBPageBfaultBifBvalidBbitBisB0
NoneBifBvalidBbitBisB1
WhichBofBtheBfollowingBareBbenefitsBofBusingBvirtualBmemory?B-
BAnswerBItBtreatsBmainBmemoryBasBaBcacheBforBanBaddressBspaceBstoredBonBdisk
ItBprotectsBtheBaddressBspaceBofBeachBprocessBfromBcorruptionBbyBotherBprocesses
ItBusesBmainBmemoryBefficientlyBforBmultitaskingBoperatingBsystem
WhereBpagesBareBareBswappedBinBandBoutBcontinuouslyBdueBtoBaBprogramBusingBmor
eBdataBthanBcanBfitBinBmemoryB-BAnswerBThrashing
WaitingBuntilBaBmissBoccursBinBorderBtoBswapBaBpageB-BAnswerBDemandBPaging
FixedBsizeBblocksBofBbytesBinBvirtualBmemoryBsystemB-BAnswerBPage
MovingBdataBfromBdiskBtoBmainBmemoryB-BAnswerBPagingBin
,AnBorderedBsetBofBnonnegativeBintegersBinBmemoryB-BAnswerBAddressBspace
MovingBdataBfromBmainBmemoryBtoBdiskB-BAnswerBPagingBout
LetBNB=B16,BMB=B64,BandBPB=B4,BwhereBNBisBtheBnumberBofBvirtualBaddresses,BMBis
BtheBnumberBofBphysicalBaddressesBinBmainBmemory,BandBPBisBtheBpageBsizeBinBbytes
.BGivenBtheBtableBbelow,BwhatBisBtheBphysicalBaddressB(inBdecimalBorBbinary)BthatBcor
respondsBtoBvirtualBaddressB0x4?
PageBtable
ValidBbitBPPN
0B11001B
0B10101B
0B10001B
0B01101B-BAnswerB0x4BinBbinaryBisB000100
01BcorrespondsBtoBPageBnumberB(middleBtwoBbits)
00BisBtheBaddressB(rightBtwoBbits)
TrackB1BtoBbeBPPNB10101
ThenBappendBaddressB00BtoBPPNB1
ResultB->B1010100B(84)
intBmain()B{B
printf("A\n");
fork();B
printf("B\n");B
printf("C\n");B
, returnB0;
}
HowBmanyBuniqueBoutputsBcanByouBgetBfromBthisBcode?B-BAnswerB2BUniqueBoutputs
ForkBthenBrunBbutBBBneedsBtoBcomeBbeforeBC
BCBCBorBBBCC
pid1=fork();B
pid2=fork();B
pid3=fork();
ifB(pid2B==B0)B{B
printf("A\n");
}
ifB(pid3B==B0)B{B
printf("B\n");
}
AssumingBallBtheBforksBdoBnotBfail.BIfBweBknowBtheBnumberBofBABthatBisBprintedBout
BisBXBandBtheBnumberBofBBBthatBisBprintedBoutBisBY,Bwhat'sBtheBvalueBofBXB+BY?B-
BAnswerB8BThereBareB4BA'sBandB4BB'sBprinted
ForkB3Btimes:
WhereBsecondBforkBhappensBifBgoingBup,BthenBprintBanBA
WhereBthirdBforkBhappensBifBgoingBup,BthenBprintBaBB
intBmain()B{
pid_tBpid,Bmypid;B
pidB=Bfork();
ifB(pidB==B0)B{