Sitemap
Javarevisited

A humble place to learn Java and Programming better.

Top 20 High and Low Level System Design Interview Questions for 2027 (includes AI and ML System Design)

System Design and OOP Design Questions that actually prepare you for Interview

Sent as aNewsletter
11 min read1 day ago

--

Hello friends , system design interviews have changed. A few years ago, “design Twitter” and “design a URL shortener” covered most of what you’d see.

In 2027 you can still expect those, but you might also be asked to design a RAG-based Q&A agent, an AI travel planner, or a spam detection system. Low-level design rounds, where you model classes and state machines, are also common, especially for mid-level roles.

So I put together the 20 questions I’d practice to prepare for all of it: 10 high-level design questions, 5 low-level design questions, 2 ML system design questions, and 3 AI agent questions. For each one you’ll get a short explanation, a hint to point you in the right direction, and a link to practice it.

For practice I’m using Codemia, because it lets you actually work through each problem and compare your answer with a solution, instead of only reading about it. Several of the problems below are free, and I’ve marked which ones.

How to Use This List?

Don’t read the hints and move on. For each question:

  1. Spend 30 to 45 minutes designing it yourself, out loud or on paper.
  2. Follow a structure: clarify requirements, estimate scale, define the API, sketch the data model, draw the high-level design, then go deep on one or two bottlenecks and discuss trade-offs.
  3. Compare with a reference solution and note what you missed.

That last step is where the learning happens, and it’s the main reason I like practicing on Codemia: you can try the problem first and then see how a strong answer looks.

Part 1: High-Level Design (10 Questions)

Let’s start with the high level design questions then we will see low level as well ML and AI System design questions for 2027 interviews.

1. Design a URL Shortener (TinyURL)

The question: Build a service that turns long URLs into short links and redirects visitors to the original.

Hint: Start with how you generate unique short keys (a counter encoded in base62, hashing, or a pre-generated key service) and what happens on collisions. Reads vastly outnumber writes, so think caching. Don’t forget the trade-off between 301 and 302 redirects, and expiry and analytics.

Practice (free): Design a URL Shortener | Solution (free): Editorial

2. Design Pastebin

The question: Let users paste text, get a shareable link, and view it later, with optional expiry.

Hint: It’s similar to a URL shortener, with one key difference: the content itself can be large. Think about storing the text in object storage with metadata in a database, serving popular pastes through a CDN, and cleaning up expired pastes. Mention abuse and rate limiting.

Practice: Design Pastebin

3. Design Twitter

The question: Users post short messages and follow others, and each user sees a timeline of the people they follow.

Hint: The classic issue is fan-out. Pushing a tweet into every follower’s timeline at write time makes reads fast, but it’s expensive for accounts with millions of followers. Many designs use a hybrid: push for normal users and pull for celebrities. Also discuss timeline caching and how you’d shard tweets.

Practice (free): Design Twitter | Solution (free): Editorial

4. Design Ticketmaster

The question: Sell tickets for events where thousands of people try to buy the same seats at once.

Hint: The hard part is contention. Think about temporarily holding seats with a time limit, preventing double-selling with locking or optimistic concurrency, and handling traffic spikes with a waiting room or queue. Make payment steps idempotent so a retry never charges twice.

Practice (free): Design Ticketmaster | Solution (free): Editorial

5. Design Facebook Messenger

The question: Build a chat system supporting one-to-one and group messaging with delivery and read status.

Hint: Start with how clients stay connected (WebSockets or long-lived connections) and how messages are routed between servers. Discuss message ordering within a conversation, storing messages by conversation, offline delivery with push notifications, and receipts. A good answer talks about what happens when a user is offline or on a flaky connection.

Practice: Design Facebook Messenger | Solution (Premium): Editorial

6. Design an Online Presence Indicator Service

The question: Show whether each user is online, away, or offline, like the green dot in chat apps.

Hint: Think heartbeats: clients ping periodically, and a user is considered offline if the heartbeat expires (a good fit for keys with a TTL). The trap is fan-out, because you shouldn’t notify everyone about every status change. Limit updates to the people who are actually viewing that user, and accept that presence can be slightly stale.

Practice: Design an Online Presence Indicator Service

