Google — Interview Questions
Aptitude · Reasoning · English · CS — Corporate & Campus Interview Prep
44 Questions 10 Topics Take Test
Advertisement
Showing 31–40 of 44 questions
Q.31 Medium Google
Which sorting algorithm is stable and has O(n log n) worst-case complexity?
A QuickSort
B MergeSort
C HeapSort
D Selection Sort
Correct Answer:  B. MergeSort
Explanation:

MergeSort has O(n log n) worst-case and is stable. QuickSort is O(n²) worst-case, HeapSort is not stable.

Take Test
Q.32 Easy Google
What is the result of 1 XOR 1?
A 0
B 1
C 2
D undefined
Correct Answer:  A. 0
Explanation:

XOR (exclusive OR) returns 1 only when bits are different. 1 XOR 1 = 0 because both bits are the same.

Take Test
Q.33 Medium Google
In dynamic programming, what is memoization?
A Breaking problem into subproblems
B Storing results of subproblems to avoid recomputation
C Creating a memo
D Sorting results
Correct Answer:  B. Storing results of subproblems to avoid recomputation
Explanation:

Memoization is an optimization technique where results of expensive function calls are cached and returned when same inputs occur again.

Take Test
Q.34 Easy Google
What is the time complexity of finding the median in a sorted array?
A O(1)
B O(log n)
C O(n)
D O(n log n)
Correct Answer:  A. O(1)
Explanation:

In a sorted array, median is at index n/2, which is accessed in constant time O(1).

Take Test
Q.35 Hard Google
What is the space complexity of DFS using recursion?
A O(1)
B O(n)
C O(log n)
D O(h) where h is height
Correct Answer:  D. O(h) where h is height
Explanation:

Recursive DFS uses call stack space proportional to the height of the tree/graph. For balanced tree, it's O(log n); worst case O(n).

Take Test
Advertisement
Q.36 Medium Google
What is the correct output of: print(2 ** 3 ** 2) in Python?
A 64
B 512
C 8
D 256
Correct Answer:  B. 512
Explanation:

Exponentiation is right-associative in Python. 32 = 9, then 29 = 512

Take Test
Q.37 Medium Google
In microservices architecture, what is an API Gateway?
A A server that stores APIs
B A single entry point for client requests to multiple microservices
C A database for API data
D A security firewall
Correct Answer:  B. A single entry point for client requests to multiple microservices
Explanation:

API Gateway is a server that acts as an intermediary between clients and microservices, handling routing, authentication, and load balancing.

Take Test
Q.38 Medium Google
What principle is followed when designing Google's systems?
A Monolithic architecture
B Distributed systems with horizontal scalability
C Centralized database model
D Sequential processing
Correct Answer:  B. Distributed systems with horizontal scalability
Explanation:

Google designs distributed systems that can scale horizontally across many machines to handle billions of requests.

Take Test
Q.39 Hard Google
What is eventual consistency in distributed systems?
A All nodes have same data at all times
B Data will be consistent across all nodes eventually
C Consistency is never achieved
D Only one node is consistent
Correct Answer:  B. Data will be consistent across all nodes eventually
Explanation:

Eventual consistency means that if no new updates are made, all nodes will eventually see the same data, though there may be temporary inconsistencies.

Take Test
Q.40 Hard Google
What is the CAP theorem in distributed systems?
A Consistency, Availability, Partition tolerance - you can have all three
B Consistency, Availability, Partition tolerance - you can have at most two
C It's about database capacity
D It's about memory limits
Correct Answer:  B. Consistency, Availability, Partition tolerance - you can have at most two
Explanation:

CAP theorem states that distributed systems can guarantee at most two of: Consistency, Availability, and Partition tolerance.

Take Test
IGET
iget AI
Online · Ask anything about exams
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips