Bird
Raised Fist0
Testing Fundamentalstesting~10 mins

Interview preparation for testers in Testing Fundamentals - Interactive Code Practice

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

Complete the code to print the result of a simple test assertion.

Testing Fundamentals
assert [1] == 5
Drag options to blanks, or click blank then click option'
A2 * 2
B2 + 3
C10 - 6
D3 + 1
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing an expression that does not equal 5 causes assertion failure.
2fill in blank
medium

Complete the code to check if a list contains a specific element.

Testing Fundamentals
assert 'bug' [1] ['bug', 'test', 'fix']
Drag options to blanks, or click blank then click option'
Anot in
B==
Cin
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' compares the whole list, not membership.
3fill in blank
hard

Fix the error in the test function definition.

Testing Fundamentals
def test_example():
    result = 10 / [1]
    assert result == 5
Drag options to blanks, or click blank then click option'
A2
B10
C5
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 causes a ZeroDivisionError.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension filtering even numbers.

Testing Fundamentals
evens = {num: num[1]2 for num in range(1, 6) if num [2] 2 == 0}
Drag options to blanks, or click blank then click option'
A**
B%
C//
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using '//' divides and floors, not squares.
Using '+' adds numbers, not squares.
5fill in blank
hard

Fill all three blanks to create a filtered dictionary with uppercase keys and positive values.

Testing Fundamentals
filtered = [1]: [2] for [3] in data.items() if [2] > 0
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
Ck, v
Ditems
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'items' as a loop variable causes errors.
Mixing keys and values incorrectly.

Practice

(1/5)
1. What is the main purpose of software testing in a project?
easy
A. To write code for new features
B. To find defects and ensure the software works as expected
C. To design the user interface
D. To manage the project timeline

Solution

  1. Step 1: Understand the role of testing

    Testing is done to check if the software behaves correctly and to find any bugs.
  2. Step 2: Compare options with testing goals

    Only To find defects and ensure the software works as expected talks about finding defects and verifying software behavior, which matches testing purpose.
  3. Final Answer:

    To find defects and ensure the software works as expected -> Option B
  4. Quick Check:

    Testing = Find defects + Verify behavior [OK]
Hint: Testing finds bugs and checks software works [OK]
Common Mistakes:
  • Confusing testing with coding
  • Thinking testing manages project tasks
  • Mixing testing with design roles
2. Which of the following is the correct syntax to write a test case title?
easy
A. verify_user_login_with_valid_credentials
B. verify user login with valid credentials
C. VerifyUserLoginWithValidCredentials
D. "Verify user login with valid credentials"

Solution

  1. Step 1: Identify proper test case title format

    Test case titles should be clear, descriptive, and readable, usually in sentence case with quotes.
  2. Step 2: Evaluate options for clarity and format

    "Verify user login with valid credentials" uses clear sentence case with quotes, making it easy to understand. Others are less readable or informal.
  3. Final Answer:

    "Verify user login with valid credentials" -> Option D
  4. Quick Check:

    Clear descriptive title in quotes = "Verify user login with valid credentials" [OK]
Hint: Test case titles are clear sentences in quotes [OK]
Common Mistakes:
  • Using camelCase or snake_case for titles
  • Writing titles without quotes or punctuation
  • Using all lowercase without clarity
3. Consider this test scenario: A login form accepts username and password. Which test case will fail if the password field allows empty input?
Test Case: Verify login with empty password
Steps:
1. Enter valid username
2. Leave password empty
3. Click login
Expected Result: Login should fail with error message
What will be the test execution result?
medium
A. Fail, because login succeeds with empty password
B. Pass, because empty password is allowed
C. Pass, because login fails as expected
D. Fail, because username is invalid

Solution

  1. Step 1: Understand the test case and expected behavior

    The test expects login to fail when password is empty, showing an error.
  2. Step 2: Analyze the actual behavior described

    The password field allows empty input, so login succeeds, which is against expected result.
  3. Final Answer:

    Fail, because login succeeds with empty password -> Option A
  4. Quick Check:

    Expected fail but login succeeds = Fail [OK]
Hint: If actual differs from expected, test fails [OK]
Common Mistakes:
  • Assuming empty password is valid
  • Confusing pass/fail with allowed inputs
  • Ignoring expected error message
4. You wrote this test step: Click the submit button but the test fails because the button is not found. What is the most likely cause?
medium
A. The locator used to find the button is incorrect or outdated
B. The submit button does not exist in the application
C. The test script has syntax errors
D. The test environment is down

Solution

  1. Step 1: Identify the failure reason for 'button not found'

    This usually means the test script cannot locate the button element on the page.
  2. Step 2: Evaluate possible causes

    Incorrect or outdated locator is the most common cause, as UI changes can break locators.
  3. Final Answer:

    The locator used to find the button is incorrect or outdated -> Option A
  4. Quick Check:

    Button not found = Locator issue [OK]
Hint: Check locators first when element not found [OK]
Common Mistakes:
  • Assuming button is missing without checking locator
  • Blaming syntax errors without evidence
  • Ignoring environment status
5. You have a list of test cases with their results:
[{"id":1, "result":"pass"}, {"id":2, "result":"fail"}, {"id":3, "result":"pass"}, {"id":4, "result":"fail"}]
How many test cases must be re-executed after fixing defects?
hard
A. 3
B. 4
C. 2
D. 1

Solution

  1. Step 1: Identify test cases with failed results

    From the list, test cases with id 2 and 4 have result 'fail'.
  2. Step 2: Determine re-execution count

    Only failed test cases need re-execution after defects are fixed, so count is 2.
  3. Final Answer:

    2 -> Option C
  4. Quick Check:

    Failed tests = 2 [OK]
Hint: Re-run only failed test cases after fixes [OK]
Common Mistakes:
  • Counting all test cases instead of only failed
  • Confusing pass with fail
  • Ignoring test case results
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