# Oracle Gandhinagar Interview (3 Yrs Experienced)

All rounds Pen-paper coding.

1st Round

1. Given a file, Print All words which end with “ing” with their frequency
Condition: No inbuilt string function like substr split contains allowed.

Soln:
character by character need to take input, when space comes, check whether last 3 chars “ing”. If yes then from start to that index, add that word to hashmap(if new word), otherwise increase frequency of that word.
after space adjust start index and iterate.
at last when whole file input taken, iterate through Hashmap and print key and value.

2. Given a big string (contains numbers) and a divisor, Print all Subarray with 2 to 5 size which is exactly divided by divisor.
Ex: 1234804 and divisor 12,
From all these subarrays 12, 123, 1234, 12348, 23, 234, 2348, 23480, 34, 348, 3480, 34804, 48, 480, 4804, 80, 804, 04 those which are divided by 12, need to print those.
3.
Oops concepts
Overriding and Polymorphism conceptual questions.

2nd Round

1. You are given 100 normal coins and 1 faulty coin
Need to tell whether faulty has higher or lower weight using minimum weight comparisons.
I first give 3 answer and then explanation and then optimised using 2 comparisons we can do.

Discuss with interviewer. They will help if you speak and at some point of time you stuck.

2. https://www.geeksforgeeks.org/puzzle-9-find-the-fastest-3-horses/

3. Function to write whether mobile number fancy or not.
https://www.geeksforgeeks.org/check-if-a-given-mobile-number-is-fancy/
Only 1st 2 conditions are there.

3rd Round

Resume Discussion
Java version and New features Java 8 9
Hashmap and set basic
How we can create Thread 2 ways write code And Difference
Given a matrix, count maximum no. of consecutive 1’s.
Starting point can be anything. We can go left, right, top, down.
Ex.
0 0 1 1
1 0 1 0
0 0 1 1
0 0 0 1
ans: 6(0, 3 -> 0, 2 -> 1, 2 -> 2, 2 -> 2, 3 -> 3, 3)

Puzzle: http://mathsgogogo.co.uk/seewhatwehave/flashfiles/1176378481.swf.pdf
Cherry in the glass puzzle

4th round with Senior director

Package Discussion
Que: Given 13-MAR-2019 and n=40 means after adding 40 days to input date, we have 22-APR-2019.
No inbuilt Date function allowed.
Need to consider all cases, leap year or not, Monthwise days mapping(1->31, 4->30 etc), MAR->3, APR-4 mapping, 3-> MAR, 5->MAY mapping.
After that told that HR Will call you.

After Rejected from 20 different companies, got selected.

NEVER QUIT. APNA TIME AAYEGA.

Thanks to GeeksforGeeks for help.

Write your Interview Experience or mail it to contribute@geeksforgeeks.org

My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.