Ctrl K
QA · Junior · Coding

There's a function is_valid_password: it takes a string and returns true or false. A password is valid if it has 8 to 20 characters, at least one digit, and at least one uppercase Latin letter. You don't have the function's code; write a set of automated tests for it.

~15 min by voice

How to approach it

They're checking black-box test design without access to the code: whether you can identify equivalence classes and boundary values, build negative cases that each break exactly one rule, clarify ambiguous requirements, and write the tests up neatly.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsTell me when you use pairwise testing, and in which cases it can miss a serious defect. SeniorYou're given a business rule for calculating a discount that depends on the order total, the customer's status and a promo code. How would you design tests for it? SeniorIn an online store, the discount depends on three conditions: whether the customer has a loyalty card, whether the order total is over $100, and whether this is their first order. How would you design the tests so that you don't miss a single combination? JuniorAn online store's discount depends on the customer's status, the order total and whether there's a promo code, and the rules overlap in places. How would you design tests for this logic? Mid-levelA checkout form has four payment methods, three delivery methods, five regions, and a "have a promo code" checkbox. Testing every combination exhaustively takes too long. How would you reduce the test set, and what are you risking by doing that? Mid-level

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~15 min