Software Qa Engineer Interview Questions

6,316 software qa 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
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); } }

Networking: 1.What happens when you type www.google.com in the browser? 2.Explain all OSI layers based on this flow. 3.Some questions on network protocols. Operating Systems: 1.Round-robin scheduling 2.Deadlocks DSA: 1.Reverse the words in a given string. 2.Remove elements appearing more than twice in an array while maintaining order (e.g., if 4 appears 3 times, remove only the third occurrence).
avatar

Software Engineer - QA

Interviewed at SecPod Technologies

4.2
Apr 24, 2025

Networking: 1.What happens when you type www.google.com in the browser? 2.Explain all OSI layers based on this flow. 3.Some questions on network protocols. Operating Systems: 1.Round-robin scheduling 2.Deadlocks DSA: 1.Reverse the words in a given string. 2.Remove elements appearing more than twice in an array while maintaining order (e.g., if 4 appears 3 times, remove only the third occurrence).

Viewing 2131 - 2140 interview questions

Glassdoor has 6,316 interview questions and reports from Software qa engineer interviews. Prepare for your interview. Get hired. Love your job.