Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
This was a proctured online coding test where we had 2 questions to solve under 60 minutes. Both the questions were of Easy to Medium level of difficulty and can be solved if one has a decent command over Data Structures and Algorithms.



As this value might be large, print it modulo 10^9 + 7
Approach :
1) Store the frequency of each element in a hashmap (say, ‘FREQ’).
2) Maintain a variable ‘RESULT’ which stores the final answer.
3) For each element present in the hashmap,
3.1) Calculate the value of (2^eleCount - 1) % MOD, ‘eleCount’ is frequency of current element.
3.2) Add the above value to ‘RESULT’
4) The final answer is the value of ‘RESULT’ after we are done iterating over all the elements of the hashmap.
TC : O(N), where N=size of the array
SC : O(N)



Anagrams are defined as words or names that can be formed by rearranging the letters of another word. Such as "spar" can be formed by rearranging letters of "rasp". Hence, "spar" and "rasp" are anagrams.
'triangle' and 'integral'
'listen' and 'silent'
Since it is a binary problem, there is no partial marking. Marks will only be awarded if you get all the test cases correct.
Approach :
1) Sort both strings, so that all the same characters come together
2) Then loop through both strings together and check each element in both strings one by one
3) If at any position, the characters are found to be different or if the lengths of the two strings are different, they cannot be anagrams
4) Otherwise, they will be anagrams.
TC : O(N * log(N) + (M * log(M))), where N and M are the lengths of the two input strings.
SC : O(1)
This round had one preety simple question related to DSA and then I was asked some questions revolving around DBMS and OOPS. I was also asked to write a simple SQL query at the end.



Let matrix be :
1 2
3 4
Then transpose of the matrix will be:
1 3
2 4
Approach :
1) Declare2-dimensional array t to store the transpose of the matrix. This array will have the reversed dimensions as of the original matrix.
2) The next step is to loop through the original array and to convert its rows to the columns of matrix t.
2.1) Declare 2 variables i and j.
2.2) Set both i,j=0
2.3) Repeat until i 2.3.1) Repeat until j 2.3.2) t[i][j] = p[j][i]
2.3.3) j=j+1**
2.4) i=i+1
3) The last step is to display the elements of the transposed matrix t.
TC : O(N*M), where N=number of rows and M=number of columns in the matrix.
SC : O(N*M)
//Pseudo Code :
void transpose(int p[][n], int t[][m])
{
for(int i=0; i for(int j=0; j t[i][j] = p[j][i];
for(int i=0; i {
for(int j=0; j cout< cout< }
}
What is the main difference between UNION and UNION ALL?
UNION and UNION ALL are used to join the data from 2 or more tables but UNION removes duplicate rows and picks the rows which are distinct after combining the data from the tables whereas UNION ALL does not remove the duplicate rows, it just picks all the data from the tables.
Given an Employee Table, find the Nth highest salary from it.
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
DECLARE M INT;
SET M=N-1;
RETURN (
SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC LIMIT M, 1
);
END
What do you mean by virtual functions in C++?
1) A C++ virtual function is a member function in the base class that you redefine in a derived class. It is declared using the virtual keyword.
2) It is used to tell the compiler to perform dynamic linkage or late binding on the function.
3) When the function is made virtual, C++ determines which function is to be invoked at the runtime based on the type of the object pointed by the base class pointer.
Some rules regarding virtual function :
i) Virtual functions must be members of some class.
ii) Virtual functions cannot be static members.
iii) They are accessed through object pointers.
iv) They can be a friend of another class.
v) A virtual function must be defined in the base class, even though it is not used.
vi) We cannot have a virtual constructor, but we can have a virtual destructor
This round had questions from Linked List followed by some questions from OS and then at last I was asked an interesting puzzle.



