PapersAdda

Oracle Interview Questions 2026

11 min read
Interview Questions
Advertisement Placement

Oracle Interview Questions 2026 - DBMS, Java & Cloud Focus

Oracle Overview

AttributeDetails
Founded1977
HeadquartersAustin, Texas (India HQ: Bangalore, Hyderabad)
Employees in India40,000+
Core ProductsOracle Database, Cloud Infrastructure, ERP
India OperationsR&D centers, Support, Sales
Hiring FocusDatabase, Java, Cloud Technologies

Oracle is the world's largest database company and a major player in cloud infrastructure and enterprise software. Oracle India hires heavily for database administration, Java development, and cloud engineering roles.


Oracle Interview Process 2026

Selection Stages

StageDurationFormat
Online Assessment120 minsAptitude + Technical + Coding
Technical Round 145-60 minsCore CS, Database concepts
Technical Round 245-60 minsAdvanced SQL, Java, System Design
Managerial Round30-45 minsProject discussion, Scenarios
HR Interview20-30 minsBehavioral, Salary discussion

Assessment Pattern

SectionQuestionsTimeTopics
Aptitude2025 minsQuant, Logical, Verbal
DBMS/SQL1520 minsQueries, Normalization, Transactions
Java/C++1520 minsOOPs, Collections, Exceptions
Coding2-345 minsData Structures, Algorithms
Cloud/Unix1020 minsAWS basics, Linux commands

DBMS & SQL Interview Questions

Question 1: Find Nth Highest Salary

-- Method 1: Using LIMIT/OFFSET
SELECT DISTINCT salary 
FROM employees 
ORDER BY salary DESC 
LIMIT 1 OFFSET N-1;

-- Method 2: Using subquery (Oracle specific - ROWNUM)
SELECT salary 
FROM (
    SELECT DISTINCT salary, ROWNUM as rn
    FROM employees 
    ORDER BY salary DESC
) 
WHERE rn = N;

-- Method 3: Using DENSE_RANK (Oracle)
SELECT salary 
FROM (
    SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) as rnk
    FROM employees
) 
WHERE rnk = N;

-- Method 4: Using correlated subquery
SELECT DISTINCT e1.salary 
FROM employees e1 
WHERE N-1 = (
    SELECT COUNT(DISTINCT e2.salary) 
    FROM employees e2 
    WHERE e2.salary > e1.salary
);

Question 2: SQL Query for Department-wise Top 3 Salaries

-- Oracle solution using ROW_NUMBER()
SELECT department_id, employee_name, salary
FROM (
    SELECT 
        department_id,
        employee_name,
        salary,
        ROW_NUMBER() OVER (
            PARTITION BY department_id 
            ORDER BY salary DESC
        ) as rank
    FROM employees
) ranked
WHERE rank <= 3;

-- Alternative using RANK()
SELECT department_id, employee_name, salary
FROM (
    SELECT 
        department_id,
        employee_name,
        salary,
        RANK() OVER (
            PARTITION BY department_id 
            ORDER BY salary DESC
        ) as salary_rank
    FROM employees
) 
WHERE salary_rank <= 3;

Question 3: Find Employees with Same Salary in Different Departments

SELECT e1.employee_id, e1.name, e1.department_id, e1.salary
FROM employees e1
JOIN employees e2 ON e1.salary = e2.salary 
    AND e1.department_id != e2.department_id
    AND e1.employee_id < e2.employee_id
ORDER BY e1.salary DESC;

-- Alternative using EXISTS
SELECT e1.*
FROM employees e1
WHERE EXISTS (
    SELECT 1 FROM employees e2
    WHERE e2.salary = e1.salary 
    AND e2.department_id != e1.department_id
);

Question 4: Pivot Table Query

-- Convert rows to columns (Sales by month)
SELECT 
    product_id,
    SUM(CASE WHEN month = 'Jan' THEN sales ELSE 0 END) as Jan_Sales,
    SUM(CASE WHEN month = 'Feb' THEN sales ELSE 0 END) as Feb_Sales,
    SUM(CASE WHEN month = 'Mar' THEN sales ELSE 0 END) as Mar_Sales
