Sdet

100+ Sdet Interview Questions and Answers

Updated 25 Nov 2024

Q51. How do you authenticate and API?

Ans.

API authentication can be done using various methods like API keys, OAuth tokens, and JWT tokens.

  • Use API keys to authenticate requests by including the key in the request header.

  • Implement OAuth for secure authorization and authentication.

  • Utilize JWT tokens for stateless authentication by generating tokens upon successful login.

Q52. How to pass data in testng tags?

Ans.

TestNG tags can pass data using parameters in testng.xml file or through DataProviders.

  • Use parameters in testng.xml file to pass data to test methods

  • Use DataProviders to pass data dynamically to test methods

  • Example:

Q53. write a program to move all the zeros in a array into end

Ans.

Program to move all zeros in an array to the end

  • Iterate through the array and move all zeros to the end

  • Use two pointers approach to swap non-zero elements with zeros

  • Maintain a count of non-zero elements to determine the swap position

Q54. Second Max in the list of repeated integers.

Ans.

Find the second highest repeated integer in a list.

  • Iterate through the list and count the frequency of each integer.

  • Sort the frequencies in descending order and return the second highest frequency.

  • Handle edge cases like when there is no second highest frequency.

Are these interview questions helpful?

Q55. Two Python Questions; "aabbccrrra" => "a3b2c2r3"

Ans.

Count consecutive characters in a string and return the count next to the character.

  • Iterate through the string and keep track of consecutive characters and their counts.

  • Use a dictionary to store the characters and their counts.

  • Return the characters and their counts in the desired format.

Q56. Write selenium code for getting values in a dynamic table

Ans.

Use Selenium to extract values from a dynamic table

  • Identify the table using its locator (id, class, xpath, etc.)

  • Iterate through the rows and columns of the table to extract values

  • Use Selenium commands like findElements and getText to retrieve the values

  • Handle dynamic content by waiting for elements to be present or visible

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q57. Simple xpath without using Index reverse strings with words separately

Ans.

Reverse strings with words separately using simple xpath without using index

  • Use XPath function to split the string into words

  • Reverse each word individually using XPath function

  • Concatenate the reversed words back together

Q58. UI test cases of a Form

Ans.

UI test cases for a Form

  • Verify all required fields are displayed

  • Test validation messages for invalid inputs

  • Check if form submission is successful

  • Test the functionality of reset button

Sdet Jobs

SDET 1-4 years
SAS Research and Developement (India) Pvt Ltd
4.4
Pune
Cognizant is Hiring For SDET!! 6-11 years
Cognizant
3.8
Chennai
SDET (Selenium + Java) 2-5 years
Diamond pick
4.1
Bangalore / Bengaluru

Q59. Javascript basic difference between var let.

Ans.

var is function scoped, let is block scoped in JavaScript.

  • var is function scoped, let is block scoped

  • var can be redeclared, let cannot be redeclared

  • let is recommended for use over var in modern JavaScript

Q60. Swap two numbers without using a third integer.

Ans.

Swap two numbers without using a third integer

  • Use XOR operation to swap two numbers without using a third integer

  • Example: a = 5, b = 7. a = a XOR b, b = a XOR b, a = a XOR b

  • After swapping: a = 7, b = 5

Q61. First and last occurrence of an element in an array

Ans.

Find the first and last occurrence of a specific element in an array of strings.

  • Iterate through the array and keep track of the index of the first and last occurrence of the element.

  • Return the index of the first and last occurrence of the element.

Q62. String Programs To reverse, duplicate

Ans.

String programs to reverse and duplicate an array of strings.

  • Use a loop to iterate through each string in the array.

  • To reverse a string, use the built-in reverse() method or loop through the string backwards.

  • To duplicate a string, use the concat() method or the + operator.

  • Remember to store the reversed or duplicated string in a new variable or array.

Q63. what is the use of Normalizations

Ans.

Normalizations are used to standardize data by removing redundancies and inconsistencies.

  • Normalizations help in organizing data in a consistent and efficient manner.

  • They reduce data redundancy by eliminating duplicate information.

  • Normalization ensures data integrity and accuracy by avoiding inconsistencies.

  • Examples include normalizing database tables to reduce data duplication and improve query performance.

Q64. Tell me tools on which you worked on?

Ans.

I have worked on tools such as Selenium, JUnit, TestNG, Postman, and Jenkins.

  • Selenium

  • JUnit

  • TestNG

  • Postman

  • Jenkins

Q65. Write test cases for a given scenario(Payment)

Ans.

Test cases for payment scenario

  • Verify payment is processed successfully with valid credit card information

  • Test payment failure with invalid credit card details

  • Check if payment confirmation email is sent to the user

  • Test payment timeout scenario

  • Verify payment receipt is generated after successful transaction

Q66. Why you want to join autodesk

Ans.

I want to join Autodesk because of its innovative technology and global impact in the design industry.

  • Autodesk is a leader in providing cutting-edge software solutions for design and engineering professionals

  • I am excited about the opportunity to work on challenging projects and contribute to the company's success

  • I admire Autodesk's commitment to sustainability and diversity in the workplace

Q67. 2, In C# what are Var and Ref Keywards

Ans.

Var is used to declare implicitly typed local variables, while Ref is used for passing arguments by reference.

  • Var keyword allows the compiler to infer the type of the variable based on the assigned value.

  • Ref keyword is used to pass arguments by reference, allowing the called method to modify the original value.

  • Var example: var number = 10; // Compiler infers the type as int

  • Ref example: void ModifyValue(ref int value) { value = 20; } // Changes the original value passed by ref...read more

Q68. Define the automation framework worked on.

Ans.

I have worked on a keyword-driven automation framework using Selenium and TestNG.

  • Utilized Excel sheets to store test cases and keywords

  • Implemented reusable functions for common actions like clicking, inputting text, etc.

  • Used TestNG for test case management and reporting

  • Integrated with Jenkins for continuous integration

Q69. Explain automation framework

Ans.

Automation framework is a set of guidelines, tools, and processes used to automate testing of software applications.

  • Automation framework provides structure and guidelines for creating and executing automated tests.

  • It helps in organizing test scripts, managing test data, and generating test reports.

  • Examples of automation frameworks include Selenium, TestNG, and Cucumber.

  • Frameworks can be data-driven, keyword-driven, or hybrid in nature.

Q70. Test cases of Login API

Ans.

Test cases for Login API

  • Verify valid username and password login successfully

  • Verify invalid username and password combination fails to login

  • Verify login with empty username or password fails

  • Verify login with special characters in username or password fails

Q71. A code to write for some tasks using linked list

Ans.

Linked list code for tasks

  • Create a linked list class

  • Implement add, remove, and search methods

  • Use the linked list to perform the tasks

Q72. Find Missing numbers from an Integer Array

Ans.

Find missing numbers in an integer array

  • Iterate through the array and keep track of seen numbers

  • Compare the seen numbers with a range of expected numbers to find missing ones

  • Handle edge cases like duplicates or negative numbers

  • Example: Array [1, 2, 4, 6] should return missing numbers 3 and 5

Q73. Concat two strings without any inbuilt function

Ans.

Concatenate two strings without using any inbuilt function

  • Create a new array to store the characters of both strings

  • Iterate through each character of the first string and add it to the new array

  • Repeat the same process for the second string

  • Join the characters in the array to form the concatenated string

Q74. why Snapdeal

Ans.

Snapdeal is a leading e-commerce platform in India, offering a wide range of products and services.

  • Snapdeal has a vast product catalog, providing customers with a wide variety of options.

  • The platform offers competitive prices and frequent discounts, making it attractive for customers.

  • Snapdeal has a user-friendly interface and a seamless shopping experience.

  • The company has a strong logistics network, ensuring timely delivery of products.

  • Snapdeal has a robust customer support s...read more

Q75. Reverse a number inheritance vs interface

Ans.

Reverse a number using inheritance vs interface

  • Inheritance involves creating a new class that inherits properties and methods from an existing class, while interface defines a contract that a class must implement.

  • In the context of reversing a number, inheritance could be used to create a base class with a method for reversing numbers, which can be inherited by other classes.

  • Interface could be used to define a common method signature for reversing numbers that different classe...read more

Q76. put patch and post in api testing

Ans.

Patch and post are HTTP methods used in API testing to update and create resources, respectively.

  • PATCH method is used to update an existing resource in the API

  • POST method is used to create a new resource in the API

  • Both methods are commonly used in RESTful APIs for CRUD operations

  • Example: PATCH /api/users/123 to update user with ID 123

  • Example: POST /api/users to create a new user

Q77. What is the regression test?

Ans.