1. If the list is empty, the function immediately returns None because there is no middle node to find.
2. If the list has only one node, then the only node in the list is trivially the middle node, and the function returns that node.
Approach :
1) If the head is NULL, we simply return HEAD.
2) If there is only one element in the linked list, we simply return it as it is the midpoint.
3) Otherwise, we initialise 2 pointers ‘fast’ and ‘slow’ both poiniting to head initially.
4) We traverse the linked list until fast is the last element or fast is beyond the linked list i.e it points to NULL.
5) In each iteration, the ‘fast’ pointer jumps 2 times faster as compared to ‘slow’ pointer.
6) Finally, once the loop terminates, ‘slow’ pointer will be pointing to the middle element of the linked list, hence we return the ‘slow’ pointer.
TC : O(N), where ‘N’ denotes the number of elements in the given Linked list.
SC : O(1)
Explain multitasking and multiprogramming.
Multitasking :
1) In Multitasking, a single resource is used to process multiple tasks.
2) The process resides in the same CPU.
3 It is time sharing as the task assigned switches regularly.
4) Multitasking follows the concept of context switching.
Multiprogramming :
1) In multiprogramming, multiple programs execute at a same time on a single device.
2) The process resides in the main memory.
3) It uses batch OS. The CPU is utilized completely while execution.
4) The processing is slower, as a single job resides in the main memory while execution.
What is the major difference b/w 32-bit and 64-bit processors?
A major difference between 32-bit processors and 64-bit processors is the number of calculations per second they can perform, which affects the speed at which they can complete tasks. 64-bit processors can come in dual-core, quad-core, six-core, and eight-core versions for home computing. Multiple cores allow for an increased number of calculations per second that can be performed, which can increase the processing power and help make a computer run faster. Software programs that require many calculations to function smoothly can operate faster and more efficiently on the multi-core 64-bit processors, for the most part.
There are n glasses on the table, all standing upside down. In one move, you are allowed to turn over exactly n – 1 of them. Determine all values of n for which all the glasses can be turned up in the minimum number of moves.
Approach :
There exists 2 cases, i.e, when the value of n is odd and when the value of n is even. If the value of n is odd, then there exists no solution.If the value of n is even, the problem can be solved in n moves, which is the minimum number of moves required.
1) If n is odd : As in one move,we are allowed to turn over exactly n – 1 of them.If n is odd then n – 1 i.e, the number of glasses turned over in one move, is even. Therefore, the parity of the number of glasses that are upside down will always remain odd, as it was in the initial position. Hence, the final position in which the number of upside down glasses is 0, which is even, cannot be reached.
2) If n is even : Let us assume that the glasses are numbered from 1 to n.If n is even, the problem can be solved by making the following move n times: turn over all the glasses except the ith glass, where i = 1, 2, . . . , n.
Here is an example of the algorithm’s application for n = 6. Let us denote the upside down glasses by 1’s and the others as 0’s. A glass that is not turned over on the next move is shown in bold.
If the value of i is 1, then turn over all the glasses except the 1st glass.
111111 –> 100000
Similarly, If the value of i is 2, then turn over all the glasses except the 2nd glass.
100000 –> 001111
Similarly, If the value of i is 3, then turn over all the glasses except the 3rd glass.
001111 –> 111000 and so on.
So, for n = 6, this will look like :
111111 –> 100000 –> 001111 –> 111000 –> 000011 –> 111110 –> 000000
Since any two consecutive moves will either have no impact on the state of the glasses or change the state of exactly two of them, no algorithm can solve the problem in fewer than n moves.
This was a typical HR round with some standard Behavioral questions.
Tell me something about yourself?
Tip 1 : Prepare the points that you will speak in your introduction prior to the interview.
Tip 2 : Tell about your current cgpa, achievements and authenticated certification
Tip 3 : I told about my role in current internship and what all I do
Why you want to be a part of Oracle?
Tip 1 : Oracle technologies are modern, cutting edge and built for enterprise requirements (think world class security, availability, performance, scalability, integrated ML/AI and so forth). Oracle Database is #1 worldwide.
Tip 2 : Since it’s inception, Oracle has become a market leader when it comes to database. Oracle has its own all possible solution for it’s clients whether it is into IT or Banking.
Tip 3 : Oracle gives your job sustainability with better career growth - in terms of job profile and package both.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?