Sdet
100+ Sdet Interview Questions and Answers

Asked in Microsoft Corporation

Q. Given an M x N 2D array containing random alphabets and a function Dict(string word) which returns whether the 'word' is a valid English word, find all possible valid words you can get from the 2D array, where...
read moreGiven a 2D array of alphabets and a function to check valid English words, find all possible valid words adjacent to each other.
Create a recursive function to traverse the 2D array and check for valid words
Use memoization to avoid redundant checks
Consider edge cases such as words with repeating letters
Optimize the algorithm for time and space complexity

Asked in InMobi

Q. Given a line where words are separated by spaces, reverse each word and capitalize its first letter. The other letters of the word should be in lowercase. For example, Input: “how are you?” → Output: “Woh Era ?...
read moreThe program takes a string as input and capitalizes the first letter of each reversed word while keeping the rest of the letters in lowercase.
Split the input string into an array of words using the space as a delimiter
Iterate through each word in the array
Reverse the word and capitalize the first letter
Join the modified words back into a single string with spaces in between
Sdet Interview Questions and Answers for Freshers

Asked in Amazon

Q. What happens between entering a URL into a browser address bar and the page loading?
When entering a URL and hitting enter, the browser performs DNS lookup, establishes a TCP connection, sends an HTTP request, receives the response, and renders the page.
Browser performs DNS lookup to resolve the domain name to an IP address
Browser establishes a TCP connection with the server
Browser sends an HTTP request to the server
Server processes the request and sends back an HTTP response
Browser receives the response and starts rendering the page

Asked in Microsoft Corporation

Q. Given a circular linked list containing sorted integers, where the head points to a random node, write code to insert a new node at its correct sorted position. For example, given the list 34, 44, 67, 99, 3, 17...
read moreInsert a node at its correct position in a circular linked list containing sorted elements.
Traverse the linked list until the correct position is found
Handle the case where the value to be inserted is smaller than the smallest element or larger than the largest element
Update the pointers of the neighboring nodes to insert the new node
Consider the case where the linked list has only one node

Asked in Flipkart

Q. Given a sorted array of size 7 containing only 4 elements and another sorted array of 3 elements, how would you merge the elements from the second array into the first array while maintaining the sorted order?
Combine 4 elements of a sorted array of size 7 and a sorted array of 3 elements to make a sorted array.
Insert the 3 elements of the smaller array into the larger array
Sort the larger array using any sorting algorithm

Asked in Amazon

Q. how will you check that each page of amazon.com is having its logo or not.he also asked me to write code for this also
To check if each page of Amazon.com has its logo, we can use automated testing with Selenium WebDriver.
Use Selenium WebDriver to navigate to each page of Amazon.com
Locate the logo element on each page using its XPath or CSS selector
Verify that the logo element is displayed on each page
Sdet Jobs




Asked in InMobi

Q. Given two sets of countries, one donating clothes and the other accepting, and the amount of clothes donated, maximize the total amount of clothes donated such that there is a one-to-one relationship between co...
read moreMaximize clothes donation between two sets of countries with one-to-one relationships.
Identify countries in set 1 and set 2.
Create a graph where edges represent donations between countries.
Use a maximum bipartite matching algorithm (e.g., Hopcroft-Karp) to find optimal pairs.
Calculate total donations based on matched pairs.
Example: If country A donates to country B, ensure A doesn't donate to another country.

Asked in Google

Q. How to design a search engine? If each document contains a set of keywords, and is associated with a numeric attribute, how to build indices?
To design a search engine with keyword-based document indexing and numeric attributes, we need to build appropriate indices.
Create an inverted index for each keyword, mapping it to the documents that contain it
For numeric attributes, use a B-tree or other appropriate data structure to store the values and their associated documents
Combine the indices to allow for complex queries, such as keyword and attribute filters
Consider using stemming or other text processing techniques ...read more
Share interview questions and help millions of jobseekers 🌟

Asked in Microsoft Corporation

Q. Describe how the McDonald's system works, starting from placing the order, transferring the order to the kitchen, billing, and the final delivery to the customer, in terms of data structures used, information v...
read moreMcDonald's order system involves structured data flow from order placement to delivery, ensuring efficiency and accuracy.
1. Customer places an order using a digital kiosk or cashier, which captures order details in a structured format (e.g., JSON).
2. The order is sent to the kitchen display system (KDS), where it is displayed for kitchen staff to prepare.
3. The KDS organizes orders based on priority and preparation time, using a queue data structure.
4. Billing is processed at...read more

