Bird
Raised Fist0
DBMS Theoryknowledge~10 mins

Disk structure and access time in DBMS Theory - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to calculate the total access time for a disk operation.

DBMS Theory
total_access_time = seek_time + [1] + transfer_time
Drag options to blanks, or click blank then click option'
Arotational_latency
Bprocessing_delay
Cqueue_time
Dcache_hit_time
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing rotational latency with seek time.
Adding unrelated delays like cache hit time.
2fill in blank
medium

Complete the formula to calculate average rotational latency given the disk's rotation speed in RPM.

DBMS Theory
average_rotational_latency = (60 / [1]) / 2
Drag options to blanks, or click blank then click option'
Atransfer_rate
Bseek_time
Crotation_speed_rpm
Dblock_size
Attempts:
3 left
💡 Hint
Common Mistakes
Using seek time instead of rotation speed.
Forgetting to divide by 2 for average latency.
3fill in blank
hard

Fix the error in the code calculating transfer time for a disk block.

DBMS Theory
transfer_time = block_size / [1]
Drag options to blanks, or click blank then click option'
Arotational_latency
Brotation_speed_rpm
Cseek_time
Dtransfer_rate
Attempts:
3 left
💡 Hint
Common Mistakes
Using rotation speed or seek time instead of transfer rate.
Confusing units of measurement.
4fill in blank
hard

Fill in the blank to create a dictionary comprehension that maps block numbers to their access times if the access time is less than or equal to 10 ms.

DBMS Theory
{block: access_time for block, access_time in disk_access.items() if access_time [1] 10}
Drag options to blanks, or click blank then click option'
A<
B<=
C>=
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using greater than operators which select wrong blocks.
Mixing up the order of comparison operators.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps disk sectors to their sizes only if the sector size is greater than 512 bytes.

DBMS Theory
{ [1]: [2] for [3], size in sector_sizes.items() if size > 512 }
Drag options to blanks, or click blank then click option'
Asector
Bsize
Dblock
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect variable names for keys or values.
Not matching the variable names in the comprehension with the loop.

Practice

(1/5)
1. Which of the following components is NOT part of the disk access time?
easy
A. Seek time
B. Rotational latency
C. Transfer time
D. Cache size

Solution

  1. Step 1: Understand disk access time components

    Disk access time includes seek time (moving the head), rotational latency (waiting for the sector), and transfer time (reading/writing data).
  2. Step 2: Identify the unrelated component

    Cache size is related to memory and buffering, not directly part of disk access time.
  3. Final Answer:

    Cache size -> Option D
  4. Quick Check:

    Disk access time excludes cache size [OK]
Hint: Remember access time parts: seek, rotate, transfer only [OK]
Common Mistakes:
  • Confusing cache size with access time
  • Including CPU time as access time
  • Mixing memory and disk terms
2. Which of the following correctly describes the structure of a disk?
easy
A. A disk is divided into tracks and sectors
B. A disk is divided into blocks and pages
C. A disk is divided into clusters and bytes
D. A disk is divided into frames and segments

Solution

  1. Step 1: Recall disk physical structure

    Disks are physically divided into circular tracks and each track is divided into sectors.
  2. Step 2: Match terms with disk structure

    Blocks, pages, clusters, bytes, frames, and segments are terms used in memory or file systems, not the physical disk layout.
  3. Final Answer:

    A disk is divided into tracks and sectors -> Option A
  4. Quick Check:

    Disk = tracks + sectors [OK]
Hint: Tracks are circles; sectors are slices of those circles [OK]
Common Mistakes:
  • Confusing file system units with disk physical units
  • Mixing memory terms with disk terms
3. If a disk has a seek time of 4 ms, rotational latency of 3 ms, and transfer time of 2 ms, what is the total access time?
medium
A. 6 ms
B. 9 ms
C. 12 ms
D. 7 ms

Solution

  1. Step 1: Add all components of access time

    Total access time = seek time + rotational latency + transfer time = 4 ms + 3 ms + 2 ms.
  2. Step 2: Calculate the sum

    4 + 3 + 2 = 9 ms total access time.
  3. Final Answer:

    9 ms -> Option B
  4. Quick Check:

    4 + 3 + 2 = 9 ms [OK]
Hint: Sum seek, rotate, transfer times for total access [OK]
Common Mistakes:
  • Forgetting to add all three times
  • Mixing units
  • Adding only two components
4. A student calculates disk access time as seek time + transfer time only, ignoring rotational latency. What is the likely effect?
medium
A. The access time will be underestimated
B. The access time will be overestimated
C. The access time will be correct
D. The access time will be zero

Solution

  1. Step 1: Understand the components of access time

    Access time includes seek time, rotational latency, and transfer time. Ignoring rotational latency misses part of the delay.
  2. Step 2: Effect of ignoring rotational latency

    Ignoring rotational latency means the total time is less than actual, so the access time is underestimated.
  3. Final Answer:

    The access time will be underestimated -> Option A
  4. Quick Check:

    Missing rotational latency lowers total time [OK]
Hint: Always include rotational latency in access time [OK]
Common Mistakes:
  • Ignoring rotational latency
  • Assuming transfer time covers all delays
  • Confusing seek time with rotational latency
5. A disk has 5000 tracks and the average seek time is proportional to the square root of the number of tracks. If the average seek time for 2500 tracks is 4 ms, what is the average seek time for 5000 tracks?
hard
A. 4 ms
B. 8 ms
C. 5.66 ms
D. 2.83 ms

Solution

  1. Step 1: Understand the proportionality

    Average seek time ∝ √(number of tracks). Given seek time for 2500 tracks is 4 ms.
  2. Step 2: Calculate seek time for 5000 tracks

    Ratio of seek times = √5000 / √2500 = √2 ≈ 1.414. So, new seek time = 4 ms x 1.414 ≈ 5.66 ms.
  3. Final Answer:

    5.66 ms -> Option C
  4. Quick Check:

    Seek time scales with sqrt(tracks) [OK]
Hint: Use square root ratio to scale seek time [OK]
Common Mistakes:
  • Using linear ratio instead of square root
  • Mixing up track counts
  • Forgetting to multiply by original time