<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KVGHS6G" height="0" width="0" style="display:none;visibility:hidden"></iframe>

Oracle计算机科学面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
面试题
全部(202)
OOD(20)
Algorithm(100)
System Design(69)
高频题(0)
Math(1)
全部(202)
OOD(20)
Algorithm(100)
System Design(69)
高频题(0)
Math(1)
1.Gas Station Circular Route Problem
2.Binary Tree Zigzag Level Order Traversal
3.Find bug in code
4.Design snapshot tool
5.Design and Implement a Frequency Stack Data Structure
6.Exclusive Time of Functions
7.Binary Tree Comparison, Palindrome Number, and In-Place String Reversal Coding Challenges
8.Min temperature in sensors
9.Max value in workspace
10.Efficient task management
11.网络基础知识
12.Object-Oriented Design for Patient Temperature Measurement
13.Difference Between Abstract Class and Interface in Java
14.System Design for Handling Increased Requests
15.Object-Oriented Design for Healthcare Concepts
16.Find the K Most Frequent Words in a Text
17.Sort Integers by Positives, Zeroes, and Negatives
18.Find the Index of the First Occurrence in a String with Wildcard
19.Math Problem: ABCD * 4 = DCBA
20.3 Sum Problem
21.Find how many palindrome substrings in a given string
22.Implementing Binary Search
23.Optimal Layer Selection for Maximum Reward Points in a Game
24.Design an Uber Billing System
25.Design a URL Shortening System
26.Impact of Code Modification in DFS
27.Find the Length of the Maximum Sub-array Summing to Zero
28.System Design: Designing Slack
29.Find the Shortest Subarray Matching Start and End Words
30.Design YouTube
31.Design a Data Structure
32.String Constraint Satisfaction Problem
33.Count Unique Elements in a Sorted List
34.Zombie in a Matrix
35.Shell Command Implementation
36.Reverse Integer with Boundary Consideration
37.Design a Web Crawler
38.Design a Tab History Feature
39.Find the Last Index of Target in Sorted Array
40.How would you improve the running speed of software on a specific piece of hardware?
41.Describe the most challenging project you have worked on, including specific details about the code.
42.Design a system to count the number of requests a user has sent to a server in the last few minutes
43.Using Stack to Solve LeetCode 'Dance Spirit Scatter'
44.Optimal Solution for LeetCode 'Dance Rhythm'
45.Convert a Binary Number in a Linked List to Integer
46.Detecting Cycles in a Tree
47.Pre-order Traversal of a Binary Search Tree
48.Building a Text Search System
49.De-duplicate a String with Constraints
50.System Design for Distributed Logging Collection System
51.Find All Duplicate Subtrees
52.Swap Two Numbers Without Using a Third Variable
53.Job Scheduling System Design
54.System design fundamentals
55.Solve LeetCode problems 270 and 272
56.Object-Oriented Design and Operating Systems questions
57.Multi-threading programming problem
58.Solve LeetCode problem 240
59.Design an online collaborative web application
60.Sorted Array Transformation Using a Quadratic Function
61.Path Existence in a Binary Matrix
62.Design a Cache System
63.Design a Notification System
64.Optimal Solution for a Specific Problem
65.Binary Tree Implementation
66.File Compression and Decompression
67.Job Scheduling Order
68.Insert into a Sorted Linked List
69.Matrix Maximum Path Value
70.Binary Search Implementation
71.LinkedList Insertion Time Complexity
72.Time Complexity Analysis
73.Counting Duplicate Numbers
74.Binary String to Decimal Conversion
75.Design an E-commerce Shopping System
76.Design Typeahead System
77.Coding Problem Similar to GeeksforGeeks Problem
78.Design Twitter New Feeds
79.K Pairs with Smallest Sums from Two Sorted Arrays
80.Design a Chat Application
81.Designing a Vending Machine
82.Designing an Application Alert System
83.Detecting Cycles in an Undirected Graph
84.Anagram Grouping
85.2 Sum Problem
86.Sum of Digits with Edge Cases
87.Unique Island Shape Identification
88.Stack-based Number Elimination
89.Design an Airplane Runway Response System
90.Design a Stack
91.Optimizing Movie Watching Schedule
92.Software Engineering Approach
93.String Validation
94.Logic Problem Solving
95.Code Testing and Deployment
96.Cloud Types
97.Understanding of Docker
98.TCP/IP Transmission Process
99.Virtual Machines and Java Virtual Machine
100.Cluster Services
101.OSI and TCP/IP Models
102.RAID Levels
103.TCP Flow Control
104.Differences Between TCP and UDP
105.Cloud Service Models
106.Programming Paradigms
107.Object in Programming
108.Class in Programming
109.Main Components of Computer Architecture
110.React Component Development: Table with Inline Edit Support
111.React Component Development: Tip Calculator
112.Minimum Interval Time Problem
113.Valid Parentheses Problem
114.Operating Systems Knowledge
115.Coding Problem Solving
116.Find the Longest Palindrome in a String
117.Merge Intervals
118.Check if a LinkedList is Present in a Tree Path
119.Anagram Detection
120.System Design for a URL Shortening Service
121.Design a Set Data Structure
122.Recursive Method Bug Fixing
123.Multithreading in Bar Chair Problem
124.Design a Hash Function
125.Find the Number That Appears Once
126.K-Sum Problem and System Design
127.LeetCode Problem 973 and Follow-up
128.Variation of LeetCode Problem 215
129.File Path Problem
130.Current Project Involvement
131.Knowledge of Cloud Technologies
132.Time Complexity Analysis
133.Swap Integer Values Without a Third Variable
134.Logic Puzzle: Correcting Mislabelled Bags
135.Microservice Deployment Infrastructure Design
136.Binary Tree Bottom View
137.Compare Strings with Backspace
138.Design a rate-limiting system
139.Design a Data Collection and Processing System
140.Maximum Number from K Elements
141.Simple React Task
142.Remove Consecutive Sequences in Array
143.Evaluate the Expression
144.Variable Swap Without a Third Variable
145.Linux Commands
146.HTTP, Tokens, and Cookies
147.Copy Constructor in Java
148.Java Interfaces vs Abstract Classes
149.Java Inheritance and Polymorphism
150.Implement Longest Non-Repeating Substring
151.Implement Binary Tree
152.Implement to an Interface Company with Two Classes
153.Implement a Dynamic Resizing HashMap
154.Design a Company Parking Booking System
155.Design a Vending Machine System
156.Coding: Roman to Integer or Move Zeros
157.Coding: Merge Overlapping Intervals
158.Coding: Interval Overlap
159.Java Fundamentals
160.Python Fundamentals
161.REST API and HTTP Fundamentals
162.System Design Question
163.Data Structure Design for a File System
164.Algorithm Problem Similar to LeetCode
165.Multithreading Design Question
166.Binary Tree Layered Printing
167.Sorting Algorithm Selection for Different Scenarios
168.Data Structure Differences and Hash Map Collision Handling
169.Project Experience Quick Check
170.Message Delivery Verification
171.Leetcode Medium Problem with Follow-up
172.Leetcode Easy-Medium Problem with Follow-up
173.Leetcode Medium Problem
174.Temperature Class Comparison
175.Genetic Tree Color Count
176.Problem-Solving Under Pressure
177.Coding Challenge: Tagged Top 10 and Binary Tree Recursion
178.Data Structures and Algorithms Preparation
179.Operating Systems Fundamentals
180.Minimum Path Tree
181.Minimum Steps to Get Sorted List
182.Reverse List
183.Describe the steps from entering a website name in a browser to the website loading.
184.Identify in-place sorting algorithms.
185.Explain the principle behind items remaining in the shopping cart after closing and reopening a website.
186.Explain the concepts of mutex and semaphore.
187.Solve a coding problem of easy difficulty from Leetcode.
188.System Design Deep Dive
189.Data Structure Implementation
190.Distributed System Concepts
191.Troubleshooting Client-Side Errors
192.Java Knowledge
193.React Knowledge
194.Coding Challenge Using HashMap
195.IP Address Range Checker
196.Tree Traversal
197.Understanding Space Complexity
198.Binary Conversion
199.Merge Two Arrays
200.Longest Black Link in a 2D Array
201.Log Processing
202.System Design for Password Store System
1. Gas Station Circular Route Problem
There are n gas stations along a circular route, where the amount of gas at the ith station is gas[i].

