0
0
Testing Fundamentalstesting~20 mins

Interview preparation for testers in Testing Fundamentals - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Master Tester Interview Prep
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Test Case Prioritization

Imagine you have 100 test cases but only time to run 20 before a release. Which approach best helps you choose which test cases to run first?

ARun test cases that cover the most critical features and recent bug fixes first.
BRun the first 20 test cases in the order they were written.
CRun test cases randomly to avoid bias.
DRun only the test cases that are easiest to execute.
Attempts:
2 left
💡 Hint

Think about which tests give the most value in finding important bugs quickly.

Predict Output
intermediate
2:00remaining
Test Assertion Outcome

What will be the result of this test assertion in Python?

Testing Fundamentals
def add(a, b):
    return a + b

result = add(2, 3)
assert result == 6, f"Expected 6 but got {result}"
ATest passes silently with no error.
BTypeError because add function arguments are wrong.
CSyntaxError due to incorrect assert syntax.
DAssertionError with message 'Expected 6 but got 5'.
Attempts:
2 left
💡 Hint

Check what the add function returns and what the assertion expects.

locator
advanced
2:00remaining
Choosing the Best Locator for UI Testing

You need to select a locator for a login button on a webpage. Which locator is best for stable and maintainable tests?

ALocate by XPath using absolute path like /html/body/div[2]/button[1].
BLocate by index position among sibling elements.
CLocate by CSS class name that is unique and descriptive, e.g., '.btn-login'.
DLocate by button text which may change, e.g., 'Click Here'.
Attempts:
2 left
💡 Hint

Think about what makes locators less likely to break when the page changes.

🔧 Debug
advanced
2:00remaining
Debugging a Failing Test Case

Given this test code snippet, what is the cause of the failure?

Testing Fundamentals
def divide(a, b):
    return a / b

def test_divide():
    result = divide(10, 0)
    assert result == 0, "Division by zero should return 0"
AThe test code has a syntax error in the assert statement.
BThe divide function raises a ZeroDivisionError instead of returning 0.
CThe assertion expects wrong output; division by zero returns None.
DThe divide function is missing and causes a NameError.
Attempts:
2 left
💡 Hint

Think about what happens in Python when dividing by zero.

framework
expert
2:00remaining
Test Framework Design for Parallel Execution

You want to run tests in parallel to speed up execution. Which framework feature is essential to avoid flaky tests?

ATests are isolated with independent setup and teardown for each test.
BTests share global variables to reduce memory usage.
CTests write logs to the same file without synchronization.
DTests depend on the order of execution to pass.
Attempts:
2 left
💡 Hint

Consider what causes tests to interfere with each other when run at the same time.