Technical Interview

Technical Interview
Interview Process
Introduction Questions
Quantitative Problems
Google & Microsoft
Object Oriented
C/C++ Questions
Java Questions
Data Structures
Fundamental Questions
Resume Tips
Added Recently
Contact Us
Submit Question/Answer


Implement the body of the following function using a binary search of the array. You do not need to check the precondition.   

public static boolean has42(int[ ] data, int start, int end)

    // Precondition: The elements data[start][end] are sorted from smallest

    // to largest. This array segment might be empty (indicated by end being less

    // than start).

    // Postcondition: A true return value indicates that the number 42 appears in

    // data[start][end]. A false return value indicates that 42 doesn’t 

    // appear.