You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from the ith station to its next (i + 1)th station. You begin the journey with an empty tank at one of the gas stations.

Given two integer arrays gas and cost, return the starting gas station's index if you can travel around the circuit once in the clockwise direction, otherwise return -1. If there exists a solution, it is guaranteed to be unique

 

Example 1:

Input: gas = [1,2,3,4,5], cost = [3,4,5,1,2]
Output: 3
Explanation:
Start at station 3 (index 3) and fill up with 4 unit of gas. Your tank = 0 + 4 = 4
Travel to station 4. Your tank = 4 - 1 + 5 = 8
Travel to station 0. Your tank = 8 - 2 + 1 = 7
Travel to station 1. Your tank = 7 - 3 + 2 = 6
Travel to station 2. Your tank = 6 - 4 + 3 = 5
Travel to station 3. The cost is 5. Your gas is just enough to travel back to station 3.
Therefore, return 3 as the starting index.

Example 2:

Input: gas = [2,3,4], cost = [3,4,3]
Output: -1
Explanation:
You can't start at station 0 or 1, as there is not enough gas to travel to the next station.
Let's start at station 2 and fill up with 4 unit of gas. Your tank = 0 + 4 = 4
Travel to station 0. Your tank = 4 - 3 + 2 = 3
Travel to station 1. Your tank = 3 - 3 + 3 = 3
You cannot travel back to station 2, as it requires 4 unit of gas but you only have 3.
Therefore, you can't travel around the circuit once no matter where you start.

 