7. Design a Video View Count System

The question: Count views on videos that may get millions of hits, and show reasonably accurate totals.

Hint: A single counter row becomes a hot spot. Consider buffering and batching updates, streaming events through a queue, and using sharded counters. Decide whether you need exact counts or eventually consistent ones, and discuss filtering duplicate views and bots.

Practice: Design a Video View Count System

8. Design an API Rate Limiter

The question: Limit how many requests a client can make in a time window, across many servers.

Hint: Know the main algorithms: token bucket, leaky bucket, fixed window, and sliding window, and their trade-offs. In a distributed setup you need shared state (often Redis) and atomic operations to avoid race conditions. Discuss where the limiter lives (API gateway or middleware), how you identify clients, and whether to fail open or closed if the limiter goes down.

Practice: Design an API Rate Limiter

9. Design Craigslist

The question: Build a classified-ads site where users post listings and others search and browse by category and location.

Hint: The core is search and filtering, so talk about indexing listings (location, category, keywords) and partitioning by region. Store images in object storage, handle listing expiry, and think about spam and moderation, which are central to this kind of product.

Practice: Design Craigslist

10. Design a Nested Comments System

The question: Support threaded comments where replies can be nested many levels deep.

Hint: This one is mostly about data modeling. Compare an adjacency list (parent ID), a materialized path, and a closure table, and think about which makes it easy to load a whole thread. Discuss pagination of large threads, sorting (top versus newest), and collapsing deep replies.

Practice: Design a Nested Comments System

Part 2: Low-Level Design (5 Questions)

Low-level design (LLD) rounds focus on classes, relationships, and behavior instead of servers and scale. If you’re preparing for these, Codemia also has a dedicated object-oriented design section.

11. Design a Parking Lot System

The question: Model a parking lot with multiple levels and spot types, handling entry, exit, and fees.

Hint: Identify the entities first (vehicle, spot, level, ticket, payment). Use the strategy pattern for spot assignment and for pricing so both can change easily. Then think about edge cases, such as two cars trying to take the last spot at once.

Practice (free): Design a Parking Lot System | Solution (free): Editorial

12. Design a Vending Machine

The question: Model a machine that accepts money, dispenses items, and returns change.

Hint: This is a textbook use of the state pattern: idle, has money, dispensing, and out of service, with clear rules for which actions are allowed in each state. Also cover inventory, making change, and how you’d add new payment methods later.

Practice: Design a Vending Machine System

13. Design an Elevator System

The question: Model one or more elevators serving requests from many floors.

Get Soma’s stories in your inbox

Join Medium for free to get updates from this writer.

Hint: Separate the elevator (its state and direction) from the dispatcher (which decides which elevator takes which request). Know scheduling ideas like SCAN/LOOK, which keep moving in one direction before reversing. Interviewers like it when you discuss extensibility and edge cases like a full elevator or an out-of-service one.

Practice: Design an Elevator System

14. Design a Conference Room Booking System

The question: Let people search for available rooms and book them without conflicts.

Hint: The heart of it is time-interval overlap: how do you check for conflicts efficiently? Then think concurrency, so two people can’t book the same slot (transactions or locking), plus recurring bookings, cancellations, and time zones.

Practice: Design a Conference Room Booking System

15. Design a Resource Management System

The question: Build a system that allocates and releases shared resources while keeping track of what’s in use.

Hint: Start by defining the core abstractions (resource, allocation, request) and make the allocation policy pluggable through an interface. Then handle the tricky parts: thread safety, what happens when resources run out (wait, fail, or queue), and releasing resources when something crashes.

Practice: Design a Resource Management System

Part 3: ML System Design (2 Questions)

ML system design asks you to design the whole pipeline around a model: data, features, training, serving, and monitoring, not just the model itself. Codemia has a growing ML system design section for this.

16. Design a Spam Detection System

The question: Detect and filter spam messages or emails at scale.

Hint: Frame it as a classification problem and talk about class imbalance (spam is usually a small fraction). Choose metrics carefully: precision and recall matter because blocking real messages is costly. Cover features (content, sender behavior), low-latency serving, a feedback loop from user reports, retraining, and the fact that spammers adapt, so you need to monitor drift.

