Quality Assurance Interview Questions
Are you preparing for a QA interview? Quality Assurance ensures products ship defect-free across the development lifecycle. These real Quality Assurance interview questions cover test design, automation, API testing and CI workflows.
- 148+Questions
- 83Companies
- 36With video
- 68/70/10 Easy / Med / Hard
Real questions asked at Google, Amazon, EPAM, Twilio, Netflix, Meta and 77+ more.
Click any question to read the full answer, then open it to solve hands-on in a real Quality Assurance environment that boots in your browser. Built by working engineers, no AI.
Selenium (48)
Easy Checkbox State Management Testing
Master checkbox state management testing with Selenium. Learn state verification, dynamic selection, and comprehensive interaction validation.
Open in a real environment →Easy Dropdown Selection Testing
Master dropdown testing with Selenium. Learn option enumeration, selection validation, and dropdown interaction techniques.
Open in a real environment →Easy Basic Element Interaction Testing
Master basic element interaction testing with Selenium. Learn button clicks, element verification, and dynamic content validation.
Open in a real environment →Easy Checkbox State Validation Testing
Master checkbox state validation testing with Selenium. Learn checkbox interactions, state verification, and dynamic testing techniques.
Open in a real environment →Easy Basic Link Navigation Testing
Master basic link navigation testing with Selenium. Learn simple element finding and click validation techniques for beginners.
Open in a real environment →Easy Text Extraction Testing
Master basic text extraction testing with Selenium. Learn simple element finding and text content extraction for beginners.
Open in a real environment →Easy Button Click Testing
Master simple button click testing with Selenium. Learn basic element interaction and click verification for beginners.
Open in a real environment →Easy Form Checkbox Validation and Interaction
Master checkbox interaction automation with Selenium. Learn state management and dynamic element validation testing.
Open in a real environment →Easy Page Title Verification Testing
Master page title verification testing with Selenium. Learn basic title checking and text matching for beginners.
Open in a real environment →Easy Image Attribute Verification
Master image verification testing with Selenium. Learn basic image finding and broken image detection for beginners.
Open in a real environment →Easy Product Search Testing
Master product search testing with Selenium. Learn e-commerce login and search automation for beginners.
Open in a real environment →Easy Element Text Verification Testing
Master element text verification testing with Selenium. Learn basic text checking and content matching for beginners.
Open in a real environment →Easy Link Extraction Testing
Master link extraction testing with Selenium. Learn basic link finding and attribute extraction for beginners.
Open in a real environment →Easy Element Counting Testing
Master element counting testing with Selenium. Learn basic element counting and CSS selector usage for beginners.
Open in a real environment →Easy Element Attribute Checking
Master element attribute checking with Selenium. Learn basic attribute validation and existence testing for beginners.
Open in a real environment →Easy Element Property Checking
Master element property checking with Selenium. Learn basic property validation and existence testing for beginners.
Open in a real environment →Easy Button State Checking
Master button state checking with Selenium. Learn basic button finding and state validation for beginners.
Open in a real environment →Easy Input Field Validation
Master input field validation with Selenium. Learn basic input finding and property checking for beginners.
Open in a real environment →Medium E-commerce Login Automation Testing
Learn how to automate e-commerce login testing using Selenium WebDriver with SauceDemo. Master authentication flow testing, error handling, and user state validation.
Open in a real environment →Medium Web Element Interaction Testing
Master web element interaction testing with Selenium. Learn element selection, state validation, and comprehensive interaction verification with anti-cheat measures.
Open in a real environment →Medium Authentication System Testing
Master HTTP basic authentication testing with Selenium. Learn dynamic credential validation and authentication workflow automation.
Open in a real environment →Medium Interactive Element Selection Testing
Master dropdown selection automation with Selenium. Learn dynamic option testing and UI element interaction validation.
Open in a real environment →Medium Email Form Validation Testing
Master dynamic form validation testing with Selenium. Learn email validation, error detection, and comprehensive form interaction verification.
Open in a real environment →Medium JavaScript Alert Handling Testing
Master JavaScript alert handling with Selenium. Learn prompt interaction, dynamic input processing, and comprehensive alert verification.
Open in a real environment →Medium Dynamic Element Wait Testing
Master dynamic element wait strategies with Selenium. Learn custom timeouts, visibility detection, and timing measurement techniques.
Open in a real environment →Medium Dynamic Table Data Extraction Testing
Master table data extraction with Selenium. Learn row navigation, cell parsing, and comprehensive data validation techniques.
Open in a real environment →Medium Dynamic Form Validation Testing
Master dynamic form validation testing with Selenium. Learn input field validation and real-time form behavior automation.
Open in a real environment →Medium E-Commerce Cart Interaction Testing
Master e-commerce cart testing with Selenium. Learn dynamic cart operations, quantity management, and state validation automation.
Open in a real environment →Medium E-Commerce Login Authentication Testing
Master e-commerce login authentication testing with Selenium. Learn form-based authentication, credential validation, and post-login verification on SauceDemo.
Open in a real environment →Medium Data Table Interaction Testing
Master data table automation testing with Selenium. Learn dynamic row/column selection and table interaction validation techniques.
Open in a real environment →Medium Form Element Validation Testing
Master form element validation testing with Selenium. Learn dynamic input validation and comprehensive field state monitoring techniques.
Open in a real environment →Medium Web Table Row Search and Data Parsing
Master dynamic table data extraction with Selenium. Learn web scraping, table parsing, and automated data validation techniques.
Open in a real environment →Medium Form Authentication Flow Testing
Master login authentication testing with Selenium. Learn form submission automation, credential validation, and authentication flow verification.
Open in a real environment →Medium JavaScript Alert Interaction and Validation
Master JavaScript alert handling with Selenium. Learn to automate alert, confirm, and prompt dialogs with proper wait strategies.
Open in a real environment →Medium Mouse Hover Interaction and Hidden Element Detection
Master mouse hover actions with Selenium ActionChains. Learn to reveal hidden elements, validate visibility changes, and test interactive UI components.
Open in a real environment →Medium Drag and Drop Element Interaction
Master drag and drop automation with Selenium ActionChains. Learn element interaction, position validation, and swap verification testing.
Open in a real environment →Medium Dynamic Element Loading and Wait Strategies
Master dynamic content loading with Selenium explicit waits. Learn WebDriverWait strategies, visibility conditions, and async element handling.
Open in a real environment →Medium AJAX Request Handling and Wait Techniques
Master AJAX request handling with Selenium. Learn WebDriverWait techniques, URL change detection, and dynamic content loading strategies.
Open in a real environment →Medium Form State Validation Testing
Master form state validation testing with Selenium. Learn form interaction and state checking for medium-level automation.
Open in a real environment →Medium Checkbox Interaction Testing
Master checkbox interaction testing with Selenium. Learn checkbox state management and interaction patterns for medium-level automation.
Open in a real environment →Medium Select Option Validation Testing
Master select option validation testing with Selenium. Learn option selection and validation for medium-level automation.
Open in a real environment →Medium Table Data Interaction Testing
Master table data interaction testing with Selenium. Learn table navigation and data extraction for medium-level automation.
Open in a real environment →Medium Page Transition Vaidation Testing
Master page transition validation testing with Selenium. Learn navigation detection and validation for medium-level automation.
Open in a real environment →Hard Multi-Step Form Navigation Testing
Master complex form navigation with Selenium. Learn multi-step handling, dynamic content detection, and state management techniques.
Open in a real environment →Hard File Upload Validation Testing
Master file upload testing with Selenium. Learn temporary file creation, upload validation, and interface property checking techniques.
Open in a real environment →Hard Dynamic Form Validation Testing
Master dynamic form validation testing with Selenium. Learn comprehensive form state monitoring and validation result extraction techniques.
Open in a real environment →Hard Multi-Window Context Switching Testing
Master multi-window testing with Selenium. Learn window handle management, context switching, and data extraction across browser windows.
Open in a real environment →Hard Dynamic Element Interaction Testing
Master dynamic element interaction testing with Selenium. Learn complex timing and wait strategies for hard-level automation.
Open in a real environment →
Git (32)
Easy Rebase Feature Branch onto Correct Base
We have a Git repository on the folder repo that has a feature branch feature login. This feature branch was created from the wrong base branch. It was created from the base branch main while it had to be created from the branch develop. We need to rebase feature login branch from the develop while preserving all the commits. First we need to move to our Git repository and run git log. All, one line and graph are optional fields. Try to rebase our feature login from the develop. For this, we need to either switch or checkout feature login branch. I'll use checkout, but you could use switch as well and we'll rebase this branch. If there'll be conflicts, we can resolve them.
Open in a real environment →Easy Create Branch from Detached HEAD State
We have a Git repository that has detached head. Head is basically our latest commit and detached head means that the head that we are currently located at is not pointing to any Git branch, any points directly to commit or tag. It happens when we check out directly tag or we check out directly at comit hash, or we can check out some remote branch. How we can restore from detached head is we either need to return to some existing branch or we have to create a new branch from that detached head. Run git status. We can see that GIT message that head is detached. We'll create new branch by typing Git Checkout the name of the branch, or you can run more modern command Git Switch. Run checkout minus B. And then name of the branch.
Open in a real environment →Easy View Unique Commits Branch vs Origin
We have a feature branch feature API, and this is our repository folder. We have to provide unique commits and we will need to exclude merge commits, and write unique commits to this text file. Type git branch to see all our branches. View current logs for feature branch. The two dots shows commits in feature API branch, but not in origin main. This reveals only unique work on this particular branch. Next we need to exclude merge commits. We will add another flag. Once we added no merge flag, we get three commits. The final thing is we need to save this output to the file.
Open in a real environment →Easy Remove All Untracked Files and Folders
We have some files that have been created during the time when we worked in this directory, meaning some build outputs, some temporary files and so on. We need to locate all those untracked files and clean them up. First we need to run git status to get all untracked files. Next, we'll run git clean. This is the main command that this question is about. Hyphen n to run this in dry mode. We'll see what is going to be deleted and hyphen d to delete directories as well. It'll remove untracked directories and untracked files. Run git clean fd, which will remove files and directories. Everything now has been cleaned up.
Open in a real environment →Easy Convert Remote from HTTPS to SSH
We need to change our git repository from HTTPS to SSH remote origin. First we'll need to go to this directory, then check current remote configuration git remote -v. Finally, use git remote set-url to configure SSH URL. Additionally, in order to connect to this repository, you need to add your public keys to GitHub. To do this, you can type ssh-keygen, type enter multiple times, check your public key, and you'll need to copy this public key into your GitHub account.
Open in a real environment →Easy Rebase Feature Branch
We have a Git repository. Under this folder we have a feature payment branch and it's behind our main branch by 32 commits. We need to rebase a feature branch onto the latest main. We need to bring all the latest changes from main to this feature branch. Switch to feature payment branch. We need to rebase from main. Type git rebase main. We have conflicts. Some of the commits cannot be rebased. We have two changes for the same line. Remove the obsolete one and keep what we need. And now we can git add and git rebase continue. We've successfully rebased and updated feature payment.
Open in a real environment →Easy Apply Specific Stash from Multiple Stashes
Git stash lets us to save our work in progress, go to some other task, and then return back, restore our stashed work, and continue from that moment on. We can save multiple work in progress jobs, so we can have multiple stashes. We have to navigate to this repository, identify the third stash in the list and restore that. So we need to apply it without removing it from the stack. Run git stash list. This will show us list of the stashed work. Index starts from zero. In order to restore this, git stash apply stash and then two. This will still retain stash number two in the list. In order to remove stash from the list, we need to run command git stash drop and then the name of the stash. Another command to restore stash is git stash pop. Git stash pop applies the latest stash, meaning stash number zero, and then drops it from the list.
Open in a real environment →Easy Rename Branch and Update All References
When we have specific format of the branch names that we have to follow, and if it's not in the specific format, those pushes will be rejected. We have a local branch named feature new feature that violates this naming convention and we need to change this to feature slash new feature. Once it's changed, we have to push those changes into remote repository and we have to delete that repository from the upstream. We need to rename this branch by typing hyphen M, which will move feature new feature to feature slash new feature name. Since our branch is renamed, we need to push this new branch to the remote repository, and while pushing this, we have to create an upstream. Why we create an upstream is to link this local feature slash new feature to the remote feature new feature branch. We'll use git push command with origin, but with hyphen hyphen delete flag, and then the name of the old branch name.
Open in a real environment →Easy Remove Last Commit and Discard Changes
We've committed some local changes that contain incorrect changes and we need to completely erase that from history. Our task is to navigate to this repository, remove last commit entirely. The most important thing here is to discard all associated files changes. First run get log to see all the current commits. We will go a few steps back, and we also need to discard all associated file changes. This means that this is not soft reset, which will reset that, but keep the local changes. So this has to be a hard reset. We have bad commit, wrong changes. It's the last commit and we will reset it. One commit back, run Git, reset hard at one.
Open in a real environment →Easy Shallow Clone Limited to Latest Commit
We need to navigate to the folder workspace and clone into this directory a repository located here named Shallow Rebel, and we need to restrict that to the latest commit only. We don't need to copy entire history, but just latest commit. Cloning only latest commit called shallow clone and command for this would be git clone depth one meaning only last commit, location of the repository and the name of it. Our repository was cloned. Move into it and see the logs. We see only latest log commit 50.
Open in a real environment →Easy Checkout Single File from Another Branch
We have two branches, main and feature settings, and we have a file config json that is located in the feature branch. We need to copy this file into the main branch. We don't need to cherry pick the commit. Cherry pick and copying one single file is different. Cherry picking adds specific commit from another branch to the branch that we are in currently. When we need to copy the file, we need to check out, but we need to check out specific file. GI Checkout, and we type the name of the branch and then Hyen and name of the file that we would like to check out. Now if we run Git status, we'll see this file as modified in our directory.
Open in a real environment →Easy Rebase Branch with Reversed Commit Order
We've got repository and a feature branch and commits are in wrong logical order. What is being asked from us is to reverse the order and also replace this feature branch from Maine. Navigate to repository folder. Check the logs and we've got four commits. We'll need to first Rebase feature branch and then we will need to reverse this order. While doing GIT rebase, we can change order of our commits. We've changed the order. Save this file control O and close it. Control X, we've successfully rebased our branch.
Open in a real environment →Easy Initialize New Git Repository
Bootstrap new projects with Git version control by creating project directories and initializing repositories. Use git init to establish version control infrastructure, verify .git directory creation, and prepare projects for commit and collaboration. Essential for starting new projects, establishing version control foundation, enabling team collaboration, and implementing proper source code management from project inception.
Open in a real environment →Easy Stage File for Commit
We have a repository and have some untracked files. We need to move to the repository and stage that untracked file. So during next commit, this file will be committed. Type git status to see all untracked files. We have one untracked file. Use git add to stage that file. Alternatively, we can use git add . to add all untracked files. Try git status again, and now this file was added.
Open in a real environment →Easy Create Branch from Dev Branch
We have two branches, main and development, and we need to create feature login based on the development branch. First move to this repository. Next we'll check out our development branch. If we type git branch and name of the branch, it'll create new branch from the development branch because we are in development branch. We can type git branch -a to see all created branches and feature login was created. Alternatively, if we're on the main branch and we don't want to switch to different branch, we can type git branch, the name of the branch we would like to create, the name of the branch that we would like to create this one from.
Open in a real environment →Easy Stage Only Specific Files
We have a Git repository on the home repo that has been created already, and we've modified three files, app js, style css, and config json. We need to stage only app js and style css. Staging means that those files will be committed and could be pushed to a remote repository and so on. And we'll leave config unstaged. Move to the repo directory. Use git add to stage files app js and style css. Use git status and we can see that those two files are staged as config json is not staged.
Open in a real environment →Easy Undo Commits but Keep Changes
We have a Git repository where we did some mistake. We need to revert last three commits so we can recommit it more properly. Run Git status to see any uncommitted changes and we have nothing to commit. We need to run Git reset soft head three means we go back. An important part here is this soft. It means that we'll revert back to three commits, but we will keep the local changes intact, meaning they'll be staged. If we reset hard, we will discard local changes as well. We reset everything, local changes and commits. We can see that those files are modified, they're staged, they're not reset.
Open in a real environment →Easy Merge Feature Branch and Delete
We have repository under this directory and we need to merge feature login into the main. View list of our branches by typing git branch hyphen v. The important thing, when we merge, we have to be in the branch to which we are merging. We are merging something in the main, we have to be in the main branch, and while we're in the main branch, we type git merge and the branch that we would like to merge into the main. Lastly, we need to delete the feature branch. For this we'll use git branch D to delete, and the name of the branch that we would like to delete.
Open in a real environment →Easy Write Commit History to File
Document commit history by exporting commits to files for reports, changelogs, and documentation. Use git log --oneline with output redirection to create commit history files, generate reports, and maintain commit records. Essential for documentation, changelog generation, audit trails, project reporting, and maintaining commit history snapshots for reference.
Open in a real environment →Easy Cherry-Pick Specific Commit
We have a git repository and we have a feature branch called feature. This feature branch contains a fix that fixes the bug on main, but we don't want to move all the commits from feature branch to the main. We just want to pick one commit and move only that. That's called cherry picking. We need to navigate to this repository, identify the commit that fixes the main branch and move it to the main from feature. See the git log to identify the commit that fixes the bug on main, so this commit has message fix critical bug. Next, we need to type git cherry pick and hash of this commit. This commit now was added to our main branch.
Open in a real environment →Easy Audit Changes and check CODEOWNERS
We have a Git repository under this folder with a branch main. In this repository we have a code owner's file which defines the owners of this repository who are authorized to make changes. And we have config json file with configurations of the database with a password and other information for the connection. Our task is to check who has modified the database password for this file and if it was modified by someone who is unauthorized, we have to revert this. During that process we have to use default, no edit revert message. Once it's done we have to push the corrected version. We'll type git log P one conviction. We'll check last commit and we can see that modification was done by someone who is not in the code owner's file. We will revert last commit. We will type ahead because it's in the head of the branch. This is a special flag, because otherwise if you try to GI revert, it will offer you to type your own message. Then GI push origin made.
Open in a real environment →Medium Restore File to Previous Version
We have a Git repository where we have a file config gs. This file has been modified in the last two commits, but those two commits introduced a bug. We need to restore config gs to the version that it had two commits ago while not affecting any other file. Run Git log to see last five commits. Next, we'll preview config gs that was two commits ago, for this we'll type git show head meaning our current last commit and then the sign, and then two. Next, we'll type git checkout head tilde sign two and then two hyphens config gs, which will restore config gs that was two commits ago. Last thing, we need to commit our changes with restore config gs message.
Open in a real environment →Medium Create an Annotated Tag
We have Git Repository located on this directory which is completed new version of our application. We need to create an annotated tag, and once it's created, we need to push that to remote repository with this name. First, move to this directory, view current commit. This is our latest commit at head of our branch. A lightweight flag just references some commit. It doesn't have its own SHA hash meaning that cannot reference the tag. Annotated tag, however, has its own SHA, so you can reference that. Verify that tag was created by typing Git Tag. And now push this.
Open in a real environment →Medium Add Git Submodule
Integrate external repositories as submodules to manage dependencies without code duplication. Add submodules with git submodule add, configure .gitmodules file, initialize submodule directories, and commit configuration. Essential for managing shared libraries, vendor dependencies, monorepo structures, and maintaining decoupled version control across interdependent projects.
Open in a real environment →Medium Update Submodule to Latest Commit
We have a repository interview repo that contains a submodule vendor details and submodule lets us nesting repositories. When submodule is used, it uses the specific commit. We need to update a submodule to the latest commit on its default branch. Run git submodule to see our submodule status. Next, run git fetch and then log to see commits in our submodule. We need to pull latest changes. Go to the parent and check status again. Those changes are not committed yet. We run git add and then git commit. Submodule is updated to the latest version.
Open in a real environment →Medium Stash Work, Fix Bug, Restore and Update
Imagine a common scenario when you've been working on some git repository on the feature ui and suddenly you need to do something to fix authentication issue on the main branch. For this, you have to create new hotfix branch, commit changes into that branch and then merge that with main branch. While you've been working on feature ui, you cannot simply change the branch because you have uncommitted changes. Before moving to main branch, we need to stash those changes, meaning to put them aside. Next, move to our main branch and to fix our authentication issue, we first need to create hotfix branch. Move to the main branch and merge our hotfix with main. And finally we delete the hotfix branch since we don't need it anymore. We need to move back to our work that we paused meaning to feature ui, and then rebase it from main. Finally, we need to move back the work that we stashed aside. For that, we need to type git stash pop.
Open in a real environment →Medium Remove File from Entire Git History
We've committed file secrets env, which contains some sensitive credentials and we have to remove this from entire git history. First we'll need to move to the repository directory. Check logs that contains secret env file. For this we'll type git log all to see all logs, one line to see them in one line. In order to filter it by the file name we type hyphen and then name of the file. To see exactly what was changed in those commits we can add hyphen p flag. We need to delete this from our current git history and for this we'll run command called git filter branch. We'll run force flag to change this in entire git history. And we'll use the filter flag that lets us run certain command. And the command is basic Linux syntax rm to remove file. Prune empty flag is used in certain cases that removing this will make the commit useless. Finally, we need to delete the history file, meaning we need to run rm rf to delete everything in the git refs original. In case if we'd like to change also this on the remote origin, we need to run git push force all.
Open in a real environment →Medium Fix Line Endings Showing False Changes
In our Git repository home interview repo, we have file called script sh. This file gets consistently shown as modified when we run git status. The reason for this consistent change is when we run git diff, it shows every line has changed with this symbol, which indicates line ending difference between Windows style systems and Linux style systems. Our task is configure git to handle line endings automatically and fix this issue. To fix this, we need to implement git attributes that will automatically fix the line endings and also enforce this to the sh files. Once this file is applied, we need to renormalize our git repository by running git add hyphen hyphen renormalize and current directory.
Open in a real environment →Medium Merge Repositories Preserving Both Histories
We have two separate git repositories, repo A and repo B, five and four commits respectively. They've been developed independently, so have different histories, and we need to create one monorepo, combine both of them and have full commit history. Important thing is we need to use subtree. Subtree is git subtree command used when we have some shared libraries or other shared resources when we do not want to merge everything into one monorepo, but rather have some repository and reference other repositories in a directory. We'll use git log one line. Create a directory and then initialize git inside this directory. We'll do git init. We'll do our first commit. We'll do empty commit, so we'll need to add a empty flag. Now we will need to integrate our directories as a subtree in our repository. Use git subtree add, and then we use prefix project A. Finally, verify our monorepo. Check it with Git logs.
Open in a real environment →Medium Fix Repository with Unrelated Histories
The repository interview is in broken state. The local and remote branches diverged with no common ancestor, meaning they don't share the same history. When we use Git Push to push things to the remote main, it fails with non fast forward error. And the same happens when we try to pull from Main. Our task is to fix this repository, merge and linearize the unrelated histories using Rebase and create new single commit sequence. When we use Git merge, branch that was merged into the main branch retains the same commit hashes. When we use Rebase, those commit hashes get rewritten. Next we'll pull main and we'll Rebase not merge. The flag that we'll use in this case is allow unrelated histories. We need to resolve this issue. Those three are the main types of the conflicts: modify modify, modify delete, add add. Once this is done, we have to type Git rebase continue.
Open in a real environment →Medium Stash Work, Fix Bug, Resume
Handle urgent work interruptions by stashing incomplete feature work, switching branches cleanly, fixing bugs, and restoring work exactly as it was. Use git stash for temporary storage, switch branches without commits, fix urgent issues, and git stash pop to resume. Essential for interrupt-driven development, urgent hotfixes, emergency bug fixes, and maintaining productivity during context switching.
Open in a real environment →Medium Recover Lost Commits from Detached HEAD
We had Git repository located under this directory and we've been in detached head state. When we switch the main branch, those three commits are now unreachable and we'd like to restore those three commits. When we do git log, we don't see those commits, so we need to find a solution to restore those commits and create a branch called recovered work where those commits will be listed. To see all the logs that we've done to the head of this branch, meaning the ones that were lost from the detached head or while we did git reset and so on, we can type command called git reflog. Git reflog shows us logs exactly for the head. In this git reflog we can see that we have much more than we have in git log. Since our task is to restore this with the branch recovered work, we have to create branch recovered work from some Git commit. We'll use this git commit's hash.
Open in a real environment →
Programming (32)
Easy Contains Duplicate
def contains_duplicate(nums: list[int]) -> bool:
Open in a real environment →
seen = set()
for n in nums:
if n in seen:
return True
seen.add(n)
return FalseEasy Extract Nested Temperature Data from JSON API Response
Fetch JSON data from a weather API endpoint, parse nested forecast structure to extract temperature values, and save results as a JSON list in Python.
Open in a real environment →Easy Fetch and Save Cryptocurrency Price Data from API
Send a GET request to a cryptocurrency API endpoint, retrieve JSON response containing market data, and save the complete response to a file using Python.
Open in a real environment →Easy Count Log Level Occurrences in Application Log File
Parse an application log file to count occurrences of different log levels (DEBUG, INFO, WARN, ERROR) using case-insensitive matching and save results as JSON in Python.
Open in a real environment →Easy Valid Anagram
def is_anagram(s: str, t: str) -> bool:
if len(s) != len(t):
return False
Open in a real environment →countS, countT = {}, {} for i in range(len(s)): countS[s[i]] = countS.get(s[i], 0) + 1 countT[t[i]] = countT.get(t[i], 0) + 1 return countS == countTEasy Extract Email Addresses from Text File Using RegEx
Use Python regular expressions to extract all email addresses from a log file, remove duplicates, and save unique emails to a text file.
Open in a real environment →Easy Validate Phone Numbers Using ReGex
Read phone numbers from a text file, validate each against specific format patterns using Python regex, and output validation results marking each number as valid or invalid.
Open in a real environment →Easy Extract Domain Names from URLs Using RegEx
Parse a list of URLs using Python regex to extract domain names including subdomains, handling various protocols, ports, and URL formats.
Open in a real environment →Easy Remove Leading and Trailing Special Characters from Text
Clean a text dataset by removing various leading and trailing special characters and whitespace from strings using Python string methods.
Open in a real environment →Easy Two Sum
def two_sum(nums: list[int], target: int) -> list[int]:
prev_map = {} # value -> index
Open in a real environment →for i, n in enumerate(nums): diff = target - n if diff in prev_map: return [prev_map[diff], i] prev_map[n] = i return []Easy Deep Merge YAML Configuration Files
Parse and deep merge two YAML configuration files in Python, extract a specific nested section from the merged result, and save it as JSON output.
Open in a real environment →Easy Count User Events from JSON Activity Logs
We will count user events from JSON activity logs. We are given one JSON file that is called activity_logs. JSON stands for JavaScript Object Notation, and it is a text-based format that stores structured data. Our job here is to count how many events each user performed and save the results as a new JSON file. First thing that has to be done is importing the JSON module, which is a built-in Python library for reading and writing JSON files. We will use the open function. It takes two arguments. First is the path to the file, and second is the mode we need. Load will read the entire JSON file and convert it into a Python object. A dictionary in Python is a data structure that stores information as key value pairs. We need to use for loop to go through every log entry. Dump function converts a Python object back to a JSON file. To run the script, we type python3 and path to the file.
Open in a real environment →Easy Valid Palindrome
def is_palindrome(s: str) -> bool:
l, r = 0, len(s) - 1
Open in a real environment →while l < r: if not s[l].isalnum(): l += 1 continue if not s[r].isalnum(): r -= 1 continue if s[l].lower() != s[r].lower(): return False l += 1 r -= 1 return TrueEasy Best Time to Buy and Sell Stock
def max_profit(prices: list[int]) -> int:
l, r = 0, 1
max_p = 0
Open in a real environment →while r < len(prices): if prices[l] < prices[r]: profit = prices[r] - prices[l] max_p = max(max_p, profit) else: l = r r += 1 return max_pEasy Valid Parentheses
def is_valid(s: str) -> bool:
stack = []
close_to_open = {")": "(", "]": "[", "}": "{"}
Open in a real environment →for c in s: if c in close_to_open: if stack and stack[-1] == close_to_open[c]: stack.pop() else: return False else: stack.append(c) return True if not stack else FalseEasy Binary Search
def search(nums: list[int], target: int) -> int:
l, r = 0, len(nums) - 1
Open in a real environment →while l <= r: m = (l + r) // 2 if nums[m] > target: r = m - 1 elif nums[m] < target: l = m + 1 else: return m return -1Easy Scrape Meta Tags from Multiple Web Pages into JSON Dataset
Scrape meta tags from multiple web pages by reading URLs from a file, extracting all meta tag name-content pairs, and compiling the data into a structured JSON dataset using Python and BeautifulSoup.
Open in a real environment →Easy Parse JSON Log Files and Extract Fields to CSV
We need to parse JSON log files and extract fields to CSV. A log file records events that happen in application over some time. Our log file stores each entry in JSON, which is a text-based format that stores structured data. Our job here is to read each line, then extract five specific fields that are timestamp, level, user and request ID, and message. We save the results in a CSV file. We need to import two built-in Python libraries. First of all, JSON that is used for reading JSON formatted text, and then CSV for writing CSV files. We need to open and read the log file. For this reason, we will use the open function that takes two arguments. First is the path to the file, and second is the mode that we want to use. Using for loop, we go through each line, and in return, we get one line as a string. When we use load as function, it will convert the JSON string into a Python object. Here we will implement the get method. Get looks up for a key in the dictionary and returns its value. But if the key doesn't exist, it returns a default value that we define as a second argument. For request ID, it is basically nested inside of another object, so we will implement the get method twice here. DictWriter will convert the dictionary to CSV file. Write header method puts the first row as column names.
Open in a real environment →Easy Happy Number
def is_happy(n: int) -> bool:
visit = set()
Open in a real environment →while n not in visit: visit.add(n) sq_sum = 0 while n > 0: digit = n % 10 sq_sum += digit * digit n //= 10 n = sq_sum if n == 1: return True return FalseMedium Group Anagrams
def group_anagrams(strs: list[str]) -> list[list[str]]:
Open in a real environment →
anagram_map = {}
for s in strs:
count = [0] * 26
for c in s:
count[ord(c) - ord('a')] += 1
signature = tuple(count)
if signature not in anagram_map:
anagram_map[signature] = []
anagram_map[signature].append(s)
return list(anagram_map.values())Medium Two Sum II - Input Array Is Sorted
def two_sum(numbers: list[int], target: int) -> list[int]:
l, r = 0, len(numbers) - 1
Open in a real environment →while l < r: cur_sum = numbers[l] + numbers[r] if cur_sum > target: r -= 1 elif cur_sum < target: l += 1 else: return [l + 1, r + 1] return []Medium Container With Most Water
def max_area(height: list[int]) -> int:
l, r = 0, len(height) - 1
res = 0
Open in a real environment →while l < r: area = (r - l) * min(height[l], height[r]) res = max(res, area) if height[l] < height[r]: l += 1 else: r -= 1 return resMedium Fetch and Combine Data from Paginated API Endpoint
Collect data from all pages of a paginated REST API endpoint and combine the results into a single CSV file using Python requests and pandas.
Open in a real environment →Medium Fetch Paginated API Data and Store in SQLite Database
Fetch paginated JSON data from a REST API, flatten nested product information, create a SQLite database table, and insert all records using Python.
Open in a real environment →Medium Parse HTML and Extract External Domain Links
Fetch and parse HTML from a web page, extract all hyperlinks, filter external domains excluding the source domain, and save unique results to a text file using Python and BeautifulSoup.
Open in a real environment →Medium Koko Eating Bananas
def min_eating_speed(piles: list[int], h: int) -> int:
l, r = 1, max(piles)
res = r
Open in a real environment →while l <= r: k = (l + r) // 2 hours = 0 for p in piles: hours += (p + k - 1) // k if hours <= h: res = k r = k - 1 else: l = k + 1 return resMedium Find Minimum in Rotated Sorted Array
def find_min(nums: list[int]) -> int:
l, r = 0, len(nums) - 1
Open in a real environment →while l < r: m = (l + r) // 2 if nums[m] > nums[r]: l = m + 1 else: r = m return nums[l]Medium Extract and Normalize Timestamps from Multi-Format Log File
Use regular expressions to extract timestamps from log entries in various formats (ISO 8601, Apache, RFC 2822), parse them using Python datetime, and convert all timestamps to a uniform ISO 8601 format.
Open in a real environment →Medium Deep Merge Multiple YAML Config Files
Merge three YAML configuration files in Python with deep recursive merging, where later files override earlier ones while preserving non-conflicting nested values.
Open in a real environment →Medium Sync Product Catalog from CSV to SQLite Database
Compare CSV updates against an SQLite database to synchronously insert new products and update existing product prices using Python and SQL transactions.
Open in a real environment →Medium Scrape Multi-Page E-commerce Data with BeautifulSoup
Scrape product data from an e-commerce website by parsing a product listing page and following links to individual product detail pages to extract and combine information using Python BeautifulSoup.
Open in a real environment →Hard Correlate Microservice Logs Across Services Using Request IDs
Parse JSON log files from multiple microservices, correlate events by request ID, and trace requests across services chronologically using Python.
Open in a real environment →
Postman (30)
Easy Database REST API Testing
Oracle Database handles enterprise-critical data for thousands of organizations worldwide. QA testing of Database REST APIs requires comprehensive validation of SQL queries, schema operations, data updates, and performance statistics to ensure reliable data management systems.
Open in a real environment →Easy Social Media API Testing
Meta (Facebook) operates the world's largest social networking platform with over 3 billion monthly active users. QA testing of social media APIs requires comprehensive validation of content creation, engagement tracking, moderation workflows, and analytics to ensure safe and engaging user experiences.
Open in a real environment →Easy Teams Communication API Testing
Microsoft Teams connects over 250 million monthly active users for seamless collaboration and communication. QA testing of Teams APIs requires comprehensive validation of meeting creation, chat messaging, file sharing, and presence management to ensure reliable enterprise communication experiences.
Open in a real environment →Easy Search Engine API Testing
Google processes over 8.5 billion search queries daily and powers 92% of global search traffic. QA testing of Google Search APIs requires comprehensive validation of search queries, autocomplete suggestions, search analytics, and trending topics to ensure reliable information retrieval and seamless user search experiences.
Open in a real environment →Easy Professional Network API Testing
LinkedIn connects over 900 million professionals worldwide, serving as the leading platform for professional networking, career development, and business relationships. QA testing of LinkedIn APIs requires comprehensive validation of profile management, connection requests, content sharing, and company interactions to ensure reliable professional networking experiences and seamless business communications.
Open in a real environment →Medium CRM API Integration Testing
Salesforce processes over 3 trillion API requests annually powering CRM operations for millions of businesses. QA testing of CRM APIs requires comprehensive validation of account management, data queries, record updates, and analytics reporting to ensure reliable customer relationship management experiences.
Open in a real environment →Medium Payment Processing API Testing
Stripe processes billions of dollars in payments annually for millions of businesses. QA testing of payment APIs requires comprehensive validation of charge processing, refunds, webhook security, and transaction history to ensure reliable financial operations.
Open in a real environment →Medium Music Streaming API Validation
Spotify serves over 500 million users streaming billions of tracks monthly. QA testing of music streaming APIs requires comprehensive validation of search functionality, playlist management, playback control, and recommendation algorithms to ensure seamless music experiences.
Open in a real environment →Medium Communication API Testing
Twilio powers communications for millions of applications worldwide, processing over 180 billion API requests annually. QA testing of communication APIs requires comprehensive validation of SMS delivery, voice call initiation, webhook security, and real-time status tracking to ensure reliable messaging experiences.
Open in a real environment →Medium Team Communication API Testing
Slack connects millions of teams worldwide with over 10 billion messages sent monthly. QA testing of team communication APIs requires comprehensive validation of message delivery, channel management, user presence tracking, and team information retrieval to ensure seamless collaboration experiences.
Open in a real environment →Medium Ride Sharing API Testing
Uber operates in over 10,000 cities worldwide with 130 million active users. QA testing of ride sharing APIs requires comprehensive validation of fare estimation, driver matching, trip tracking, and cancellation workflows to ensure reliable transportation experiences.
Open in a real environment →Medium Property Booking API Testing
Airbnb hosts over 6 million listings across 220+ countries with 150 million users. QA testing of property booking APIs requires comprehensive validation of search algorithms, availability checking, booking workflows, and review systems to ensure seamless travel experiences.
Open in a real environment →Medium Food Delivery API Testing
Bolt Food operates in over 45 countries across Europe, Africa, and Asia with millions of users. QA testing of food delivery APIs requires comprehensive validation of restaurant discovery, order placement, real-time tracking, and delivery logistics to ensure timely meal delivery.
Open in a real environment →Medium Electric Vehicle API Testing
Tesla operates the world's largest electric vehicle charging network with over 50,000 Superchargers globally. QA testing of electric vehicle APIs requires comprehensive validation of battery management, charging protocols, vehicle control systems, and energy optimization to ensure reliable electric mobility experiences.
Open in a real environment →Medium Video Communications API Testing
Zoom facilitates billions of meeting minutes monthly connecting people across the globe. QA testing of video communications APIs requires comprehensive validation of meeting scheduling, real-time session management, recording controls, and usage analytics to ensure reliable communication experiences.
Open in a real environment →Medium E-commerce Platform API Testing
Shopify powers over 1.7 million e-commerce businesses worldwide processing billions in sales annually. QA testing of e-commerce platform APIs requires comprehensive validation of product management, inventory control, order processing, and merchant operations to ensure seamless online retail experiences.
Open in a real environment →Medium AWS Lambda Function Testing
Amazon Web Services Lambda processes billions of function invocations daily. QA testing of Lambda APIs requires comprehensive validation of function deployment, invocation, code updates, and metrics monitoring to ensure reliable serverless computing services.
Open in a real environment →Medium Cloud Storage API Testing
Google Cloud Storage handles petabytes of data for millions of users worldwide. QA testing of Cloud Storage APIs requires comprehensive validation of bucket operations, permission management, and metrics monitoring to ensure reliable cloud infrastructure services.
Open in a real environment →Medium User Authentication API Testing
Microsoft Azure Active Directory handles millions of authentication requests daily. QA testing of authentication APIs requires comprehensive validation of login flows, password resets, user registration, and profile management to ensure secure user access control.
Open in a real environment →Medium Payment API Test Suite
Stripe is a leading payment processing platform handling billions of transactions. QA testing of payment APIs requires comprehensive validation of endpoints, status codes, response times, and data integrity to ensure secure and reliable financial transactions.
Open in a real environment →Medium Streaming Media API Testing
Netflix operates the world's leading streaming entertainment service with over 230 million paid memberships in over 190 countries. QA testing of streaming media APIs requires comprehensive validation of content delivery, DRM protection, quality adaptation, and playback synchronization to ensure seamless viewing experiences.
Open in a real environment →Medium Device Ecosystem API Testing
Apple's ecosystem connects over 2 billion active devices worldwide across iPhone, iPad, Mac, Apple Watch, and Apple TV. QA testing of Apple device ecosystem APIs requires comprehensive validation of device registration, sync services, iCloud backup management, and cross-platform data sharing to ensure seamless integration and reliable user experiences across all Apple platforms.
Open in a real environment →Medium E-commerce Marketplace API Testing
Amazon operates the world's largest e-commerce marketplace with over 300 million active customers and 12 million products. QA testing of Amazon marketplace APIs requires comprehensive validation of product search, cart management, order processing, and inventory tracking to ensure reliable shopping experiences and seamless transaction processing.
Open in a real environment →Medium E-commerce API Testing
Shopify powers over 4.4 million e-commerce websites globally, serving millions of merchants and processing billions in sales annually. QA testing of Shopify APIs requires comprehensive validation of product management, order processing, inventory tracking, and customer operations to ensure reliable e-commerce functionality and seamless online shopping experiences.
Open in a real environment →Medium Hardware Monitoring API Testing
AMD powers over 2 billion devices globally with cutting-edge processors and graphics cards for gaming, data centers, and embedded systems. QA testing of AMD hardware monitoring APIs requires comprehensive validation of GPU metrics, temperature sensors, performance analytics, and system diagnostics to ensure reliable hardware monitoring and optimal system performance.
Open in a real environment →Medium Social Platform API Testing
Twitter serves over 450 million monthly active users as a leading social media platform for real-time communication and content sharing. QA testing of Twitter APIs requires comprehensive validation of tweet creation, timeline retrieval, trending topics analysis, and analytics tracking to ensure reliable social platform experiences and user engagement.
Open in a real environment →Hard Video Conference API Testing
Zoom hosts over 300 million daily meeting participants across 220+ countries. QA testing of video conferencing APIs requires comprehensive validation of meeting creation, participant management, recording controls, and quality analytics to ensure seamless remote collaboration.
Open in a real environment →Hard Video Streaming Platform API Testing
Netflix processes billions of streaming requests daily serving content to millions of users worldwide. QA testing of streaming platform APIs requires comprehensive validation of content upload, recommendation algorithms, user preference management, and analytics to ensure optimal viewing experiences.
Open in a real environment →Hard iOS App Store API Validation
Apple App Store Connect processes thousands of app submissions daily. QA testing of App Store APIs requires comprehensive validation of binary uploads, review status checks, metadata updates, and analytics queries to ensure smooth app publishing workflows.
Open in a real environment →Hard Azure DevOps API Testing
Microsoft Azure DevOps serves over 8 million users worldwide for comprehensive DevOps lifecycle management. QA testing of Azure DevOps APIs requires thorough validation of project creation, work item management, build pipelines, and repository operations to ensure reliable software development workflows and seamless team collaboration.
Open in a real environment →
Linux (3)
Easy Managing High I/O Processes
Users are complaining about slow file access and we have high disc utilization. We need to reduce IO activity of top offenders using IO priorities and we need to settle the IO priority to idle. While doing so, we need to keep critical jobs, databases, message queues, applications at high priority. First we need to identify processes that have high IO activity. We'll use IO top command, and we at hyphen N 10 at the end of this command. This means that this command will run 10 times. To check current IO priority of job one, we need to use ionice command. First we need to look into process ID of this job. We have no priority set for this process, and we need to set this to idle. And idle will be priority number three. The command for this will be ionice three and the process ID.
Open in a real environment →Easy Recursive Keyword Finder
We have multiple applications that write their logs under var slash log. An issue with this approach is that since multiple logs file are constantly being written to this folder, checking them one by one would be slow and inefficient. We want to use this file to consolidate all the lines that contain errors and write them here. We can use grep and we'll use recursive flag to get error lines in var slash log folder, and it will include only files that are in dot log extension. What we left to do is send this into the consolidated error logs file.
Open in a real environment →Medium Debug SSH Lockout
We have developer account dev that has been locked out of the server and security logs indicate that there were too many failed SSH identification attempts. We need to check logs and count exactly how many attempts this user had today. And once we have this number, we need to update the configuration to increase this allowed login attempts above this number. We'll need to check log for login attempts. We'll need to use sudo to view this as admin. We can use grep command to filter out the lines that we need. We can also count this with word count hyphen L, which will print us number of lines. We need to change SSHD daemon configuration file, which is located under etc ssh and then sshd config. Find something that says Max. Finally, restart sshd daemon using systemctl restart.
Open in a real environment →
AWS (2)
Easy Create AWS IAM Admin User with Group and Policy
We need to set up new admin account for regular user. We've been asked to create IAM user named DevOps admin with console password access, and then we need to add the user to the admin group, which should have administrator access policy attached. In AWS, we can attach policies meaning access rights to certain user via two ways. First, we can attach this policy directly to the user, but this won't be very efficient. Instead, in AWS, we can use what's called groups. We can create an admin group and then attach administrator access directly to this group. Once this is done, we need to tag this user with a key that's equal to role and the value is equal to DevOps. We use tag to easily identify users. First we need to go to the IAM. This is where we'll create users. We need to provide console access, which means that this user will be able to access not only via CLI but also via UI. The policy name was Administrator Access. We could see that the action is wildcard, meaning everything, effect is allow and resource is also wildcard.
Open in a real environment →Easy Create IAM Role for EC2 with Full IAM Access
Our team needs an EC2 instance to manage IAM resources programmatically and to follow security best practices, we need to use IAM role instead of embedding credentials. Our task is to create IAM role IAM full access EC2 and allow EC2 service to assume this role and this role has to have IAM full access policy attached. In AWS, we could access services by using access key and secret key, it's like having a username and password. Imagine if our AWS EC2 instance has been compromised, our access key and secret key could be reused for other purposes. The best practice in AWS is to use something called AWS role. When EC2 instance assumes a role, it sends an API request to AWS Secure Token service and it checks if this instance has access to this role and if it does, secure token service gives a temporary credentials to our EC2 instance. This is short-lived credentials and they're never stored directly in our EC2 instance.
Open in a real environment →
Docker (1)
Easy Docker Multi-Architecture Image
When we build our container from this file, it builds it in architecture of our host system. Our task is to change the setup to build it in multiple architectures. We'll use Docker build with an instance named Multi Arc and we will use buildx create. We'll list current builders by typing Docker buildx ls. We have only default that builds it in our current platform's underlying os. So add new builder. Docker buildx create and then name multi arc. Then we use driver network host and then use to have it as default builder. Now attempt to build for our multi architecture setup. We'll run Docker buildx build. Verify this by typing Docker images.
Open in a real environment →
Practice on real environments
Browse and filter the full Quality Assurance catalog, or see questions asked at specific companies.