Bird
Raised Fist0
Testing Fundamentalstesting~20 mins

Performance metrics (response time, throughput) in Testing Fundamentals - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
๐ŸŽ–๏ธ
Performance Metrics Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
๐Ÿง  Conceptual
intermediate
1:30remaining
Understanding Response Time

Which of the following best describes response time in performance testing?

AThe total time taken to complete all requests in a test.
BThe time taken for a system to respond to a single request.
CThe number of requests processed per second.
DThe amount of data transferred during the test.
Attempts:
2 left
๐Ÿ’ก Hint

Think about how long a user waits after making a request.

โ“ Predict Output
intermediate
1:30remaining
Calculating Throughput

Given the following test results, what is the throughput (requests per second)?

total_requests = 500
total_time_seconds = 50
throughput = total_requests / total_time_seconds
print(throughput)
Testing Fundamentals
total_requests = 500
total_time_seconds = 50
throughput = total_requests / total_time_seconds
print(throughput)
A500.0
B0.1
C10.0
D50.0
Attempts:
2 left
๐Ÿ’ก Hint

Divide total requests by total time in seconds.

โ“ assertion
advanced
2:00remaining
Validating Response Time Threshold

Which assertion correctly checks that the response time is less than 2 seconds in a test script?

Testing Fundamentals
response_time = 1.8  # seconds
Aassert response_time < 2
Bassert response_time > 2
Cassert response_time == 2
Dassert response_time >= 2
Attempts:
2 left
๐Ÿ’ก Hint

We want to confirm response time is under the limit.

๐Ÿ”ง Debug
advanced
2:00remaining
Identifying Throughput Calculation Error

Find the error in this throughput calculation code snippet:

total_requests = 1000
total_time_seconds = 0
throughput = total_requests / total_time_seconds
print(throughput)
AThroughput will be zero because total_requests is too high.
BNo error; throughput will print 1000.
CSyntax error due to missing colon.
DDivision by zero error because total_time_seconds is zero.
Attempts:
2 left
๐Ÿ’ก Hint

Check if dividing by zero is possible.

โ“ framework
expert
2:30remaining
Choosing the Best Metric for Load Testing

In a load test simulating 1000 users, which metric best indicates how many requests the system handles per second?

AThroughput
BResponse time
CError rate
DCPU usage
Attempts:
2 left
๐Ÿ’ก Hint

Think about the number of requests processed over time.

Practice

(1/5)
1. What does response time measure in performance testing?
easy
A. The total number of requests per second
B. How fast a single request is completed
C. The amount of data transferred in a request
D. The number of users accessing the system

Solution

  1. Step 1: Understand response time meaning

    Response time measures the duration taken to complete one request from start to finish.
  2. Step 2: Differentiate from throughput

    Throughput measures how many requests happen over time, not the speed of one request.
  3. Final Answer:

    How fast a single request is completed -> Option B
  4. Quick Check:

    Response time = speed of one request [OK]
Hint: Response time = speed of one request [OK]
Common Mistakes:
  • Confusing response time with throughput
  • Thinking response time counts total requests
  • Mixing data size with response time
2. Which of the following is the correct unit commonly used to measure throughput?
easy
A. Milliseconds (ms)
B. Bytes
C. Requests per second (RPS)
D. Percentage (%)

Solution

  1. Step 1: Identify throughput unit

    Throughput measures how many requests are processed per unit time, commonly requests per second (RPS).
  2. Step 2: Exclude other units

    Milliseconds measure time, bytes measure data size, and percentage is not a throughput unit.
  3. Final Answer:

    Requests per second (RPS) -> Option C
  4. Quick Check:

    Throughput = requests per second [OK]
Hint: Throughput counts requests per second [OK]
Common Mistakes:
  • Using time units for throughput
  • Confusing data size with throughput
  • Selecting percentage as throughput unit
3. Given a system that processes 120 requests in 10 seconds, what is the throughput?
medium
A. 10 requests per second
B. 0.12 requests per second
C. 1200 requests per second
D. 12 requests per second

Solution

  1. Step 1: Calculate throughput formula

    Throughput = Total requests / Total time = 120 / 10 seconds.
  2. Step 2: Perform division

    120 divided by 10 equals 12 requests per second.
  3. Final Answer:

    12 requests per second -> Option D
  4. Quick Check:

    120 รท 10 = 12 [OK]
Hint: Divide total requests by total time [OK]
Common Mistakes:
  • Dividing time by requests instead of requests by time
  • Multiplying requests and time
  • Confusing throughput with response time
4. A tester recorded the following response times (in ms): 100, 200, 150, 250. The average response time was incorrectly calculated as 700 ms. What is the correct average response time?
medium
A. 175 ms
B. 700 ms
C. 150 ms
D. 200 ms

Solution

  1. Step 1: Sum all response times

    Add 100 + 200 + 150 + 250 = 700 ms total.
  2. Step 2: Calculate average response time

    Divide total 700 ms by 4 requests = 175 ms average.
  3. Final Answer:

    175 ms -> Option A
  4. Quick Check:

    700 รท 4 = 175 [OK]
Hint: Sum times, then divide by count [OK]
Common Mistakes:
  • Using total sum as average
  • Dividing by wrong number of requests
  • Mixing units in calculation
5. A web server has a throughput of 50 requests per second and an average response time of 200 ms. If the server's throughput doubles but response time remains the same, what happens to the server's capacity and user experience?
hard
A. Capacity doubles; user experience stays consistent
B. Capacity stays same; user experience worsens
C. Capacity doubles; user experience worsens
D. Capacity halves; user experience improves

Solution

  1. Step 1: Understand throughput doubling

    Doubling throughput means the server can handle twice as many requests per second, so capacity doubles.
  2. Step 2: Analyze response time unchanged

    Since response time stays at 200 ms, the speed per request remains consistent, so user experience does not worsen.
  3. Final Answer:

    Capacity doubles; user experience stays consistent -> Option A
  4. Quick Check:

    Throughput โ†‘, response time same = better capacity, same experience [OK]
Hint: More throughput + same response time = better capacity, same experience [OK]
Common Mistakes:
  • Assuming response time worsens with throughput increase
  • Confusing capacity with response time
  • Thinking capacity decreases when throughput increases
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard