"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

July 02, 2009

SDET Interview Questions


This is one of Top posts in my blog. Please find compiled list of posts. Also you can refer to Programming Problem's link section which has several bookmarked sites.

Basic Interview Questions for SDET/QA Roles

1. How do you test online banking Application.
2. Different ways to find duplicate element in an array
3. I put two bullets in two adjacent chambers of a six shot revolver. I point it at your head and pull the trigger. Click. You are still alive. The chamber has advanced by one. I am prepared to try again. Is it better for you If I spin again ?
4. One number missing from sequence 1 to n. (Sorted Array). Use the formula n(n+1)/2 and subtract with acquired sum. The missing number would be found.
5. Program to Reverse words in a sentence

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
static class WordTools
{
/// <summary>
/// Receive string of words and return them in the reversed order.
/// </summary>
public static string ReverseWords(string sentence)
{
string[] words = sentence.Split(' ');
foreach (string str in words)
{
    Console.WriteLine("Word is: " + str);
}
Array.Reverse(words);
return string.Join(" ", words);
}
}
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
    const string s1 = "Bill Gates is the richest man on Earth";
    const string s2 = "Srinivasa Ramanujan was a brilliantwor mathematician";
    string rev1 = WordTools.ReverseWords(s1);
    Console.WriteLine(rev1);
   string rev2 = WordTools.ReverseWords(s2);
   Console.WriteLine(rev2);
   Console.ReadKey();
}
}
}
Reference - Link. I followed the code presented in the link. I added a for loop to publish word in ReverseWords function

6. Given a singly linked list that consists of 'R' and 'B' values only. Write a C function to find the maximum subsequence length of any color. What is the time complexity of your function ?
Input: R B R B B R R R R B B B R
Output: 4
Int FindMaxSeq (List I)
{
    List p, q, head, r;
    int count, max, cvalue;
    p = I; head = p; count = 0, cvalue = 0, max = 0;
    while(p)
    {
        q = p->value;
         r = q->next;
        if(q->value = r->value)
        {
            count++;
         }
         else
         {
           cvalue = count;
           if (cvalue > max)
           {
                max = cvalue;
           }
           count = 0;
         }
       p++;
     }
    return max;
}

7. What is a Priority Queue (Heaps) ?
Priority queue is a data structure which allows at least following two operations. Insert, DeleteMin - Finds, Returns minimum element in the priority queue. Insert - Enqueue, Deletemin - Dequeue.

8. Binary Tree - Tree in which no node can have more than two children

9. AVL Trees (Adelson-Velski and Landis) Tree. AVL tree is identical to a Binary Search Tree, except that for every node in the tree, the height of the left and right subtrees can differ by at most 1

10. Longest Palindrome sub-sequence. Dynamic Programming Problem
Longest palindrome in a string
Longest palindrome in a string





Few other Answers
Option#1
1. Original string is A
2. Reverse string is B
3. Find common strings are C, D, E ....
4. Find palindromic strings in step 3, suppose C, D.
5. Find the max length of strings in step 4. Return.

Solutions Explained
http://en.wikipedia.org/wiki/Longest_common_substring_problem
http://www.iarcs.org.in/inoi/contests/feb2005/Advanced-1-solution.php
http://dsalgo.blogspot.com/2006/08/longest-palindrome.html
http://www.solvemyproblem.net/Webed/contentfiles/attach/Dynam63_86182.pdf

11. Program for Binary Search in C.
O(log N)
int BinarySearch (int a[ ], int x, int N)
{
    int mid, low, high;
    low = 0; high = N-1;

    {
        mid = (low+high) / 2;
        if( a[mid] < x)
            low = mid+1;
        else
            if(a[mid] > x)
                high = mid-1;
            else
                return mid; /* Found */
    }
    return -1; /* Not Found*/
}

SQL Developer Interview Questions
  • Top 5 Code Review Checks
    • NOLOCK, Coding Standards, Seeks for Execution Plan, SET Based Operations, SET NOCOUNT ON, TRY-CATCH Error Handling
  • Troubleshoot slow running procedure
  • Database Design for School (Marks, Teachers, Subjects, Class)...Check candidate ability to identify tables, primary keys, Normalization of identified tables
  • Generating Primenumber using TSQL
Aptitude Test Problems
1. If a,b,c, d are four positive real numbers such that abcd = 1, what is the minimum value of (1+a)(1+b)(1+c)(1+d). Ans - 16
2. A change making machine contains 1 Rs, 2 Rs, 5 Rs coins. The total number of coins is 300. The amount is Rs.960. If the number of 1 Rs and 2 Rs coins are interchanged the value comes down by 40. The total number of 5 Rs coin is
      x + y + z = 300
      2x + y + 5Z = 920
      x + 2y + 5Z = 960
            z = 140
3. A red light flashes 3 times per minute and green light flashes 5 times per 2 minutes at regular intervals. If both start flashing at same time, how many times do they flash together each hour ?
          Red Light = 60/3 secs = Every 20 Secs
          Green Light = 120/5 Secs = 24 Secs
          LCM is 120, Every 2 Minutes
          Every Hour = 60/2 = 30 times flash together
 4. A takes 3 hours longer than B to walk for 30 kms. But if he doubles his speed he takes 2 hrs less than B. What is B's speed in kmph.
Let t be the time taken by B to travel 30 Kms
Speed of B = 30 / t
Speed of A = 30 / t+3
By data,
2(30/(t+3)) = 30/(t-2)
t = 7
Speed of B = 30/7 kmph

Good Resumes
Tips for Writing Good Resume - Great Resumes for Software Engineers
Very Good Read How to Get Your Dream Job

Books and References
  • Cracking The Coding Interview: 150 Programming Questions And Solutions by Gayle Laakmann McDowell
  • Data Structures And Algorithms Made Easy: Data Structure And Algorithmic Puzzles  by Narasimha Karumanchi
  • More References - Link1, Link2, Link3 and Link4
Good Read
Online GATE Coaching - Found this useful. Good If I had enrolled for it a decade ago :). Link

Another good read from link. Hacking a Google Interview, MIT Materials. Please check the link

Good Learning Projects

More Reads

Behavioral Questions - The Master List


Good Luck for Your Preparation. Please feel free to suggest additional links for the post.


Read Quote of Neel Hajare's answer to Programming Interviews: What types of technical questions are asked in developer interviews? on Quora

Read Quote of Manas J Saloi's answer to What's the best way to prepare for job interviews? on Quora

Read Quote of Rahul Kumar's answer to Job Interviews: What are the standard puzzles asked in programming interviews? on Quora

Read Quote of Nishant Neeraj's answer to Career Advice: What are the career oriented hobbies/interests a mechanical engineer should have? on Quora

Read Quote of Alon Amit's answer to How do you impress a technical interviewer? on Quora

Read Quote of Martin Michelsen's answer to Computer Programming: What are some programs every programmer should make at least once? on Quora

Read Quote of Matthew Mirman's answer to Computer Programming: What are some programs every programmer should make at least once? on Quora

Read Quote of Dima Korolev's answer to Learning to Program: How can I become a world-class coder in under three years? on Quora

Read Quote of Ambra Benjamin's answer to What reply does the interviewer expect when he asks "do you have any questions for us"? on Quora

Read Quote of Gayle Laakmann McDowell's answer to Gayle Laakmann McDowell (author): What are Gayle Laakmann McDowell's top resume evaluation answers? on Quora

C Resume
Great Resumes link1, link2, link3


Read Deepak Mehta's answer to What are some tips & tricks I should know before going to an Interview? on Quora

Happy Reading, Happy Coding and Learning!!!

No comments: