Sdet-I

20+ Sdet-I Interview Questions and Answers

Updated 5 Jul 2024

Popular Companies

search-icon

Q1. Given a binary tree, count the number of occurrences where there are two nodes with the same horizontal distance. To make it clearer, if we assume each node in a cell of a matrix, then count the number of occur...

read more
Ans.

Count occurrences of two nodes with same horizontal distance in a binary tree

  • Traverse the tree using BFS or DFS and keep track of horizontal distance of each node

  • Store nodes with same horizontal distance in a hash table and increment count if collision occurs

  • Recursively traverse left and right subtrees with updated horizontal distance

  • Time complexity: O(n), Space complexity: O(n)

Q2. Given an array and a number, check whether there are any 3 elements in the array which add up to the given number

Ans.

Check if any 3 elements in an array add up to a given number

  • Sort the array in ascending order

  • Use nested loops to iterate through all possible combinations of 3 elements

  • Check if the sum of the 3 elements equals the given number

  • Return true if a match is found, else false

Sdet-I Interview Questions and Answers for Freshers

illustration image

Q3. What are the things you will consider (both from Developer’s perspective and User perspective) while trying to develop an application for computer aided competitive examinations like CAT, GMAT etc

Ans.

Considerations for developing an application for computer aided competitive exams

  • User-friendly interface for easy navigation

  • Accurate and reliable question bank

  • Timed tests to simulate real exam conditions

  • Option to save and resume tests

  • Detailed performance analysis and feedback

  • Compatibility with different devices and operating systems

  • Regular updates and bug fixes

  • Developer should consider the security of the application to prevent cheating

  • User perspective: The application should...read more

Q4. Given a singly linked list, write a recursive method to reverse every 3 nodes in the list. I did not write a clean code for this. He moved on because of lack of time

Ans.

Reverse every 3 nodes in a singly linked list using recursion

  • Create a recursive function that takes in a node and a count

  • If count is less than 3, return the node

  • Reverse the first 3 nodes and call the function recursively with the 4th node and count 1

  • Connect the reversed nodes to the rest of the list

  • Return the new head of the reversed list

Are these interview questions helpful?

Q5. Write a java program to add the digits of a given number?

Ans.

Java program to add digits of a given number

  • Convert the number to a string

  • Iterate through each character and convert it back to an integer

  • Add all the integers together

Q6. Write a java program to find tall pallindrome Strings from array of strings?

Ans.

Java program to find tall palindrome strings from an array of strings

  • Loop through the array of strings

  • Check if each string is a palindrome

  • Keep track of the tallest palindrome strings found

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. Write a code to reverse a string by preserving its word's position?

Ans.

Code to reverse a string while preserving word positions

  • Split the string into words using space as delimiter

  • Reverse the order of words

  • Join the words back into a string with space as delimiter

Q8. Write some test methods for stress testing of Furniture class

Ans.

Test methods for stress testing of Furniture class

  • Create a large number of Furniture objects and check for memory leaks

  • Simulate heavy usage by continuously calling methods and check for performance issues

  • Test the Furniture class with maximum allowed input values and check for any errors or crashes

Sdet-I Jobs

SDET-IV 1-6 years
Mobinius Technologies Pvt Ltd
3.7
Bangalore / Bengaluru

Q9. Given a linked list, write a program to check if it is a palindrome

Ans.

Program to check if a linked list is a palindrome

  • Traverse the linked list and push each element onto a stack

  • Traverse the linked list again and compare each element with the top of the stack

  • If all elements match, the linked list is a palindrome

Q10. Write a code to print all the main diagonal elements of a given 2D array.

Ans.

Code to print main diagonal elements of a 2D array

  • Loop through rows and columns of the array

  • Print elements where row index equals column index

Q11. Given a number, find the nearest perfect square(modified binary search)

Ans.

Given a number, find the nearest perfect square using modified binary search.

  • Start with low=0 and high=num.

  • While low<=high, find mid=(low+high)/2.

  • If mid*mid==num, return mid.

  • If mid*mid

  • If mid*mid>num, update high=mid-1.

  • Return the closest perfect square to num.

Q12. what is the difference between delete and truncate?

Ans.

