Oracle计算机科学面试真题

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