Interview | Software Quality Engineer | IC2 | ServiceNow
Excited to share my recent interview experience for the Software Quality Engineer position at Service Now, targeted at IC2 level.
Phase 1: Initial Phone Screening from HR
Engaged in a comprehensive discussion about my current role and responsibilities, setting the stage for subsequent technical rounds.
Technical Phone Interview:
-
Day-to-day Role:
- Provided insights into my daily activities, emphasizing key responsibilities and achievements.
-
Maven and its Benefit:
- Discussed the role of Maven in managing project dependencies and highlighted a primary benefit, simplifying the build process.
-
Overloading vs. Overriding:
- Clearly distinguished between method overloading and overriding, demonstrating a solid understanding of OOP principles.
-
Test Automation Suite Structure:
- Detailed explanation of the structure of the test automation suite I had implemented, showcasing organization and efficiency.
-
POM.xml Usage:
- Justified the use of POM.xml over alternative methods, highlighting its advantages in managing project dependencies.
-
Three Sum Leetcode Question:
- Successfully tackled the Leetcode medium-level problem 'Three Sum,' showcasing problem-solving skills.
import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class ThreeSum { public List<List<Integer>> threeSum(int[] nums) { List<List<Integer>> result = new ArrayList<>(); if (nums == null || nums.length < 3) { return result; } Arrays.sort(nums); for (int i = 0; i < nums.length - 2; i++) { if (i > 0 && nums[i] == nums[i - 1]) { continue; } int target = -nums[i]; int left = i + 1; int right = nums.length - 1; while (left < right) { int sum = nums[left] + nums[right]; if (sum == target) { result.add(Arrays.asList(nums[i], nums[left], nums[right])); // Skip duplicates while (left < right && nums[left] == nums[left + 1]) { left++; } left++; // Skip duplicates while (left < right && nums[right] == nums[right - 1]) { right--; } right--; } else if (sum < target) { left++; } else { right--; } } } return result; } public static void main(String[] args) { int[] nums = {-1, 0, 1, 2, -1, -4}; ThreeSum threeSum = new ThreeSum(); List<List<Integer>> result = threeSum.threeSum(nums); System.out.println(result); } } -
Annotation Methods (@AfterSuite, @BeforeSuite, @AfterClass, etc.):
- Enumerated the significance and use cases of various TestNG annotation methods.
-
Assertions and their Purpose:
- Articulated the importance of assertions in testing and how they ensure the expected behavior of the code.
-
Jenkins Implementation and Potential Enhancements:
- Described the Jenkins setup I had implemented and discussed possible improvements and additional functionalities.
-
Parallel Test Case Execution:
- Explained the implementation of parallel test case execution, demonstrating scalability and efficiency.
-
XPath Resolution Issues:
- Shared strategies to address challenges in finding XPath for certain test cases, displaying problem-solving skills.
-
Automation Suite Type:
- Clarified the nature of the automation suite developed, categorizing it as BDD, KDD, and DOM-based.
Verdict:
Waiting for Round 2 Invitation (I believe the interview went well!)
Interviewer:
The interviewer, a veteran senior quality engineer, was instrumental in guiding me through the process and maintained a calm demeanor throughout.
Update:
Got a call after one week for Round2, Wish me luck guys.
Round 2 Interview
-
Overloading vs Overriding:
- Question: What is the difference between overloading and overriding? Provide an example related to automation.
- Response: Overloading involves defining multiple methods with the same name but different parameters within the same class, while overriding involves redefining a method in a subclass with the same signature as that of the superclass. For example, in automation, overloading could be having multiple methods with the same name but accepting different types of locator strategies.
-
Debugging Code Snippets:
- Question: Debug the provided code snippets and determine their output.
- Code Snippet 1:
public class FinallyBlockExample { public static void main(String[] args) { try { System.out.println("Inside try block"); System.exit(0); } catch (Exception e) { System.out.println("Exception caught: " + e.getMessage()); } finally { System.out.println("Finally block is executed."); // This won't be executed } } } - Code Snippet 2:
class Superclass { void foo() throws NullPointerException { throw new NullPointerException("NullPointerException in Superclass"); } } class Subclass extends Superclass { @Override void foo() throws RuntimeException { throw new RuntimeException("RuntimeException in Subclass"); } } public class Main { public static void main(String[] args) { Superclass obj = new Subclass(); obj.foo(); } } - Code Snippet 3:
public class FinallyBlockExample { public static void main(String[] args) { try { System.out.println("Inside try block"); break; } catch (Exception e) { System.out.println("Exception caught: " + e.getMessage()); } finally { System.out.println("Finally block is executed."); // This won't be executed } } } - Explanation: Code snippet 1 will print "Inside try block" but won't execute the finally block due to
System.exit(0). Code snippet 2 will throw aRuntimeExceptionfrom theSubclass. Code snippet 3 will result in a compilation error due to the misuse of thebreakstatement.
- Code Snippet 1:
- Question: Debug the provided code snippets and determine their output.
-
Handling Error Codes in APIs:
- Question: How are error codes typically utilized in APIs when a resource is not present?
- Response: Error codes in APIs signify various statuses of requests or responses. Common ones include 404 for "Not Found," 400 for "Bad Request," etc.
-
Automating HTML Tags and Iframes:
- Question: List HTML tags commonly automated in web automation, and briefly explain how they are automated.
- Response: HTML tags like
<input>,<button>,<select>, etc., are commonly automated in web automation using tools like Selenium WebDriver, allowing interaction with elements such as entering text, clicking buttons, selecting options, etc. Iframes can be switched to using Selenium'sswitchTo().frame()method.
-
Handling Iframes:
- Question: Explain how iframes are handled in web automation.
- Response: Iframes in web automation are handled by switching to the frame using Selenium's
switchTo().frame()method before interacting with elements inside the iframe and switching back to the default content after completing actions within the iframe.
-
Manipulating Arrays:
- Question: How would you manipulate an array to group negative numbers to the left and positive numbers to the right?
- Response: Iterate through the array, moving negative numbers to the left and positive numbers to the right.
public class ArrayManipulation { public static void main(String[] args) { int[] array = {-5, 10, -3, 8, -1, 6}; rearrangeArray(array); // Printing the rearranged array for (int num : array) { System.out.print(num + " "); } } public static void rearrangeArray(int[] array) { int n = array.length; int[] temp = new int[n]; int left = 0; // Moving negative numbers to the left for (int i = 0; i < n; i++) { if (array[i] < 0) { temp[left++] = array[i]; } } // Moving positive numbers to the right for (int i = 0; i < n; i++) { if (array[i] >= 0) { temp[left++] = array[i]; } } // Copying rearranged elements back to the original array for (int i = 0; i < n; i++) { array[i] = temp[i]; } } }
-
Bug Reporting Essentials:
- Question: What essential components should be included in a bug report?
- Response: Include detailed steps to reproduce the bug, expected vs. actual results, screenshots or logs, environment details, and severity/priority assessment.
-
Using Packages Across Projects with Maven:
- Question: Describe the process of using a package from one project in another project using Maven.
- Response: To use a package from one project in another project with Maven, specify the dependency in the
pom.xmlfile of the target project.
-
Automating APIs with Newman:
- Question: What considerations should be taken into account when automating APIs using Newman?
- Response: When automating APIs with Newman, consider factors like endpoint URL, request parameters, headers, authentication, response validation, error handling, and reporting.
-
Understanding Packages:
- Question: Define the concept of packages in programming.
- Response: Packages in Java are used to organize classes into namespaces, aiding in better code management, modularity, and avoiding naming conflicts.
This round provided a comprehensive understanding of various programming concepts and practical application scenarios, enhancing problem-solving skills and programming proficiency.
Update
Certainly, here's the full LeetCode discussion section with the updated description for the third question:
LeetCode Discussion: ServiceNow Interview Experience
Round 3 Interview
-
Managing Permissions in Google Cloud Platform (GCP):
- The question focused on strategies for managing permissions within GCP. I discussed role-based access control (RBAC) and Google's Identity and Access Management (IAM) policies as effective means to control access to cloud resources.
-
Hiding Processes in Linux:
- This involved concealing a running process in Linux so that it doesn't occupy the terminal and persists even after closing the virtual machine (VM). I explained how to achieve this using background processes, nohup, and disown commands to detach processes from the terminal.
-
Java Program for Frequency of Duplicates in an Array and Printing Their Frequencies:
- Implemented a Java program to identify duplicate numbers in an array and print their frequencies. The program accurately calculated the occurrences of each duplicate number, providing insights into the frequency distribution within the array. The code snippet below demonstrates the approach:
import java.util.*; public class DuplicateFrequency { public static void main(String[] args) { int[] input = {1, 2, 3, 4, 5, 6, 2, 3, 3, 4, 4}; findDuplicateFrequency(input); } public static void findDuplicateFrequency(int[] arr) { Map<Integer, Integer> frequencyMap = new HashMap<>(); // Count the frequency of each number in the array for (int num : arr) { frequencyMap.put(num, frequencyMap.getOrDefault(num, 0) + 1); } List<Integer> duplicates = new ArrayList<>(); // Iterate over the frequency map to find duplicates and their frequencies for (Map.Entry<Integer, Integer> entry : frequencyMap.entrySet()) { if (entry.getValue() > 1) { duplicates.add(entry.getKey()); System.out.println(entry.getKey() + " came " + entry.getValue() + " times"); } } System.out.println("Numbers with duplicates: " + duplicates); } } -
Sudo User Privileges in Linux:
- Discussed the significance of sudo privileges and how to become a sudo user in Linux. I outlined the sudo command's usage and its role in executing commands with elevated privileges.
-
Connecting to a Remote Linux Server:
- Explored methods for connecting to a remote Linux server, including SSH (Secure Shell) protocol. I highlighted SSH's encryption capabilities and its role in secure remote access.
-
Public and Private Key Authentication:
- Delved into the concept of public-key cryptography and its application in authenticating users to remote servers. Explained how public and private key pairs facilitate secure authentication without transmitting sensitive information over the network.
-
Editing Environment Variables in Linux:
- Demonstrated how to edit environment variables in Linux using commands like export and editing configuration files such as .bashrc or .profile.
-
Viewing Environment Variables in Linux:
- Provided insights into viewing existing environment variables in Linux through commands like env or printenv.
-
Updating Environment Variables in Linux:
- Shared methods for updating environment variables in Linux, emphasizing the importance of persistence across sessions and system reboots.
-
Comfort with Terminal Usage:
- Confirmed my proficiency and comfort with using the terminal for various tasks, including file management, process control, and system administration.
-
Previous Work Experience:
- Discussed my prior experience and contributions in previous organizations, highlighting relevant projects and achievements.
Round 4:
Casual conversation with the Hiring Manager for approximately 30 minutes, focusing on the prospective team, work culture, and related topics.
Final Verdict
Got the final selection call from HR the next day and waiting for an Offer.