Practice: Design a Spam Detection System

17. Design a Sentiment Analysis System

The question: Classify text, like reviews or social posts, as positive, negative, or neutral.

Hint: Compare a simple baseline with a fine-tuned transformer and justify the choice based on accuracy, cost, and latency. Discuss how you’d get labeled data, how you’d handle multiple languages and sarcasm, how you’d evaluate it, and how you’d serve it efficiently (batching, caching).

Practice: Design a Sentiment Analysis System

Part 4: AI Agent Design (3 Questions)

These are the questions that are showing up more and more. Codemia has a dedicated Agentic AI section, plus a free Introduction to Agentic AI course if you want the background first.

18. Design a RAG-Based QA Agent

The question: Build an assistant that answers questions using a company’s own documents instead of only the model’s built-in knowledge.

Hint: Walk through the pipeline: ingestion, chunking, embeddings, a vector store, retrieval (often combining keyword and semantic search), and reranking before generation. Then show depth: grounding answers with citations, handling out-of-date documents, reducing hallucinations, and how you’d evaluate retrieval quality and answer quality separately.

Practice (free): Design a RAG-Based QA Agent | Solution (free): Editorial

19. Design an AI Travel Planning Agent

The question: Build an agent that plans trips by searching flights, hotels, and activities based on a user’s preferences.

Hint: Focus on tool use and orchestration: how the agent calls external APIs, keeps track of state and constraints (budget, dates), and recovers when a tool fails. Think about when it should ask the user to confirm (especially before booking or paying), how you’d limit cost and latency, and how you’d evaluate whether the plans are actually good.

Practice (free): Design an AI Travel Planning Agent

20. Design a Code Generation Agent

The question: Build an agent that writes, runs, and fixes code to complete programming tasks.

Hint: The key ideas are a feedback loop (generate, run tests, read errors, fix) and a sandbox so generated code can’t harm your systems. Discuss how the agent gets relevant context from a large codebase, what permissions it has, how you cap loops and cost, and how you measure success, for example by test pass rate.

Practice: Design a Code Generation Agent

Where to Start: The Free Problems

If you want to try before committing to anything, start with these six, which are free on Codemia:

  1. URL Shortener (TinyURL) Editorial
  2. Twitter Editorial
  3. Ticketmaster Editorial
  4. Parking Lot System Editorial
  5. RAG-Based QA Agent Editorial
  6. AI Travel Planning Agent (problem only)

For free problems, the editorials and other features are free. For paid problems, the editorial solutions are locked behind Premium, which also adds the full problem library, high-scoring solutions, AI-driven iterative feedback, and your feedback history. Codemia says it’s adding two or three new editorial solutions every week. You can see the current price on the pricing page.

8 More Problems to Practice

Once you’ve worked through the 20 above, these are good next steps:

A 4-Week Plan

  • Week 1: TinyURL, Pastebin, and the API rate limiter. Learn the building blocks: caching, key generation, and distributed counters.
  • Week 2: Twitter, Messenger, Ticketmaster, and the presence service. Focus on fan-out, real-time delivery, and contention.
  • Week 3: The five low-level problems, plus the two ML problems.
  • Week 4: The three AI agent problems, then mock interviews to practice explaining your designs out loud.

Final Thoughts

You don’t need to memorize answers to these questions. Interviewers care about how you think: how you clarify requirements, estimate scale, choose trade-offs, and respond to follow-up questions. The way to get better at that is to practice, get feedback, and repeat.

My suggestion is to start with a free one today. Open the TinyURL problem on Codemia, spend 45 minutes on it before you look at anything, and then compare with the editorial. That one exercise will show you a lot about where you stand.

All the best with your preparation, and let me know in the comments which question you found hardest.

P.S. If you’re short on time, pick one question from each part: Twitter, the Parking Lot, Spam Detection, and the RAG-Based QA Agent. Together they cover the four main kinds of design interview you’re likely to face.

--

--

Freelancer, 9k+ LinkedIn, 6K+ Medium. Write about Java, DSA, system design and interviews. Subscribe to my newsletter for more: reactjava.substack.com

Javarevisited
Javarevisited

Published in Javarevisited

A humble place to learn Java and Programming better.