Oracle Interview Questions
0of 0 votesWrite a function to find a key in Hash map if the value associated to that key is given as input. As a followup, swap key & value assuming that value is not equal to any of the existing keys.
0of 0 votesWrite a function to perform string replace without using any inbuilt functions.
0of 0 votesWhats the best way to synchronize Singleton class.
0of 0 votesHow will you synchronize 3rd party library from your application..
0of 0 voteswhat are the disadvantage or problem in template instantiation?
1of 1 voteWrite a C function to print all the elements less than the key element in binary search tree
0of 0 votesYou have 8 coins. 3 of them weigh x units, 3 y units, 1 a units and 1 b units. They are all mixed and look identical. You have to find the lightest coin in minimum number of weighing .
0of 0 votesYou have one table with a single column having three values a,b and c.
Current snapshot of the table is
Table :- tblTest
Values :-
tblColumn
a
a
a
b
b
b
b
c
c
We need and output in SQL Server in the format:-
Acount BCount CCount
3 4 2
Do not use temporarytable/variables/multiple queries in a single query.
Values are restricted to be a, b and c only but the count may vary and output will change accordingly.
0of 0 votesSelect the option that denotes, "runtime is proportional to five times the input size".
O(n5)
5O(n)
5*O(n)
O(5n)
0of 0 votesQuestion Number 1
Consider a table "Student" consisting of columns (Student ID, Student Address, Course).
Every student is allowed to enroll in multiple courses and every course is allowed to enroll more than one student. Also every time a student changes address, all his relevant records must be changed to reflect the new address.
What would be the Normal form required to avoid this redundancy?
2nd NF
4th NF
3rd NF
1st NF
0of 0 votes1.Explain Memory dumps in java
0of 0 votesDesign/implement a Hashset class of your own.
0of 0 votes1.sort array {0,1,1,0,1,0,1,0,0,1,1,1,0} of binary numbers in O(n) time complexity using property of binary numbers.(no counting here)
0of 0 votes1.Design one/two player tic-tac-toe,using Java.
0of 0 votes1.Design a vending machine in java.takes coins of 2,3,7 ,using JAVA
0of 0 votes1.Design a vending machine in java.takes coins of 2,3,7,JAVA 2.Design one/two player tic-tac-toe,Java. 3.sort array {0,1,1,0,1,0,1,0,0,1,1,1,0} of binary numbers in O(n) time complexity using property of binary numbers.(no counting here) 4.Design/implement a Hashset class of your own. 5.Memory dumps in java ....................................................................................
0of 0 voteswrite a program to take a no. as input and generate the output in the form of LED display.
eg. if input in 102 op
__ __
| | | __|
| |_ | |__
|
0of 0 votesDesign a structure for a student record which has following 3 fields-
ID - integer value
Name - String
either a grade - which is float value OR rank - which is integer value.
Also write a function to print the details of a student record such that if the student is given grade it must be printed as float value but if he is given rank then it must be printed as integer value.
0of 0 votesWrite a function in C to efficiently copy 1 file to another.
0of 0 votesA node of a binary tree has two pointers left and right and two data fields- left count and right count. left count specifies the number of nodes in left of the node and right specifies the number of nodes in right of the node. Write an algorithm to populate the data fields of all the nodes of the tree.
0of 0 votesHow to find min-weight (coin) in a given set of '10' distinct weights (coins) in minimum number of weighing's if provided with a balance. (no labels shown on coin resembling the weight). Generalize for 'n' distinct weights.
0of 0 votesCan you give the syntax to print the date time in C#
0of 0 votesGeneral question: If you are provided with 8 balls with one among them heavier than remaining . You have a weighing balance. in how many measures can u identify the heavier ball.
0of 0 votesyou have a 5 liter and a 3 liter jars. You can use any amount of water. Shouldnt use any other jars or containers. How can you get exact 4 liters of water?
0of 0 votesFrom the following options, select a statement that is NOT true about immutable objects.
You can use immutable objects in multi-threaded programs
You can use a pointer to create a reference copy of an immutable object, instead of creating a copy of the object
Immutable objects cannot be modified after they are created
An object has to be completely mutable or immutable but partial immutability is not very useful in programs
0of 0 votesFrom the following options, select the OOP mechanism, that allows treatment of the derived class members just like the members of their parent class.
Abstraction
Polymorphism
Decoupling
Encapsulation
0of 0 votesYou have two relation variables: RelV1 and RelV2. They are NOT necessarily distinct. You
have a set K as a key for RelV1. Consider that FK is a subset of the heading of RelV2 that
involves exactly the same attributes as K.
From the following options, select the option that correctly depicts a scenario where FK can be
considered as a foreign key.
-Every tuple in RelV1 has a K value that is equal to the FK value in some tuple in RelV2
-Every tuple in RelV1 has a FK value that is equal to the K value in some tuple in RelV2
-Every tuple in RelV2 has a K value that is equal to the FK value in some tuple in RelV1
-Every tuple in RelV2 has a FK value that is equal to the K value in some tuple in RelV1
0of 0 votesSelect the option that correctly describes the database replication concept where two or more
replicas synchronize each other through a transaction identifier.
-Quorum
-Multimasterslave
-Master-Slave
-Multimaster
0of 0 votesSuppose you have the following code:
void InsertNode(tNode** node, int i){ if(*node == NULL){ *node = new tNode; (*node)->pLeft = NULL; (*node)->data = i; (*node)->pRight = NULL; SetRootNode(node); return; } else { if(i < (*node)->data) InsertNode(&((*node)->pLeft), i); if(i > (*node)->data) InsertNode(&((*node)->pRight), i); return; } } void Func(tNode **node){ if(*node!=NULL){ Func(&(*node)->pLeft); tNode *temp; temp = (*node)->pLeft; (*node)->pLeft= (*node)->pRight; (*node)->pRight = temp; Func(&(*node)->pRight); } } void traverse(tNode** nd){ if(*nd!=NULL){ traverse(&((*nd)->pLeft)); traverse(&((*nd)->pRight)); std::cout<<(*nd)->data<<std::endl; } }Let the input given be
98,15,100,10,78,120,5,12,96,110
What would be the output of the following code snippet?int main(void) { tree *bT = new tree; int i = 10; int data; while(i--){ std::cout<<"Enter the node"<<std::endl; std::cin>>data; bT->InsertNode(bT->GetRootNode(), data); } bT->Func(bT->GetRootNode()); bT->InsertNode(bT->GetRootNode(), 99); bT->Func(bT->GetRootNode()); bT->traverse(bT->GetRootNode()); }Options
-5,10,12,15,78,96,98,99,100,1
10,120
-5,12,10,99,96,78,15,110,120,
100,98
-5,10,12,15,78,96,99,98,100,1
10,120
-98,100,120,110,15,78,96,99,1
0,12,5
0of 0 votesI was asked to design a data structure for a phone address book with 3 fields
name, phone number , address
one must be able to search this phone book on any of the 3 fields .