Asked in Microsoft Corporation

Q. Design data structures to delete pages from a web server that are no longer in existence, have no links on the website, have expired, are no longer in use, and have no reference on any of the pages on the curre...
read moreDesign a data structure to efficiently manage and delete expired web pages without references.
Use a hash table to store active pages with their URLs as keys for quick access.
Implement a linked list to maintain the order of pages for easy deletion of expired pages.
Utilize a timestamp to track the last access time of each page, allowing for easy identification of expired pages.
Consider a garbage collection mechanism that periodically scans for and removes pages with no referenc...read more

Asked in Google

Q. Most phones now have full keyboards. Before, there were three letters mapped to a number button. Describe how you would implement spelling and word suggestions as people type.
Implement spelling and word suggestions for full keyboard phones
Create a dictionary of commonly used words
Use algorithms like Trie or Levenshtein distance to suggest words
Implement auto-correct feature

Asked in Amazon

Q. You are given an application like Google Analytics. How will you test this application?
Testing Google Analytics involves validating data accuracy, user interface, performance, and integration with other tools.
Verify data accuracy by comparing reported metrics with raw data from the source.
Test user interface for usability and accessibility, ensuring all elements are intuitive.
Conduct performance testing to ensure the application can handle high traffic without degradation.
Check integration with other tools (e.g., Google Ads) to ensure data flows correctly betwe...read more

Asked in Amazon

Q. What are the basic features you would add to your own test framework?
A test framework should have features like test case management, test data management, reporting, and integration with CI/CD tools.
Test case management: Ability to create, organize, and execute test cases.
Test data management: Ability to manage test data and generate test data sets.
Reporting: Ability to generate detailed test reports with metrics and logs.
Integration with CI/CD tools: Ability to integrate with tools like Jenkins for continuous integration and delivery.
Paralle...read more

Asked in Amazon

Q. Have you worked on any automation framework?
Yes, I have worked on automation frameworks.
I have experience in developing and maintaining automation frameworks using tools like Selenium, TestNG, and Cucumber.
I have also worked on customizing existing frameworks to meet specific project requirements.
I am familiar with both data-driven and keyword-driven frameworks.
I have integrated automation frameworks with CI/CD pipelines for continuous testing.
One example of a project where I worked on an automation framework was for a...read more

Asked in Flipkart

Q. How do you determine if a string is a palindrome?
To check if a string is a palindrome, compare the first and last characters, then move towards the center.
Remove all non-alphanumeric characters and convert to lowercase
Use two pointers, one starting from the beginning and the other from the end
Compare the characters at both pointers, move towards the center until they meet
If all characters match, the string is a palindrome

Asked in Flipkart

Q. Given a table of student names and grades, output a table containing each grade and its frequency in descending order.
Calculate the frequency of each grade from a student table and sort it in descending order.
Use SQL query: SELECT grade, COUNT(*) as frequency FROM students GROUP BY grade ORDER BY frequency DESC.
Example table: | Name | Grade | |-------|-------| | Alice | A | | Bob | B | | Carol | A |
Resulting output: | Grade | Frequency | |-------|-----------| | A | 2 | | B | 1 |

Asked in Google

Q. Given an array of integers that is circularly sorted, how do you find a given integer?
To find a given integer in a circularly sorted array of integers.
Find the pivot point where the array is rotated
Perform binary search on the two sorted subarrays
Return the index of the found integer

Asked in Bharti Airtel

Q. How do you achieve parallel execution of test cases in TestNG?
Parallel execution of test cases in TestNG can be achieved using TestNG's parallel attribute in the testng.xml file.
Set the 'parallel' attribute in the testng.xml file to 'methods', 'classes', or 'tests' to specify the level of parallelism.
Use the 'thread-count' attribute to specify the number of threads to be used for parallel execution.
Ensure that the test classes are thread-safe to avoid any conflicts during parallel execution.

Asked in Amazon

Q. You are given a web page with a browse button and an image holder. Write the test cases for this.
Test cases for a web page with a browse button and an image holder.
Verify that the browse button is displayed on the page.
Check that the image holder is empty before any image is uploaded.
Test uploading a valid image file and ensure it appears in the image holder.
Attempt to upload an invalid file type (e.g., .txt) and verify an error message is shown.
Ensure that the image holder can display various image formats (e.g., .jpg, .png).
Check the maximum file size limit for uploads...read more

