Zoho Interview Questions
- DSA
- LLD
- HLD
Q1: Rearrange Array by Even and Odd Sorting
Rearrange a given integer array so that even and odd elements are sorted independently. Even numbers should be in descending order, odd numbers in ascending order, while maintaining the relative order of even and odd groups.
Example:
Input: text nums = [94, 27, 8, 5]
Output: text [38, 47, 2, 9]
Explanation: The even numbers [94][8] rearranged descending but preserving their relative sequence effectively transforms to [38][2], and odd numbers [27][5] sorted ascending to [47][9], combined keeping original parity separation.
Q2: First Non-Repeating Character
Find the index of the first character in a string that does not repeat anywhere else.
Eaxmple:
Input: text s = “leetcode”
Output: text 0
Explanation: The first unique character is ‘l’ at index 0.
Q3: Maximum Subarray Sum
Find the contiguous subarray with the largest sum.
Example:
Input: text nums = [-2,1,-3,4,-1,2,1,-5,4]
Output: text 6
Explanation: Subarray [4,-1,2,1] sums to 6, the maximum possible.
Q4: Detect Cycle in a Linked List
Detect whether a singly-linked list has a cycle using Floyd’s Tortoise and Hare algorithm.
Example:
Input: text head = [3,2,0,-4] (tail links to node at index 1)
Output: text true
Explanation: Slow and fast pointers meet inside the cycle confirming its existence.
Q5: Two Sum
Return indices of two numbers in an array that add up to a target.
Example:
Input: text nums = [2,7,11,15], target = 9
Output: text [0,1]
Explanation: Indices 0 and 1 represent values 2 and 7 that sum to 9.
Q6: Palindrome Linked List
Check if linked list values form a palindrome.
Eaxmple:
Input: text head = [1,2,2,1]
Output: text true
Explanation: Values read identically forwards and backwards.
Q7: Merge Intervals
Merge all overlapping intervals from a list.
Example:
Input: intervals = [[1,3],[2,6],[8,10],[15,18]]
Output: [[1,6],[8,10],[15,18]]
Explanation: Intervals [1][3] and [2][6] merge into [1][6].
Q8: Validate Parentheses
Check if a string of brackets is valid and correctly closed.
Example:
Input: s = “()[]{}”
Output: true
Explanation: All opening brackets are properly matched by their closing counterparts.
Q9: Product of Array Except Self
Return an array output where each element is product of all other elements except self.
Example:
Input: nums = [1,2,3,4]
Output: [24,12,8,6]
Explanation: For index 0, product is 2*3*4=24 and so on.
Q10: Coin Change
Find minimum number of coins to make a certain amount.
Example:
Input: coins = [1,2,5], amount = 11
Output: 3
Explanation: 5 + 5 + 1 forms amount 11 using 3 coins.
Q1. Design LRU Cache
Design a data structure supporting get and put operations in constant time with least recently used eviction policy.
Example:
Input: put(1,1), put(2,2), get(1), put(3,3), get(2), put(4,4), get(1), get(3), get(4)
Output: 1, -1, -1, 3, 4
Explanation: Oldest unused keys removed on capacity exceed.
Q2. Design Parking Lot System
Design a software to manage multi-level parking with variable vehicle sizes.
Q3. BookMyShow Ticket Booking System
Design a ticket booking system handling concurrent seat bookings and availability.
Q4. Logger Rate Limiter
Design a logging system that prevents duplicate logs within a time window.
Example:
Input: Logger.shouldPrintMessage(1, “foo”), Logger.shouldPrintMessage(2, “bar”), Logger.shouldPrintMessage(3, “foo”)
Output: true, true, false
Explanation: Messages are blocked if repeated within 10 seconds.
Q5. Stack with GetMin Operation
Design a stack supporting push, pop and retrieving minimum element in constant time.
Q6. Trie (Prefix Tree) Implementation
Design a trie for efficient prefix search and word insertion.
Q7. Design Parking Slot Allocation System
Design slot allocation, retrieval, and querying for a smart parking management system.
Q8. Implement Queue using Stacks
Use two stacks to simulate a queue supporting FIFO push and pop.
Q1. Design URL Shortener
Build a scalable URL shortener system with collision handling, high throughput, and analytics.
Q2. Design Online Bookstore
System to browse, search, order, and manage inventory with real-time updates.
Q3. Design Social Network Feed
Architecture supporting personalized, real-time newsfeed sorting and caching.
Q4. Cloud Storage Service
Object storage backend, consistent hashing, masterless replication, and blob chunking.
Q5. Real-Time Analytics Platform
Pipeline for ingesting, processing, and querying stream data in seconds.
Q6. Design Chat/Messaging System
Support message sending, presence, offline delivery, and encryption.
Q7. Employee Leave Management System
Build a web system for applying, approving, and tracking leaves with calendar integration.