Regression testing is the process of re-running previously executed tests to ensure that new code changes have not adversely affected existing functionality.

  • Regression testing is performed to verify that new code changes have not introduced any new bugs or issues.

  • It involves re-running previously executed test cases to ensure that existing functionality still works as expected.

  • Regression testing is typically automated to save time and effort.

  • Examples of regression testing too...read more

Q78. Find xpath for some elements in Selenium

Ans.

XPath is a way to locate elements on a web page using their HTML structure.

  • Use Chrome DevTools to inspect elements and generate XPath

  • Avoid using absolute XPath as it can be brittle

  • Use relative XPath with unique attributes for better stability

Q79. Regression vs Sanity

Ans.

Regression testing ensures existing functionality still works after changes, while sanity testing checks if new functionality works as expected.

  • Regression testing is performed to make sure that new code changes do not adversely affect existing functionality.

  • Sanity testing is a cursory testing to make sure that the new functionality is working as expected.

  • Regression testing is usually automated and covers a wide range of test cases.

  • Sanity testing is usually done manually and f...read more

Q80. What is the Java stream

Ans.

Java Stream is a sequence of elements that supports functional-style operations.

  • Java Stream is used to process collections of objects in a functional way.

  • It allows for operations like filter, map, reduce, and collect to be performed on the elements.

  • Streams can be sequential or parallel, providing better performance for large datasets.

  • Example: List names = Arrays.asList("Alice", "Bob", "Charlie"); Stream stream = names.stream();

Q81. Check a string is palindrome or not

Ans.

Check if a string is a palindrome or not

  • Iterate through the string from both ends and compare characters

  • Ignore spaces and punctuation when checking for palindrome

  • Use built-in functions like reverse() to check for palindrome

Q82. 1, Diff b/w final, Finaly & Finalize

Ans.

final, finally, and finalize are keywords in Java with different meanings.

  • final is a keyword used to declare a constant value that cannot be modified

  • finally is a block used in exception handling to ensure a piece of code is always executed

  • finalize is a method in the Object class used for garbage collection before an object is destroyed

Q83. what is STLC? bug lcycle

Ans.

STLC stands for Software Testing Life Cycle, which is a series of steps performed in a specific sequence to ensure the quality of software.

  • STLC is a process followed by software testers to ensure that the software meets quality standards.

  • It includes phases like requirement analysis, test planning, test design, test execution, and test closure.

  • Bug lifecycle refers to the stages a bug goes through from discovery to resolution, including reporting, triaging, fixing, retesting, a...read more

Q84. Write program of sum of digits

Ans.

Program to calculate the sum of digits in a number

  • Iterate through each digit of the number and add them together

  • Use modulus operator to extract each digit

  • Convert the number to a string to easily access individual digits

Q85. What is your bug process

Ans.

My bug process involves thorough testing, documenting, prioritizing, and tracking bugs to resolution.

  • I start by thoroughly testing the software to identify bugs.

  • I document each bug with detailed steps to reproduce, screenshots, and any relevant information.

  • I prioritize bugs based on severity and impact on users.

  • I track bugs through a bug tracking system, regularly updating their status and working towards resolution.

Q86. explain your automation framework

Ans.

My automation framework is a data-driven framework using Selenium WebDriver and TestNG for test execution and reporting.

  • Uses Selenium WebDriver for interacting with web elements

  • Utilizes TestNG for test execution and reporting

  • Follows a data-driven approach for test data management

Q87. concept of pointers,double pointers

Ans.

Pointers are variables that store memory addresses of other variables. Double pointers store memory addresses of pointers.

  • Pointers are used to access and manipulate memory addresses of variables.

  • Double pointers are used to store memory addresses of pointers themselves, allowing for indirect access to variables.

  • Example: char *ptr; int **dptr;

Q88. Checked and unchecked exceptions.

Ans.

Checked exceptions are checked at compile time, while unchecked exceptions are not.

  • Checked exceptions must be either caught or declared in the method signature using 'throws' keyword.

  • Unchecked exceptions do not need to be explicitly handled.

  • Examples of checked exceptions include IOException, ClassNotFoundException.

  • Examples of unchecked exceptions include NullPointerException, ArrayIndexOutOfBoundsException.

Q89. Explain framework used for selenium

Ans.