Delete removes specific rows from a table while truncate removes all rows from a table.

  • Delete is a DML command while truncate is a DDL command.

  • Delete can be rolled back while truncate cannot be rolled back.

  • Delete is slower than truncate as it logs each row deletion while truncate does not.

  • Delete can have a WHERE clause to specify which rows to delete while truncate deletes all rows.

  • Example: DELETE FROM table_name WHERE column_name = value;

  • Example: TRUNCATE TABLE table_name;

Q13. Reverse a string and maintain the special character and space positions

Ans.

Reverse a string while preserving the positions of special characters and spaces.

  • Iterate through the string from both ends using two pointers

  • Swap characters if both are alphabets or both are special characters

  • Continue until the pointers meet in the middle

Q14. write a program to determine if given strings are an anagram

Ans.

A program to determine if given strings are an anagram.

  • Convert each string to lowercase and remove any non-alphabetic characters.

  • Sort the characters in each string.

  • Compare the sorted strings to check if they are equal.

Q15. how do you create a table in database?

Ans.

To create a table in a database, use the CREATE TABLE statement.

  • Specify the table name and column names with their data types.

  • Add any constraints or rules for the table.

  • Example: CREATE TABLE customers (id INT, name VARCHAR(50), email VARCHAR(100));

Q16. Build a fransision from scratch usingappium.

Ans.

To build a framework from scratch using Appium for automated testing of mobile applications.

  • Set up Appium server and desired capabilities

  • Create test scripts using Appium commands

  • Implement page object model for better organization

  • Use assertions to validate test results

  • Integrate with CI/CD tools for continuous testing

  • Handle different types of locators for elements

  • Implement error handling and reporting mechanisms

Q17. How will test a FB login page

Ans.

To test a FB login page, I would verify functionality, security, and compatibility.

  • Verify login functionality by entering valid and invalid credentials

  • Test for security by checking for SSL encryption, password hashing, and account lockout

  • Ensure compatibility by testing on different browsers and devices

Q18. Multithreading and details conpt in java

Ans.

Multithreading in Java allows multiple threads to execute concurrently, improving performance and responsiveness.

  • Multithreading in Java is achieved by extending the Thread class or implementing the Runnable interface.

  • Threads share the same memory space, so synchronization is necessary to prevent data corruption.

  • Java provides synchronized keyword, locks, and atomic classes for thread synchronization.

  • Concurrency issues like deadlock, race conditions, and thread interference can...read more

Q19. Implement Stack class in java.

Ans.

Implement Stack class in Java.

  • Create a class with an array to store elements

  • Implement push() method to add elements to the stack

  • Implement pop() method to remove and return top element

  • Implement peek() method to return top element without removing

  • Implement isEmpty() method to check if stack is empty

Q20. Framework design for Appium automation.

Ans.

Appium automation framework design involves selecting programming language, test framework, page object model, and reporting tools.

  • Select programming language (e.g. Java, Python) for writing test scripts

  • Choose test framework (e.g. TestNG, JUnit) for organizing and executing tests

  • Implement page object model for better code maintainability and reusability

  • Integrate reporting tools (e.g. ExtentReports, Allure) for generating test reports

Q21. findElements vs findElement

Ans.

findElements returns a list of web elements matching the locator, while findElement returns the first matching element.

  • findElements is useful when there are multiple elements with the same locator

  • findElement throws NoSuchElementException if no element is found

  • findElements returns an empty list if no element is found

  • Example: List links = driver.findElements(By.tagName("a"));

  • Example: WebElement username = driver.findElement(By.id("username"));

Q22. water level problem

Ans.

Water level problem - how to measure water level in a tank?

  • Use a water level sensor

  • Install a float switch

  • Use a pressure sensor

  • Measure the weight of the water in the tank

  • Use ultrasonic sensors to measure the distance between the water surface and the top of the tank

Q23. median from an array

Ans.

Finding the median value from an array of strings.

  • Sort the array in ascending order

  • If the array length is odd, return the middle element

  • If the array length is even, return the average of the middle two elements

Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions for Sdet-I Related Skills

Interview experiences of popular companies

3.7
 • 7.3k Interviews
4.1
 • 4.9k Interviews
3.8
 • 2.8k Interviews
3.3
 • 737 Interviews
4.0
 • 536 Interviews
4.0
 • 308 Interviews
3.6
 • 145 Interviews
3.2
 • 98 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-I 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