Oracle Interview Questions
- 1of 1 vote
AnswersReplace each number by its next bigger number from right side of current index. if no bigger number found print that number itself.
- SRC December 19, 2018 in India
Eg: 2,5,9,6,3,4,8,15,12
OutPut : 3,6,12,8,4,8,12,15,12| Report Duplicate | Flag | PURGE
Oracle Backend Developer - 0of 0 votes
AnswersRound 3- Find the first duplicate occurence of a number in an array
- prashant.tah July 03, 2018 in India| Report Duplicate | Flag | PURGE
Oracle Senior Software Development Engineer Java - 0of 0 votes
AnswersRound 3 - puzzle-there are 8 coins out of which 1 coin is faulty.The faulty coin has a lesser weight than the rest of coins which all have the same weight.You have been given a weighing balance with a pulley.Find the faulty coin
- prashant.tah July 03, 2018 in India| Report Duplicate | Flag | PURGE
Oracle Senior Software Development Engineer Puzzle - 0of 0 votes
AnswersRound 3 - Write a java program to print a matrix in spiral
- prashant.tah July 03, 2018 in India| Report Duplicate | Flag | PURGE
Oracle Senior Software Development Engineer Java - 0of 0 votes
AnswersRound 2 - Write a java program to determine if a 10 digit number is magic number.A number is magic number if it has all digits between 1 to 6 occuring in it or if it has any number between 0 to 9 occuring thrice or if it contains three consecutilvely increasing or decreasing digits differing by 1 example 345 or 543
- prashant.tah July 03, 2018 in India| Report Duplicate | Flag | PURGE
Oracle Senior Software Development Engineer Java - 0of 0 votes
AnswersRound 2 - write java code to create the following pattern
- prashant.tah July 03, 2018 in India
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *| Report Duplicate | Flag | PURGE
Oracle Senior Software Development Engineer Java - 0of 0 votes
AnswersRound 1-question 1 - given an array of stock prices for n days.Write an algorithm to maximize the profit of a customer such that he can buy and sell only once.
- prashant.tah July 03, 2018 in India
-Question 2
Prove that complexity for searching in arraylist is o(n)
and adding is o(1)| Report Duplicate | Flag | PURGE
Oracle Senior Software Development Engineer Java - 0of 0 votes
Answerswrite java code to create the following pattern
- prashant.tah July 03, 2018 in India
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *| Report Duplicate | Flag | PURGE
Oracle Senior Software Development Engineer Java - 0of 0 votes
AnswerRound 2- puzzle given 4 pair of socks of different colors(Red,green,blue and yellow)
- prashant.tah July 03, 2018 in India
Arrange the socks in such a way such that there are exacly 4 socks between the yellow socks,3 between the red ones and 2 between the green| Report Duplicate | Flag | PURGE
Oracle Senior Software Development Engineer - 0of 0 votes
AnswersRound 1-Question 2
- prashant.tah July 03, 2018 in India
Prove that complexity for searching in arraylist is o(n)| Report Duplicate | Flag | PURGE
Oracle Senior Software Development Engineer - 0of 0 votes
AnswersRound 1-Question 1
- prashant.tah July 03, 2018 in India
1)Given an array of stock prices for 7 continuous days.Write an algorithm to maximize the profit for a customer who buys stock on any day and sells it later.Buying and selling can happen only once and selling should happen on any day after buying| Report Duplicate | Flag | PURGE
Oracle Senior Software Development Engineer Java - 0of 0 votes
AnswersConsider a game similar to tennis. The game can be palyed by 'N' number of players. The player has to win atleast 'M' games to win a set.
- kumar June 05, 2018 in United States
Print all the possible combination of winning set for all the payers.
Where
2 <= N
1 <= M
For Example if [A, B] are the players and
if M = 2 The player has to win atleast '2' games to win a set.
The output will be
A A
A B A
B A A
B B
B A B
A B B
if M = 3 The player has to win atleast '3' games to win a set.
The output will be
A A A
A B A A
A A B A
B A A A
B B B
B A B B
B B A B
A B B B
Write an algorithm to print all the possible combination of winning set for all the payers| Report Duplicate | Flag | PURGE
Oracle Software Developer - 0of 0 votes
AnswersGenarate and validate a magic matrix.A magic matrix is one in which the sum of every row,column,and every diagonal is same.One such matrix will be when every element in the matrix is same.generate and validate a magic matrix where every element is not the same
- prashant.tah September 27, 2017 in India| Report Duplicate | Flag | PURGE
Oracle Software Developer - 1of 1 vote
Answershow to create an object on the stack.
- Giri February 10, 2017 in India
and also make sure that only 5 objects are created for the class| Report Duplicate | Flag | PURGE
Oracle SDE-2 C++ - 9of 9 votes
AnswersGiven a random function with equal probability of getting 1 or 0 ie 50% each. write a custom function which uses the above random function such that your function should return 1 with 75% probability and 0 with 25% probability
- coolcoder3 July 22, 2016 in India| Report Duplicate | Flag | PURGE
Oracle Software Developer Algorithm Problem Solving - 0of 0 votes
Answergiven an arraylist of say 50 lac entries and an empty queue, Design a multi-threading bases system which can copy the items in arraylist in a queue parallely
- avidwaj June 12, 2016 in India
How many threads can be spawned based on what criterion ? Basically the interviewer wanted to know how to implement an algorithm where we can design number of threads to be spawned ?| Report Duplicate | Flag | PURGE
Oracle Software Developer design - 0of 0 votes
AnswersDesign a system java same as relational database.
For example,
You Have employee table as bellow:ID | Name | Manager | Salary
Now you can execute queries like :
select * from Employee where ID= ' something' select * from Employee where Name= ' something' select * from Employee where salary = ' something'
In same way you have a class Emplyee as bellow:
class Employee { String ID; String Name; String Salary; String Manager; }
Now I want to query on this class as same as the sql queries above,
- Ghosh August 17, 2015 in India
How can I do it efficiently?
The code should be optimized on time complexity and space complexity.| Report Duplicate | Flag | PURGE
Oracle Software Architect Algorithm Data Structures Java Object Oriented Design - 0of 0 votes
AnswersInput Parser and Processor
- rameshelworthy July 04, 2015 in India
Problem
Implement a java program for querying data from a java object. Java object need to be constructed based on text data provided to program.
The parser should be generic to parse any input confirming to the hierarchical format similar to the one mentioned in sample
The Content of the file
[employee]
name=john
age=30
salary=100
[address]
houseno=221b
street=bakerstreet
[location]
place=xyz
state=abc
country=123
[/location]
[/address]
designation = srDeveloper
[/employee]
Sample Input and Output
employee.name Output John
employee.address.houseno Output 221b
employee.address.location.state Output abc
employee.manager Output NOT_FOUND
The program should work any object data specified as input file.| Report Duplicate | Flag | PURGE
Oracle Java Developer Data Structures - 1of 1 vote
AnswersDesign and implement LRU Cache.
- rustyCoder June 04, 2015 in United States| Report Duplicate | Flag | PURGE
Oracle Software Engineer / Developer Algorithm - 0of 0 votes
AnswersIdentify the output
- SantoshSingh June 02, 2015 in IndiaClass A { } Class B { } B b = new B(); A a = (A) b; sysout(b.getClass()); sysout(a.getClass());
| Report Duplicate | Flag | PURGE
Oracle SDE-2 - 0of 0 votes
AnswersGiven Two classes A & B. How will B know if an instance of A is already created?
- SantoshSingh June 02, 2015 in India| Report Duplicate | Flag | PURGE
Oracle SDE-2 Java - 0of 0 votes
AnswersMark likes to listen to music while travelling. His iPod™ contains N songs and he wants to listen to L (not necessarily different) songs during a trip. So he creates a playlist such that:
- rashmishrikant.patil February 06, 2015 in India
• Every song is played at least once.
• A song can be played again only if at least K other songs have been played
Mark wants to know how many different playlists are possible. Can you help Mark determine this number? As the number can be very large, display number modulo 1,000,000,007.
You are given N, K and L.| Report Duplicate | Flag | PURGE
Oracle Applications Developer Algorithm - 0of 0 votes
AnswersMr. Xhas recently shut down his factory and wants to sell off his metal rods to a local businessman. Mr. Octopus has many rods whose length are represented by array - lengths = {lengths[0], lengths[1], lengths[2], ...}.
- rashmishrikant.patil February 05, 2015 in India
The local businessman will only pay for rods that have same length. Let's say Mr. Octopus plans to sell rods of lengthL only. Then he had to cut each rod 0 or more time, so that he can maximize the profit. The remaining rods whose length is not L will be thrown away. Price of N rods of length L will be N × L × unit_price. Also note that for each cut made to a rod, he had to pay cut_cost.
What is the maximum amount of money Mr. Octopus can make? You have to complete the function int maxProfit(int cut_cost, int unit_price, int[] lengths).
Constraints
• lengths will contain between 1 to 50 elements, inclusive.
• Each element of lengths will lie in range [1, 10,000].
• 1 ≤ unit_price, cut_cost ≤ 1,000.
Sample Input #1:
cut_cost = 1
unit_price = 10
lengths = [26, 103, 59]
Sample Output #1:
1770| Report Duplicate | Flag | PURGE
Oracle Developer Program Engineer Algorithm - 2of 2 votes
AnswersGot this sh***y problem.
- Hitman October 31, 2014 in United States
A judge tells a person under trial that if your answer is true, you get 2 year sentence and if your answer is false you get 3 year sentence. The person under trial gives an answer which made the judge set him free. What did he say?| Report Duplicate | Flag | PURGE
Oracle Puzzle - 2of 2 votes
AnswersTraverse a given 2D matrix from given source to destination in such way that every cell should be visited exactly one time (we have to cover all cells of matrix exactly once and have to reach at destination).
- Rahul Sharma July 12, 2014 in India| Report Duplicate | Flag | PURGE
Oracle SDE-2 Algorithm - 1of 1 vote
AnswersGiven a BST, replace each node with the sum of the values of all the nodes that are greater than that node. Only constraint being that I was not allowed to use any global or static variable.
- .·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º> February 19, 2014 in United States| Report Duplicate | Flag | PURGE
Oracle Software Engineer / Developer Algorithm - 1of 1 vote
AnswersGiving a number T, print out all possible ways to get to T.
- .·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º> February 17, 2014 in United States
For example
T= 5
1 + 1 + 1 +1 +1
2 + 1 + 1 + 1
3 + 1 +1
2 + 2 + 1
4 + 1
3 + 3
Note that, 3 + 2 is equal than 2 + 3, so you don´t have to print both cases.
What is the time complexity? ( VERY IMPORTANT TO ELABORATE ) Brute force is not allow.| Report Duplicate | Flag | PURGE
Oracle Software Engineer / Developer Algorithm - 1of 1 vote
AnswersSerling Enterprises buys long steel roads and cuts them into shorter rods, which it then sells. Each cut is free. The management of Serling Enterprises charges for a road of length i inches. Road lengths are always an integral number of inches.
The rod-cutting problem is the following: Given a rod of length n and a table of prices V for {1,2...n} determine the maximum revenue Rn obtain by cutting up the road and selling the pieces.
Table:
- .·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º> February 16, 2014 in United Stateslength i 1, 2, 3 ,4 ,5 , 6 , 7 , 8 , 9, 10 price Pi 1, 5, 8, 9, 10,17,17,20,24,30
| Report Duplicate | Flag | PURGE
Oracle Software Engineer / Developer Algorithm - 1of 1 vote
AnswersImplement the queue using stack
- kalungedamaji1137 February 09, 2014 in India| Report Duplicate | Flag | PURGE
Oracle Financial Software Developer Algorithm