Selenium is an open-source automation testing framework used for web applications.

  • Selenium supports multiple programming languages like Java, Python, C#, etc.

  • It consists of Selenium WebDriver, Selenium IDE, and Selenium Grid.

  • Selenium WebDriver is used for automating web applications by interacting with the web elements.

  • Selenium IDE is a record and playback tool for creating test cases.

  • Selenium Grid is used for parallel testing across different browsers and environments.

Q90. Parenthesis Balancing using stack

Ans.

Implement a parenthesis balancing algorithm using a stack

  • Use a stack to keep track of opening parentheses

  • When encountering a closing parenthesis, pop from stack and check if it matches the closing parenthesis

  • If stack is empty or mismatched parentheses, return false

  • If all parentheses are balanced, return true

Q91. Reverse String without using loop

Ans.

Reverse string without using loop

  • Use recursion to reverse the string

  • Base case: if string length is 0 or 1, return the string

  • Recursive case: return the last character + reverse(rest of the string)

Q92. Smallest number in array

Ans.

Find the smallest number in an array of strings

  • Convert the strings to numbers before comparing

  • Use a loop to iterate through the array and keep track of the smallest number

  • Handle cases where the array is empty or contains non-numeric strings

  • Example: ['5', '10', '2', '8'] should return '2'

Q93. merge two sorted arrays

Ans.

Merging two sorted arrays into a single sorted array

  • Create a new array to store the merged result

  • Iterate through both arrays simultaneously, comparing elements and adding the smaller one to the result array

  • Handle cases where one array is longer than the other by appending the remaining elements

Q94. Implementation of queue using stack

Ans.

Implement a queue using two stacks

  • Use two stacks - one for enqueue operation and one for dequeue operation

  • For enqueue operation, push elements into the first stack

  • For dequeue operation, if the second stack is empty, pop all elements from the first stack and push into the second stack, then pop from the second stack

  • Example: Enqueue 1,2,3 -> Stack1: [1,2,3], Dequeue -> Stack2: [3,2,1], Dequeue -> 1

Q95. what is AWS SQS and

Ans.

AWS SQS (Simple Queue Service) is a fully managed message queuing service that enables decoupling of components in a distributed system.

  • Used for storing messages in a queue before they are processed by a consumer

  • Supports distributed systems by enabling asynchronous communication between components

  • Helps in decoupling different parts of a system, improving scalability and fault tolerance

  • Messages can be stored in SQS for up to 14 days before being processed

Q96. Exceptions in selenium

Ans.

Exceptions in Selenium are errors that occur during test execution, such as ElementNotVisibleException or TimeoutException.

  • Selenium WebDriver throws exceptions when it encounters errors during test execution.

  • Common exceptions include NoSuchElementException, ElementNotVisibleException, TimeoutException, StaleElementReferenceException, and WebDriverException.

  • Handling exceptions in Selenium can be done using try-catch blocks or using TestNG annotations like @Test(expectedExcepti...read more

Q97. what is expected ctc

Ans.

Expected CTC is the anticipated salary package for the position.

  • Research industry standards for SDET roles

  • Consider your experience, skills, and location when negotiating CTC

  • Be prepared to discuss salary expectations during the interview process

Frequently asked in,

Q98. Api testing experience

Ans.

I have extensive experience in API testing, including designing test cases, executing tests, and analyzing results.

  • Experience in testing RESTful APIs using tools like Postman or SoapUI

  • Ability to write automated tests using frameworks like Selenium or JUnit

  • Understanding of API documentation and ability to create test plans based on it

Q99. Explain Hashmap and Hashset

Ans.

Hashmap and Hashset are data structures used in Java to store key-value pairs and unique elements respectively.

  • Hashmap is used to store key-value pairs where keys are unique and values can be duplicated.

  • Hashset is used to store unique elements only, no duplicates are allowed.

  • Hashmap uses hashing to store and retrieve elements efficiently.

  • Hashset internally uses Hashmap to store elements as keys with a dummy value.

Q100. Test cases on search option

Ans.

Test cases for search option functionality

  • Verify search results are displayed correctly

  • Test search with different input types (text, numbers, special characters)

  • Check search functionality with empty input

  • Test search with long input strings

  • Verify search results are sorted correctly

Previous
1
2
3
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

4.1
 • 4.9k Interviews
3.6
 • 2.3k Interviews
3.7
 • 866 Interviews
3.3
 • 737 Interviews
4.0
 • 308 Interviews
3.4
 • 83 Interviews
4.0
 • 70 Interviews
4.1
 • 24 Interviews
View all

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Sdet Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter