Wayfair Interview Questions
- DSA
- LLD
- HLD
Q1: Event Management System (OOP + Lists)
Design classes to manage events and related reports. Implement Person, EventInfo, and EventManager with methods for registration and attendance tracking.
Example:
John registers and attends Event1, Jane registers for Event1 and Event2.
Output should show event, registration, and attendance counts by year.
Q2: Maze Traversal with Variable Jumps (BFS)
Given a binary maze where each cell is either blocked (1) or open (0), find the minimum moves from (0,0) to (n-1,m-1) when you can jump up to K steps in any direction without obstacles.
Example:
Maze = [[0,0,0,0],
[0,1,1,0]]
K = 3
Output: 2
Q3: Anagram Finder
Given a dictionary of words and a list of queries, return all words from the dictionary that are anagrams of each query.
Example:
Dictionary: [“duel”, “speed”, “dule”, “cars”]
Queries: [“spede”, “deul”]
Output: [[“speed”], [“duel”, “dule”]]
Q4: Task Scheduling with Memory Constraints
Given two arrays: tasks[] (memory required) and types[] (task types). Two tasks of the same type can run together if total memory ≤ maxMemory. Each task takes 1 time unit.
Example:
Tasks = [1,4,5,2,3]
Types = [1,2,1,3,4]
maxMemory = 6
Output: 4
Q5: IP Address Zone Classification
Given IP address ranges:
Zone1: 0.0.0.0 – 127.255.255.255
Zone2: 128.0.0.0 – 191.255.255.255
Zone3: 192.0.0.0 – 223.255.255.255
Zone4: 224.0.0.0 – 255.255.255.255
Determine which zone each IP belongs to. Return -1 if invalid.
Example:
Input: [“0.0.0.123″,”129.234.233.24″,”256.256.2.1”]
Output: [1,2,-1]
Q6: Loyal Customers (Set/HashMap)
Given user click logs for two days, find customers who visited on both days and clicked on at least two unique products.
Example:
Day1 = [User1->A, User2->B]
Day2 = [User1->C, User2->B]
Output: [User1]
Q7: Target Difference Pairs
Given an array and a target difference, count how many pairs have that difference.
Example:
Input: [1,2,3,4,5], target=2
Output: 3
Q8: Min-Sum Peak Subsequence
Find the subsequence of length 3 such that a < b > c and the sum is minimum.
Example:
Input: [2,1,3,4,1]
Output: [1,3,1]
Q9: Count Arrays by TotalCost
Find number of arrays of length n with elements ≤ m such that total cost of swaps during search equals given totalCost.
Example:
Input: n=3, m=4, totalCost=2 → Output: 6
Q10: Serialize/Deserialize Binary Tree
Implement serialization and deserialization methods for a binary tree.
Example:
Input: [1,2,3,null,null,4,5] → Output: same after deserialize.
Q11: Coupon Hierarchy
Given categories in a tree and coupons attached to categories, return the nearest applicable coupon for any given sub-category.
Example:
Category tree → Electronics → Mobiles; Coupon applies at Electronics.
Q12: Latest Coupon with Date
From multiple coupons with timestamps, return the latest valid coupon for a given category
Q13: Timer Reset Logic
Implement a JavaScript timer that starts on page load and resets when a button is clicked.
Q14: React Review Filter
Build a React review page with sorting (Latest, Most Liked) and filtering using Context + Reducer.
Q15: Optimize TextArea Updates
In a React app, delay saving to store until Save is clicked instead of each keystroke to improve performance.
Q16: Compact Words Encoding
Given a string, encode consecutive repeated characters with counts.
Example:
Input: “aabbc” → “a2b2c1”.
Q17: Graph Path Finder
Find the Eulerian or Hamiltonian path for a given graph representation.
Q18: Maximum Product Subarray (Advanced)
Find the subarray with maximum product and handle negative values properly.
Example:
Input: [-2,3,-4] → Output: 24
Q1. Event Management System
Design classes implementing interfaces IPerson, IEventInfo, and IEventManager. Manage events, registration, and attendance reports.
Q2. Order Management System
Design classes for Orders, Products, and Cart. Include functionalities like adding/removing items and calculating total cart value.
Q3. Bike Rental System
Design a system with bikes, stations, and rentals. Include APIs for availability, booking, and return.
Q4. Parking Lot System
Design a parking lot with classes for Vehicle, Ticket, Slot, Payment. Add pricing and parking strategy patterns.
Q5. Shipment and Package Management
Design Cargo and Package classes with cost calculation and weight-based categorization.
Q6. Box Hierarchy
Boxes of different sizes (small, medium, large) — implement methods to insert smaller boxes inside larger ones and print hierarchy.
Q7. Hotel Reservation Platform
Design system for multiple hotels with provider integration, search APIs, and booking workflow.
Q8. Logging Service
Design scalable logging system for clients to push logs and monitor them with filtering and search capabilities.
Q9. Task Scheduler (Memory Type)
Design task scheduler that respects task type and max memory constraints, optimizing parallel execution.
Q10. Room Item Transfer System
Design system with items of different sizes, vehicles (small/big), to minimize number of trips.
Q11. Coupon Hierarchy System
Design class hierarchy and service to fetch nearest valid coupon for a given category node.
Q12. Review System
Design complete review filtering backend with APIs, data model, and extensibility considerations.
Q1. Music Recognition System (Shazam-like)
Design a system for music fingerprinting and recognition. Include song ingestion, fingerprinting, search, caching, and scalability.
Q2. Hotel Reservation Platform
Architect a global hotel reservation system with providers, caching, search ranking, and failure recovery.
Q3. E-Commerce Product Details Page
Design scalable product details architecture — discuss frontend-backend flow, data caching, and component communication.
Q4. Distributed Logging Platform
Design distributed log ingestion and monitoring platform. Focus on indexing, scaling, storage, and alerting.
Q5. Chat Application
Real-time messaging system with scalability, persistence, and delivery guarantees.
Q6. Fleet Management System
Real-time fleet tracking system with device ingestion, geolocation APIs, and analytics dashboard.
Q7. Recommendation Engine
Design a trending product recommendation system with event stream ingestion, ranking, and caching.
Q8. Parking Lot Scalable Architecture
Extend the parking lot design to multi-city, multi-level management with sensors, payments, and distributed DB.
Q9. Inventory & Fulfillment System
Design order and warehouse management system to manage stock updates, order routing, and scaling.
Q10. E-Commerce Search & Filtering
Architect a search/filter backend with elastic indexing, caching, query optimization, and ranking logic.