0
0
Operating Systemsknowledge~10 mins

Contiguous allocation in Operating Systems - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the sentence to describe contiguous allocation.

Operating Systems
In contiguous allocation, each file occupies [1] block(s) of storage that are next to each other.
Drag options to blanks, or click blank then click option'
Anon-adjacent
Brandom
Cadjacent
Dscattered
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing contiguous with scattered or random allocation.
Thinking files can be stored in non-adjacent blocks in contiguous allocation.
2fill in blank
medium

Complete the sentence to explain a limitation of contiguous allocation.

Operating Systems
A major limitation of contiguous allocation is [1] fragmentation, which makes it hard to find a large enough free space.
Drag options to blanks, or click blank then click option'
Alogical
Bexternal
Cinternal
Dvirtual
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing external fragmentation with internal fragmentation.
Not understanding that fragmentation affects free space layout.
3fill in blank
hard

Fix the error in the statement about file access in contiguous allocation.

Operating Systems
In contiguous allocation, direct access to any block of a file is possible by calculating the block's [1].
Drag options to blanks, or click blank then click option'
Aaddress
Bsize
Cname
Dtype
Attempts:
3 left
💡 Hint
Common Mistakes
Thinking size or name helps locate a block directly.
Assuming only sequential access is possible.
4fill in blank
hard

Fill both blanks to complete the formula for calculating the address of the nth block in contiguous allocation.

Operating Systems
Address of nth block = Starting address [1] (n [2] 1) * block size
Drag options to blanks, or click blank then click option'
A+
B-
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using multiplication or division instead of addition and subtraction in the formula.
Not subtracting 1 from n before multiplying.
5fill in blank
hard

Fill all three blanks to complete the dictionary comprehension that maps file names to their contiguous block ranges.

Operating Systems
file_blocks = { [1]: (start, start + length [2] 1) for [3], (start, length) in files.items() }
Drag options to blanks, or click blank then click option'
Afilename
B-
Cfiles
Dfile
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up variable names in the comprehension.
Using addition instead of subtraction for the block range calculation.