OCP Cheat Sheet 2026
The 30 highest-yield OCP facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.
80 questions
180 min time limit
68% to pass
- What is the effect of catching a checked exception that the try block cannot throw? → It causes a compile-time error
- Which of the following is a valid way to create a parallel stream from a List? → list.parallelStream()
- What does the Oracle parameter 'SORT_AREA_SIZE' control? → The memory allocated for sorting operations
- What is the return type of Stream.collect(Collectors.toList())? → List
- Which atomic operation does the `AtomicInteger.compareAndSet(expect, update)` method perform? → Sets value to update only if current value equals expect, atomically
- Which Oracle background process is responsible for writing dirty buffers from the buffer cache to datafiles? → DBWR
- What is an Oracle database index used for? → To speed up query performance
- Which of the following correctly creates a Locale for Brazilian Portuguese? → new Locale("pt", "BR")
- In Oracle, which initialization parameter controls the percentage of the buffer cache that can hold dirty buffers before DBWR is triggered? → FAST_START_MTTR_TARGET
- Which RMAN command removes backup records from the repository that no longer have corresponding physical files? → DELETE EXPIRED BACKUP
- Which `CompletableFuture` method combines two futures and applies a function to both results when both complete? → thenCombine()
- Which of the following is a valid and most concise lambda expression for a `java.util.function.Predicate` that tests if a string is empty? → String::isEmpty
- How does Comparator.comparing(Function) work with Stream.sorted()? → It sorts elements by the value extracted by the key extractor Function
- What is a key feature of Oracle RAC (Real Application Clusters)? → Multiple instances accessing a shared database
- What is the difference between findFirst() and findAny() on a sequential stream? → On sequential streams they behave identically, always returning the first element
- What is the output of `DateTimeFormatter.ofPattern("MM/dd/uuuu").format(LocalDate.of(2024, 6, 5))`? → "06/05/2024"
- What is the result of calling `Thread.interrupted()` on a thread whose interrupt flag is set? → Returns true and clears the interrupt flag
- Which method of the `CountDownLatch` class blocks the calling thread until the count reaches zero? → await()
- What is the purpose of the peek() intermediate operation? → To inspect elements for debugging without altering the stream pipeline
- Which SQL set operator removes duplicate rows and requires matching column count and compatible datatypes? → UNION
- Which of the following is a valid generic method declaration? → public T swap(T a, T b) {}
- In Database Architecture & Administration, what is the FIRST step a OCP professional should take when encountering a new case or situation? → Conduct a comprehensive assessment and gather all relevant information
- Which Oracle system privilege allows a user to query data in any table in the database without being explicitly granted object-level SELECT privileges? → SELECT ANY TABLE
- What does the RMAN command CROSSCHECK BACKUP do? → Verifies that backup files in the repository still exist on disk or tape
- Which Java I/O class provides methods like readInt() and readDouble() to read primitive data types from a binary file? → DataInputStream
- Which interface in Java NIO.2 (introduced in Java 7) represents a path to a file or directory on the file system? → java.nio.file.Path
- Which scenario can cause a `ConcurrentModificationException` in a non-concurrent collection? → Modifying a collection while iterating over it with a for-each loop
- Which StandardWatchEventKinds constant signals that a new file or directory was created in a directory watched by WatchService? → ENTRY_CREATED
- What is the purpose of a trigger in PL/SQL? → To automatically perform actions based on certain events
- Which Java class is designed specifically to read character data from a file using a character stream? → FileReader
Turn these facts into recall:
Was this helpful?