Asked in Bharti Airtel

Q. Write test cases for an API that creates a user profile by accepting first name, last name, and mobile number.
Test cases for API creating User's profile with First name, Last name, and mobile number
Verify that a user profile is created successfully with valid First name, Last name, and mobile number
Test with invalid First name (empty, special characters, numbers)
Test with invalid Last name (empty, special characters, numbers)
Test with invalid mobile number (empty, alphabets, special characters, less than 10 digits)
Verify that duplicate profiles are not created for the same mobile num...read more

Asked in Google

Q. What kind of data structure would you use to index anagrams of words? For example, if the word 'top' exists in the database, a query for 'pot' should list it.
Use a hash map to index anagrams by sorting characters as keys.
Create a hash map where the key is the sorted string of characters.
For example, 'top' and 'pot' both map to 'opt'.
Store all anagrams in a list associated with the sorted key.
When querying, sort the input word and retrieve the list from the map.

Asked in Amazon

Q. Given a singly linked list, write a recursive method to reverse every 3 nodes in the list. He asked me to inform if I have seen the question
Reverse every 3 nodes in a singly linked list using recursion.
Create a recursive method that takes the head of the linked list as input.
If the head is null or there are less than 3 nodes remaining, return the head.
Reverse the first 3 nodes by swapping their pointers.
Recursively call the method on the next 3 nodes and update the pointers accordingly.
Return the new head of the reversed linked list.

Asked in Google

Q. How would you determine if someone has won a game of tic-tac-toe on a board of any size?
To determine if someone has won a game of tic-tac-toe on a board of any size, we need to check all possible winning combinations.
Create a function to check all rows, columns, and diagonals for a winning combination
Loop through the board and call the function for each row, column, and diagonal
If a winning combination is found, return the player who won
If no winning combination is found and the board is full, return 'Tie'
If no winning combination is found and the board is not f...read more

Asked in Bharti Airtel

Q. What are the reasons for a 500 Internal Server Error?
500 Internal Server Error is a generic error message indicating a problem with the server.
Server misconfiguration
Server overload
Programming errors in server-side code
Database connection issues
Insufficient server resources

Asked in Microsoft Corporation

Q. Design an algorithm for a new type of contact search application for mobile phones.
Design an algorithm for a mobile contact search application that enhances user experience and efficiency.
Utilize a trie data structure for efficient prefix searching of contact names.
Implement fuzzy search to handle typos or partial matches, e.g., searching 'Jon' returns 'John'.
Incorporate filters for sorting results by frequency of contact usage or recent interactions.
Allow voice search functionality for hands-free access, e.g., 'Call Mom'.
Provide suggestions based on user b...read more

Asked in Google

Q. Given two files containing a list of words (one per line), write a program to find and display the intersection of the words in both files.
Program to find intersection of words in two files
Read both files and store words in two arrays
Loop through one array and check if word exists in other array
Print the common words

Asked in Amazon

Q. What is the maximum length of a contiguous sub-array containing distinct elements in a given character array?
Find the maximum subsequent distinct and contiguous subarray in a character array.
Use a sliding window approach to iterate through the array.
Keep track of the distinct characters in the current subarray.
Update the maximum length and subarray as necessary.

Asked in Flipkart

Q. How do you determine if two given linked lists intersect?
To find if two linked lists intersect, traverse both lists and compare their tail nodes.
Traverse both linked lists and find their lengths
If the lengths are different, move the longer list's head pointer to the difference in length
Now traverse both lists and compare their nodes until a common node is found
If no common node is found, the lists do not intersect

Asked in Bharti Airtel

Q. Write a program to reverse the order of words in a given string. For example, if the input is "My name is abc", the output should be "abc is name My".
Program to reverse words in a string
Split the input string into an array of words
Reverse the array of words
Join the reversed array back into a string

Asked in Microsoft Corporation

Q. How would you design the database for Facebook?
Facebook's database design focuses on scalability, user relationships, and efficient data retrieval.
User Profiles: Each user has a unique profile containing personal information, posts, and friend connections.
Social Graph: A graph database structure to represent relationships between users, allowing for efficient querying of friends and connections.
Posts and Interactions: Tables for storing posts, likes, comments, and shares, enabling quick access to user-generated content.
Ne...read more
Interview Experiences of Popular Companies





Top Interview Questions for Sdet Related Skills



Reviews
Interviews
Salaries
Users

