20 nested and combined condition problems, ideal for developing test-case logic flow
20 nested and combined condition problems, ideal for developing test-case logic flow and more realistic SDET automation practice.
-
Check if a password is valid (8-16 chars, at least 1 uppercase, 1 lowercase, 1 digit, no spaces).
-
Validate if an entered date (dd, mm, yyyy) is valid, including leap year check.
-
Check if an email is valid (must not start with special char, must contain '@', domain must be '.com' or '.org').
-
Check user login input: username must be 6-15 letters, password rules apply, and both must not be empty.
-
Determine if an entered time (hh:mm) is valid and whether it’s AM or PM (12-hour format).
-
Check if a triangle is equilateral, isosceles, scalene, or invalid (sum of angles = 180).
-
Validate shipping eligibility: country must be 'US' or 'CA', total amount must be over $50, and item count less than 10.
-
Check if a user qualifies for discount: member status is 'gold' or 'silver', and purchase amount exceeds thresholds.
-
Check if an input string is a palindrome while ignoring case and white spaces.
-
Validate credit card number: must start with '4' (Visa) or '5' (Mastercard), must have 16 digits.
-
Determine if an entered score qualifies: score between 0-100 and grade assigned (A, B, C, D, F).
-
Validate phone number: starts with country code '+1', total length 12, contains only digits after '+'.
-
Check file upload eligibility: size < 5MB, extension allowed, and filename does not contain spaces.
-
Check if two times entered form a valid start-end pair (start < end).
-
Validate booking input: selected date is in the future and time is within working hours (9 AM - 6 PM).
-
Check if entered promo code is valid and not expired (today's date before expiry).
-
Verify user input fields: first name and last name only alphabets, age is a valid integer 0-120.
-
Check if an order qualifies for express shipping (location 'US' and order weight under 10kg).
-
Validate survey input: rating is between 1-5 and comment is not empty if rating < 3.
-
Check if a login attempt should be blocked: wrong attempts > 3 AND last attempt within 5 minutes.
This is the level where test automation scripts start checking combined rules, multiple fields, and nested if-else
flow. It’s also excellent prep for SDET coding rounds or real-world test logic in Selenium/API scripts.
Comments
Post a Comment