FROM sales_data
GROUP BY product_id;

-- Oracle PIVOT syntax
SELECT *
FROM (
    SELECT product_id, month, sales
    FROM sales_data
)
PIVOT (
    SUM(sales) FOR month IN ('Jan' AS Jan, 'Feb' AS Feb, 'Mar' AS Mar)
);

Question 5: Database Normalization

Explain 1NF, 2NF, 3NF, BCNF with examples:

UNF (Unnormalized Form):
Student(StudentID, Name, Subjects)
Subjects: "Maths, Physics, Chemistry" - Not atomic

1NF - Atomic values:
Student(StudentID, Name, Subject)
1, "John", "Maths"
1, "John", "Physics"

2NF - Remove partial dependencies (for composite keys):
Student(StudentID, SubjectID, SubjectName) - SubjectName depends only on SubjectID
Split to:
Enrollment(StudentID, SubjectID)
Subject(SubjectID, SubjectName)

3NF - Remove transitive dependencies:
Student(StudentID, Name, DeptID, DeptName) - DeptName depends on DeptID
Split to:
Student(StudentID, Name, DeptID)
Department(DeptID, DeptName)

BCNF - Every determinant is a candidate key:
Student(StudentID, Subject, Professor) 
If Professor determines Subject, split:
Teaching(Professor, Subject)
Enrollment(StudentID, Professor)

Question 6: ACID Properties with Examples

-- Atomicity: All or nothing
BEGIN TRANSACTION;
    UPDATE accounts SET balance = balance - 1000 WHERE id = 1;
    UPDATE accounts SET balance = balance + 1000 WHERE id = 2;
    -- If any fails, entire transaction rolls back
COMMIT;

-- Consistency: Data integrity maintained
-- Constraints, triggers ensure valid state

-- Isolation: Concurrent transactions don't interfere
-- Isolation levels:
-- READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE

-- Durability: Committed data persists
-- Write-ahead logging, redo logs

Question 7: Indexing and Query Optimization

-- Create indexes
CREATE INDEX idx_emp_dept ON employees(department_id);
CREATE INDEX idx_emp_salary ON employees(salary DESC);
CREATE COMPOSITE INDEX idx_emp_name ON employees(last_name, first_name);

-- Explain plan
EXPLAIN PLAN FOR
SELECT * FROM employees WHERE department_id = 10;

SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);

-- Covering index
CREATE INDEX idx_covering ON employees(department_id, employee_id, name);
-- Query only needs index, no table access

Java Interview Questions

Question 8: Explain Java Collections Framework

import java.util.*;

public class CollectionsDemo {
    
    // ArrayList vs LinkedList
    public void listComparison() {
        // ArrayList - Dynamic array, fast random access O(1)
        List<String> arrayList = new ArrayList<>();
        arrayList.add("A"); // O(1) amortized
        arrayList.get(0);   // O(1)
        arrayList.add(0, "B"); // O(n) - shifts elements
        
        // LinkedList - Doubly linked list, fast insertion O(1)
        List<String> linkedList = new LinkedList<>();
        linkedList.add("A");    // O(1)
        linkedList.add(0, "B"); // O(1) - no shifting
        linkedList.get(0);      // O(n) - traversal
    }
    
    // HashMap implementation details
    public void hashMapInternals() {
        // Default: 16 buckets, load factor 0.75
        Map<String, Integer> map = new HashMap<>();
        
        // Hashing: hashCode() -> index = hash & (n-1)
        // Collision resolution: Separate chaining (Linked List -> Tree)
        
        // Java 8: Treeify threshold = 8, Untreeify = 6
        // Converts linked list to RB tree for O(log n) lookup
        
        map.put("key", 100);
        Integer value = map.get("key"); // O(1) average
    }
    
    // Concurrent collections
    public void concurrentCollections() {
        // Thread-safe alternatives
        Map<String, Integer> concurrentMap = new ConcurrentHashMap<>();
        List<String> syncList = Collections.synchronizedList(new ArrayList<>());
        
        // CopyOnWriteArrayList - read-heavy scenarios
        List<String> cowList = new CopyOnWriteArrayList<>();
    }
}

