Sdet-I

20+ Sdet-I Interview Questions and Answers

Updated 13 Jul 2025
search-icon

Asked in Amazon

6d ago

Q. 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)

Asked in Amazon

5d ago

Q. 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

Asked in Amazon

5d ago

Q. What factors would you consider from both a developer's and user's perspective when developing a computer-aided competitive examination application like CAT or GMAT?

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

Asked in Amazon

4d ago

Q. Given a singly linked list, write a recursive method to reverse every 3 nodes in the list.

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?

Q. 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

Q. Write a Java program to find all palindrome strings from an 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

Sdet-I Jobs

DEUTSCHE TELEKOM DIGITAL LABS PRIVATE LIMITED logo
SDET-II- STB 4-6 years
DEUTSCHE TELEKOM DIGITAL LABS PRIVATE LIMITED
3.7
Gurgaon / Gurugram

Q. Write code to reverse a string while preserving the order of words.

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

Asked in Amazon

3d ago

Q. Write some test methods for stress testing of the 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

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in Amazon

5d ago

Q. 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

Asked in Amazon

2d ago

Q. Given an array, fill another array such that each element contains the next greater element in the original array, using a stack data structure.

Ans.

Use a stack to find the next greater element for each item in an array efficiently.

  • Initialize an empty stack and an output array of the same size as the input.

  • Iterate through the array from right to left.

  • For each element, pop elements from the stack until you find a greater element or the stack is empty.

  • If the stack is not empty, the top element is the next greater element; otherwise, it's -1.

  • Push the current element onto the stack for future comparisons.

  • Example: For input [4...read more

Asked in Amazon

1d ago

Q. Write a method to check whether two binary trees are mirrors of each other.

Ans.

Check if two binary trees are mirrors by comparing their structure and node values recursively.

  • Two trees are mirrors if their root nodes are equal.

  • The left subtree of one tree must be a mirror of the right subtree of the other tree.

  • Recursively check the left and right subtrees for both trees.

  • Example: Tree A (1, 2, 3) and Tree B (1, 3, 2) are mirrors.

Asked in Amazon

2d ago

Q. Write a method to print the boundaries of a binary tree.

Ans.

This method prints the boundary nodes of a binary tree in a specific order.

  • 1. Start from the root node and print it.

  • 2. Print the left boundary (excluding leaf nodes).

  • 3. Print all leaf nodes from left to right.

  • 4. Print the right boundary (excluding leaf nodes) in reverse order.

  • Example: For a tree with root 1, left child 2, right child 3, the output would be: 1, 2, 4, 5, 3.

Q. Write 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

Asked in Amazon

5d ago

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

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.

Asked in Cognizant

3d ago

Q. 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;

4d ago

Q. Given a binary string, how do you toggle 0s, 1s, and 2s?

Ans.

Toggle 0s to 1s, 1s to 0s, and 2s to 2s in a binary string.

  • Iterate through each character in the string.

  • If the character is '0', change it to '1'. Example: '010' -> '101'.

  • If the character is '1', change it to '0'. Example: '101' -> '010'.

  • If the character is '2', keep it as '2'. Example: '120' -> '120'.

  • Return the modified string after toggling.

Asked in Plivo

6d ago

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

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

Asked in Plivo

4d ago

Q. 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.

Asked in Info Edge

1d ago

Q. How do you create a table in a 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));

2d ago

Q. Build a framework from scratch using Appium.

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

Asked in Dunzo

5d ago

Q. I was given two matrices to solve. Can you elaborate on the problem?

Ans.

The problem involves solving a question related to two matrices, likely involving operations like addition, multiplication, or comparison.

  • Identify the dimensions of both matrices before performing operations.

  • For addition, both matrices must have the same dimensions (e.g., 2x2 + 2x2).

  • For multiplication, the number of columns in the first matrix must equal the number of rows in the second (e.g., 2x3 * 3x2).

  • Consider edge cases, such as empty matrices or matrices filled with zero...read more

3d ago

Q. How would you test a Facebook 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

Asked in Simplilearn

4d ago

Q. 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

Asked in Razorpay

6d ago

Q. Implement a 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

5d ago

Q. 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

Asked in ZNetLive

6d ago

Q. What is the difference between findElements and 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"));

Asked in Razorpay

3d ago

Q. 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

Asked in Razorpay

3d ago

Q. Given an unsorted array, find the median of it.

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 Experiences of Popular Companies

Infosys Logo
3.6
 • 7.9k Interviews
Amazon Logo
4.0
 • 5.4k Interviews
Deloitte Logo
3.7
 • 3k Interviews
Paytm Logo
3.2
 • 802 Interviews
Samsung Logo
3.9
 • 577 Interviews
View all

Top Interview Questions for Sdet-I Related Skills

interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Sdet-I Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits