โ“ ๐—ฆ๐˜๐—ถ๐—น๐—น ๐˜€๐˜๐—ฟ๐˜‚๐—ด๐—ด๐—น๐—ถ๐—ป๐—ด ๐˜„๐—ถ๐˜๐—ต ๐—๐—ฎ๐˜ƒ๐—ฎ ๐—ฐ๐—ผ๐—ฑ๐—ถ๐—ป๐—ด ๐—ฟ๐—ผ๐˜‚๐—ป๐—ฑ๐˜€?

โ“ ๐—ฆ๐˜๐—ถ๐—น๐—น ๐˜€๐˜๐—ฟ๐˜‚๐—ด๐—ด๐—น๐—ถ๐—ป๐—ด ๐˜„๐—ถ๐˜๐—ต ๐—๐—ฎ๐˜ƒ๐—ฎ ๐—ฐ๐—ผ๐—ฑ๐—ถ๐—ป๐—ด ๐—ฟ๐—ผ๐˜‚๐—ป๐—ฑ๐˜€?

The issue isnโ€™t your logicโ€”itโ€™s the lack of pattern recognition. As an SDET, knowing when to apply which pattern is the game-changer.

โ“ ๐—ฆ๐˜๐—ถ๐—น๐—น ๐˜€๐˜๐—ฟ๐˜‚๐—ด๐—ด๐—น๐—ถ๐—ป๐—ด ๐˜„๐—ถ๐˜๐—ต ๐—๐—ฎ๐˜ƒ๐—ฎ ๐—ฐ๐—ผ๐—ฑ๐—ถ๐—ป๐—ด ๐—ฟ๐—ผ๐˜‚๐—ป๐—ฑ๐˜€?

The issue isnโ€™t your logicโ€”itโ€™s the lack of pattern recognition. As an SDET, knowing when to apply which pattern is the game-changer.

๐Ÿ‘‰ ๐—–๐—ผ๐—น๐—น๐—ฒ๐—ฐ๐˜๐—ถ๐—ผ๐—ป๐˜€ & ๐— ๐—ฎ๐—ฝ๐˜€ โ€“ ๐—ง๐—ต๐—ฒ ๐—–๐—ผ๐—ฟ๐—ฒ ๐—ผ๐—ณ ๐—”๐˜‚๐˜๐—ผ๐—บ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐——๐—ฎ๐˜๐—ฎ ๐—›๐—ฎ๐—ป๐—ฑ๐—น๐—ถ๐—ป๐—ด

When to use: Working with test data, mapping request/response pairs, or storing UI elements.

Example:

Map locators = new HashMap<>();

locators.put("loginBtn", "//button[text()='Login']");

Coding Problem Example:

Count frequency of characters or words โ†’ Use HashMap.

๐Ÿ‘‰ ๐—ง๐˜„๐—ผ ๐—ฃ๐—ผ๐—ถ๐—ป๐˜๐—ฒ๐—ฟ๐˜€ โ€“ ๐—™๐—ผ๐—ฟ ๐—ฆ๐˜๐—ฟ๐—ถ๐—ป๐—ด๐˜€, ๐—”๐—ฟ๐—ฟ๐—ฎ๐˜†s

When to use: Useful in validations like palindromes, comparing logs, or merging sorted logs.

Example:

int i = 0, j = arr.length - 1;

while (i < j) {

  if (arr[i] != arr[j]) return false;

  i++; j--;

}

Coding Problem Example:

Is string a palindrome? Find pairs with given sum.

๐Ÿ‘‰ ๐—ฆ๐—น๐—ถ๐—ฑ๐—ถ๐—ป๐—ด ๐—ช๐—ถ๐—ป๐—ฑ๐—ผ๐˜„ โ€“ ๐—™๐—ผ๐—ฟ ๐—ฆ๐˜‚๐—ฏ๐˜€๐˜๐—ฟ๐—ถ๐—ป๐—ด๐˜€ ๐—ฎ๐—ป๐—ฑ ๐—ฃ๐—ฒ๐—ฟ๐—ณ๐—ผ๐—ฟ๐—บ๐—ฎ๐—ป๐—ฐ๐—ฒ ๐—ช๐—ถ๐—ป๐—ฑ๐—ผ๐˜„๐˜€

When to use: Identify performance drops, memory leaks, or longest continuous pass/fail patterns in logs.

Example:

Find the longest substring with no repeating characters.

๐Ÿ‘‰ ๐—ฆ๐˜๐—ฟ๐—ถ๐—ป๐—ด ๐— ๐—ฎ๐—ป๐—ถ๐—ฝ๐˜‚๐—น๐—ฎ๐˜๐—ถ๐—ผ๐—ป โ€“ ๐—™๐—ผ๐—ฟ ๐—–๐—น๐—ฒ๐—ฎ๐—ป๐˜‚๐—ฝ๐˜€, ๐—ฃ๐—ฎ๐—ฟ๐˜€๐—ถ๐—ป๐—ด, ๐—ฎ๐—ป๐—ฑ ๐—™๐—ผ๐—ฟ๐—บ๐—ฎ๐˜๐˜๐—ถ๐—ป๐—ด

When to use:When cleaning API responses, generating dynamic test data, or parsing HTML/XML/text logs.

Example:

String response = "status=200&message=Success";

String[] parts = response.split("&");

for (String part : parts) {

  String[] keyValue = part.split("=");

  System.out.println(keyValue[0] + ": " + keyValue[1]);

}

Coding Problem Example:

Reverse a string, remove duplicates, extract digits from test input, etc.

๐Ÿ‘‰ ๐—ง๐—ฟ๐˜†-๐—–๐—ฎ๐˜๐—ฐ๐—ต โ€“ ๐—™๐—ผ๐—ฟ ๐—ฆ๐—ฎ๐—ณ๐—ฒ ๐—”๐˜‚๐˜๐—ผ๐—บ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—–๐—ผ๐—ฑ๐—ฒ

When to use:Handling exceptions during test execution, parsing, or when dealing with unstable inputs like API responses, browser states, or external systems.

Example:

Handle potential exceptions during array access or parsing

try {

  int result = Integer.parseInt("123a"); // Will throw NumberFormatException

  System.out.println("Parsed number: " + result);

} catch (NumberFormatException e) {

  System.err.println("Invalid number format: " + e.getMessage());

}

๐Ÿ‘‰ ๐—ฅ๐—ฒ๐—ด๐—ฒ๐˜… & ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป ๐— ๐—ฎ๐˜๐—ฐ๐—ต๐—ถ๐—ป๐—ด โ€“ ๐—™๐—ผ๐—ฟ ๐—Ÿ๐—ผ๐—ด ๐—™๐—ถ๐—น๐—ฒ ๐—ฉ๐—ฎ๐—น๐—ถ๐—ฑ๐—ฎ๐˜๐—ถ๐—ผ๐—ป

Extract timestamps, validate test output format, match dynamic URLs.

Example:

Pattern p = Pattern.compile("Error: (\\d+)");

Matcher m = p.matcher(logLine);

if (m.find()) Sysout("Error Code: " + m.group(1));

-x-x-x-

๐Ÿ“Œ Watch Mock Interviews here: http://youtube.com/@automatewithsidharth 

#sidpost #qa #sdet #career #automation