Question 9: Multithreading in Java

import java.util.concurrent.*;
import java.util.concurrent.locks.*;

public class ThreadingExamples {
    
    // Ways to create threads
    class MyThread extends Thread {
        public void run() {
            System.out.println("Thread running");
        }
    }
    
    class MyRunnable implements Runnable {
        public void run() {
            System.out.println("Runnable running");
        }
    }
    
    // Thread pool
    ExecutorService executor = Executors.newFixedThreadPool(5);
    
    // Synchronization
    class Counter {
        private int count = 0;
        private Object lock = new Object();
        private ReentrantLock reentrantLock = new ReentrantLock();
        
        // Method synchronization
        public synchronized void increment() {
            count++;
        }
        
        // Block synchronization
        public void incrementBlock() {
            synchronized(lock) {
                count++;
            }
        }
        
        // Lock interface
        public void incrementLock() {
            reentrantLock.lock();
            try {
                count++;
            } finally {
                reentrantLock.unlock();
            }
        }
    }
    
    // Producer-Consumer problem
    class Buffer {
        private List<Integer> list = new ArrayList<>();
        private int capacity = 5;
        
        public synchronized void produce(int value) throws InterruptedException {
            while (list.size() == capacity) {
                wait();
            }
            list.add(value);
            notifyAll();
        }
        
        public synchronized int consume() throws InterruptedException {
            while (list.isEmpty()) {
                wait();
            }
            int value = list.remove(0);
            notifyAll();
            return value;
        }
    }
}

Question 10: JVM Architecture & Garbage Collection

public class JVMExplanation {
    /*
    JVM Architecture:
    
    1. Class Loader Subsystem
       - Loading: .class files loaded
       - Linking: Verification, Preparation, Resolution
       - Initialization: Static variables initialized
    
    2. Runtime Data Areas:
       - Method Area: Class metadata, static variables
       - Heap: Objects, arrays (shared by all threads)
       - Stack: Method frames, local variables (per thread)
       - PC Register: Current instruction (per thread)
       - Native Method Stack: Native method execution
    
    3. Execution Engine:
       - Interpreter: Line-by-line execution
       - JIT Compiler: Hotspot compilation
       - Garbage Collector: Memory management
    
    Garbage Collection:
    
    Heap Structure:
    - Young Generation (Eden, Survivor 0, Survivor 1)
    - Old Generation
    - Permanent Generation (Metaspace in Java 8+)
    
    GC Algorithms:
    - Serial GC: Single thread
    - Parallel GC: Multiple threads for young gen
    - CMS: Concurrent Mark Sweep (low pause)
    - G1 GC: Region-based, predictable pauses
    - ZGC: Ultra-low latency (Java 11+)
    */
    
    // Memory leak example
    public static List<Object> leak = new ArrayList<>();
    
    public void potentialLeak() {
        // Static collections can cause leaks
        leak.add(new byte[1024 * 1024]); // 1MB never freed
    }
}

Cloud & Infrastructure Questions

Question 11: Explain Cloud Service Models

ModelDescriptionExamplesUse Case
IaaSInfrastructure as a ServiceAWS EC2, Azure VMsFull control over OS
PaaSPlatform as a ServiceHeroku, AWS Elastic BeanstalkFocus on code only
SaaSSoftware as a ServiceGmail, SalesforceEnd-user applications
FaaSFunction as a ServiceAWS Lambda, Azure FunctionsEvent-driven computing

Question 12: Oracle Cloud Infrastructure (OCI) Basics

# OCI CLI Commands

# List compartments
oci iam compartment list

# Create compute instance
oci compute instance launch \
    --availability-domain "Uocm:PHX-AD-1" \
    --compartment-id ocid1.compartment.oc1..xxx \
    --shape VM.Standard2.1 \
    --subnet-id ocid1.subnet.oc1..xxx \
    --image-id ocid1.image.oc1..xxx

# List buckets
oci os bucket list --compartment-id ocid1.compartment.oc1..xxx

# Create bucket
oci os bucket create --name my-bucket --compartment-id ocid1.compartment.oc1..xxx

Question 13: Container Basics (Docker & Kubernetes)

