Senior Software Quality Engineer Interview Questions

537 senior software quality engineer interview questions shared by candidates

Write test cases for this below code? class Product { private String name; private double price; public Product(String name, double price) { this.name = name; this.price = price; } public String getName() { return name; } public double getPrice() { return price; } } class ShoppingCart { private List items; public ShoppingCart() { items = new ArrayList<>(); } public void addItem(Product product) { items.add(product); } public List getItems() { return items; } public double calculateTotal() { double total = 0; for (Product item : items) { total += item.getPrice(); } return total; } } class DiscountManager { public double applyDiscount(ShoppingCart cart, double discountRate) { double total = cart.calculateTotal(); return total * (1 - discountRate); } } public class Main { public static void main(String[] args) { Product product1 = new Product("Laptop", 1000); Product product2 = new Product("Mouse", 20); ShoppingCart cart = new ShoppingCart(); cart.addItem(product1); cart.addItem(product2); DiscountManager discountManager = new DiscountManager(); double discountedPrice = discountManager.applyDiscount(cart, 0.1); System.out.println("Discounted price: " + discountedPrice); } }
avatar

Sr Software Quality Engineer

Interviewed at ServiceNow

4.1
May 9, 2024

Write test cases for this below code? class Product { private String name; private double price; public Product(String name, double price) { this.name = name; this.price = price; } public String getName() { return name; } public double getPrice() { return price; } } class ShoppingCart { private List items; public ShoppingCart() { items = new ArrayList<>(); } public void addItem(Product product) { items.add(product); } public List getItems() { return items; } public double calculateTotal() { double total = 0; for (Product item : items) { total += item.getPrice(); } return total; } } class DiscountManager { public double applyDiscount(ShoppingCart cart, double discountRate) { double total = cart.calculateTotal(); return total * (1 - discountRate); } } public class Main { public static void main(String[] args) { Product product1 = new Product("Laptop", 1000); Product product2 = new Product("Mouse", 20); ShoppingCart cart = new ShoppingCart(); cart.addItem(product1); cart.addItem(product2); DiscountManager discountManager = new DiscountManager(); double discountedPrice = discountManager.applyDiscount(cart, 0.1); System.out.println("Discounted price: " + discountedPrice); } }

Questions ranged from test planning, types of testing, how would I test Amazon website, use cases to basic programming questions on Java and Selenium. Made me write code on an online IDE for Java. Most of the questions were related to my previous experiences and how would I approach a use case for testing. Were interested to understand the types of testing like Security testing, accessibility testing, localization testing and functional testing and their use cases Questions on Java: (Strings) - How to find if a string is a palindrome - Find all substrings of a given string - Find the longest palindrome of a given string - Difference between Assert and Verify - Most common exceptions - How do you pass control to a different page in POM - How do you find elements when IDs are dynamic - How do you handle alerts in selenium
avatar

Sr Software QA Engineer

Interviewed at ServiceNow

4.1
Jun 26, 2023

Questions ranged from test planning, types of testing, how would I test Amazon website, use cases to basic programming questions on Java and Selenium. Made me write code on an online IDE for Java. Most of the questions were related to my previous experiences and how would I approach a use case for testing. Were interested to understand the types of testing like Security testing, accessibility testing, localization testing and functional testing and their use cases Questions on Java: (Strings) - How to find if a string is a palindrome - Find all substrings of a given string - Find the longest palindrome of a given string - Difference between Assert and Verify - Most common exceptions - How do you pass control to a different page in POM - How do you find elements when IDs are dynamic - How do you handle alerts in selenium

Viewing 171 - 180 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 537 interview questions and reports from Senior software quality engineer interviews. Prepare for your interview. Get hired. Love your job.