Technical Interview

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

 

Suppose that I have the following declarations:
    int[ ] data = new int[100];

    int i;

Write a small segment of Java code that will shift data[50]...data[98] up one spot to the locations data[51]...data[99]. Then insert the number 42 at location data[50]. Use a for loop (not System.arraycopy).

 

Solutions: