Company-style OA practice sets with full problem statements, sample test cases, and solutions.
Have you recently taken Google's Online Assessment or coding test? Share the questions, test cases, or assessment patterns you encountered. Earn SWE180 Coins for every verified submission and use them to unlock other company OA sets and premium tools for free!
Given a positive integer N, you are allowed to perform two operations: increment N by 1 (N = N + 1) or decrement N by 1 (N = N - 1).
A number is defined as a "binary palindrome" if its binary representation (without leading zeros) reads the exact same forwards and backwards.
Find the minimum number of increment/decrement operations required to convert N into a binary palindrome.
Example 1
Input
6
Output
1
Explanation
Binary of 6 is 110_2, which is not palindromic.
Adding 1 yields 7 (111_2) or subtracting 1 yields 5 (101_2). Both are binary palindromes.
The minimum operations is 1.
Example 2
Input
10
Output
1
Explanation
Binary of 10 is 1010_2.
Subtracting 1 gives 9 (1001_2), which is palindromic.
Result is 1 operation.
A conveyor belt in a Google data center factory has packages that must be shipped within days D.
The i-th package on the conveyor belt has a weight of weights[i]. Each day, the ship is loaded with packages in the exact order given by weights. We may not load more weight than the maximum weight capacity of the ship.
Return the least weight capacity of the ship that will result in all packages on the conveyor belt being shipped within D days.
Example 1
Input
10 5 1 2 3 4 5 6 7 8 9 10
Output
15
Explanation
A ship capacity of 15 is the minimum to ship all packages in 5 days:
Day 1: 1, 2, 3, 4, 5 (weight 15)
Day 2: 6, 7 (weight 13)
Day 3: 8 (weight 8)
Day 4: 9 (weight 9)
Day 5: 10 (weight 10)
Gain complete transparency into the Google online assessment process. Prepare effectively with real, verified coding challenges, test patterns, and platform details.
Wondering what top companies are actually asking in their initial screening rounds? We provide exact Data Structures, Algorithms, and logical reasoning questions reported by candidates who recently took the Google online tests. Stop guessing and start practicing the right problems.
Understand exactly how many questions to expect, the typical time limits, and the platforms used (e.g., HackerRank, Codility, CodeSignal). Knowing the format in advance is the first step to clearing the Google OA.