Constraints:

  • n == gas.length == cost.length
  • 1 <= n <= 105
  • 0 <= gas[i], cost[i] <= 104
2. Binary Tree Zigzag Level Order Traversal
Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level and alternate between).

 

Example 1:

Input: root = [3,9,20,null,null,15,7]
Output: [[3],[20,9],[15,7]]

Example 2:

Input: root = [1]
Output: [[1]]

Example 3:

Input: root = []
Output: []

 

Constraints:

  • The number of nodes in the tree is in the range [0, 2000].
  • -100 <= Node.val <= 100
3. Find bug in code
for(int row=0;row<1024;row++){
 
 if(row&3==0){
 
 printf("blabla");
 
 }
 
 }
 
 }
 
 这段代码的用意是每4个数输出一个值。
 
 找bug
4. Design snapshot tool
设计一个snapshot类,是三个接口: void add(int n); int makesnapshot(); bool exists(int n, int snapshotid)
5. Design and Implement a Frequency Stack Data Structure
Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack.
 
 Implement the FreqStack class:
 
 FreqStack() constructs an empty frequency stack.
 void push(int val) pushes an integer val onto the top of the stack.
 int pop() removes and returns the most frequent element in the stack.
 If there is a tie for the most frequent element, the element closest to the stack's top is removed and returned.
 
 
 Example 1:
 
 Input
 ["FreqStack", "push", "push", "push", "push", "push", "push", "pop", "pop", "pop", "pop"]
 [[], [5], [7], [5], [7], [4], [5], [], [], [], []]
 Output
 [null, null, null, null, null, null, null, 5, 7, 5, 4]
 
 Explanation
 FreqStack freqStack = new FreqStack();
 freqStack.push(5); // The stack is [5]
 freqStack.push(7); // The stack is [5,7]
 freqStack.push(5); // The stack is [5,7,5]
 freqStack.push(7); // The stack is [5,7,5,7]
 freqStack.push(4); // The stack is [5,7,5,7,4]
 freqStack.push(5); // The stack is [5,7,5,7,4,5]
 freqStack.pop(); // return 5, as 5 is the most frequent. The stack becomes [5,7,5,7,4].
 freqStack.pop(); // return 7, as 5 and 7 is the most frequent, but 7 is closest to the top. The stack becomes [5,7,5,4].
 freqStack.pop(); // return 5, as 5 is the most frequent. The stack becomes [5,7,4].
 freqStack.pop(); // return 4, as 4, 5 and 7 is the most frequent, but 4 is closest to the top. The stack becomes [5,7].
 
 
 Constraints:
 
 0 <= val <= 109
 At most 2 * 104 calls will be made to push and pop.
 It is guaranteed that there will be at least one element in the stack before calling pop.