# Dockerfile example
FROM openjdk:11-jre-slim
COPY target/app.jar /app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app.jar"]
# Kubernetes deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: oracle-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: oracle-app
  template:
    metadata:
      labels:
        app: oracle-app
    spec:
      containers:
      - name: app
        image: oracle-app:latest
        ports:
        - containerPort: 8080

System Design Questions

Question 14: Design a Cache System

import java.util.LinkedHashMap;
import java.util.Map;

// LRU Cache using LinkedHashMap
public class LRUCache<K, V> extends LinkedHashMap<K, V> {
    private final int capacity;
    
    public LRUCache(int capacity) {
        super(capacity, 0.75f, true); // accessOrder = true
        this.capacity = capacity;
    }
    
    @Override
    protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
        return size() > capacity;
    }
}

// Design considerations:
// 1. Eviction policy: LRU, LFU, FIFO
// 2. Storage: In-memory, distributed (Redis)
// 3. Consistency: Write-through, Write-behind
// 4. Scaling: Sharding by key hash

Question 15: Design a Rate Limiter

import java.util.concurrent.*;

public class RateLimiter {
    private final int maxRequests;
    private final long windowMillis;
    private final ConcurrentHashMap<String, LinkedList<Long>> userRequests;
    
    public RateLimiter(int maxRequests, long windowMillis) {
        this.maxRequests = maxRequests;
        this.windowMillis = windowMillis;
        this.userRequests = new ConcurrentHashMap<>();
    }
    
    public boolean allowRequest(String userId) {
        long now = System.currentTimeMillis();
        LinkedList<Long> timestamps = userRequests.computeIfAbsent(
            userId, k -> new LinkedList<>()
        );
        
        synchronized (timestamps) {
            // Remove old timestamps
            while (!timestamps.isEmpty() && 
                   now - timestamps.peekFirst() > windowMillis) {
                timestamps.removeFirst();
            }
            
            if (timestamps.size() < maxRequests) {
                timestamps.addLast(now);
                return true;
            }
            return false;
        }
    }
}

HR Interview Questions

Q1: Why Oracle?

Sample Answer: "Oracle is the gold standard in database technology, and I've always been passionate about data systems. Working at Oracle would give me exposure to enterprise-scale databases that handle millions of transactions. I'm particularly excited about Oracle's cloud transformation - moving from traditional on-premise databases to autonomous cloud databases shows the company's innovation mindset. I want to be part of building the next generation of data infrastructure."

Q2: Explain a challenging database optimization you did

STAR Format:

  • Situation: Application queries taking 10+ seconds
  • Task: Optimize to under 1 second
  • Action: Added composite indexes, rewrote subqueries as joins, implemented caching
  • Result: Query time reduced to 200ms, 50x improvement

Q3: How do you handle conflicts in a team?

Sample Answer: "I believe in addressing conflicts directly but respectfully. In my last project, there was a disagreement about technology choice. I scheduled a meeting where both sides presented pros/cons with data. We created a proof-of-concept for both approaches and measured performance. The data helped us make an objective decision. The key was focusing on the problem, not personalities."


5 Frequently Asked Questions (FAQs)

Q1: What is the salary for freshers at Oracle in 2026?

A: Oracle offers ₹6-12 LPA for freshers, depending on the role (Database, Java, Cloud).

Q2: Does Oracle focus only on database questions?

A: While databases are emphasized, Oracle also tests Java, cloud concepts, and data structures.

Q3: Is Oracle certification helpful for placement?

A: Oracle certifications (OCA, OCP) add value but aren't mandatory. Strong fundamentals matter more.

Q4: What is Oracle's work culture like?

A: Oracle has a mature, enterprise-focused culture with emphasis on work-life balance and long-term career growth.

Q5: How should I prepare for Oracle technical rounds?

A: Focus on: Advanced SQL, DBMS concepts, Java collections, multithreading, and basic cloud knowledge.


Last Updated: March 2026 Source: Oracle Careers, Interview Experiences, Glassdoor

Advertisement Placement

Explore this topic cluster

More resources in Interview Questions

Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.

More in Interview Questions

More from PapersAdda

Share this article: