Quora Coding Interview Questions
26 Quora coding interview problems with full optimal solutions — 17 easy, 7 medium, 2 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Quora interviewer values, and a FAQ section.
Showing 7 problems of 26
- #18mediumfoundational
18. Top K Frequent Elements
Return the k most frequent elements in an array — Quora's question-ranking system runs this exact top-K pattern to surface the most-viewed topics for a given user cohort in real time.
- #19mediumfoundational
19. Course Schedule
Detect a cycle in a directed graph of prerequisites — Quora uses this exact topological-sort check to validate that answer-dependency graphs in their knowledge graph have no circular references.
- #20mediumfoundational
20. Word Search
Find a word hidden in a 2-D character grid — Quora applies this backtracking-DFS pattern to their entity-extraction engine when scanning structured text fields for keyword sequences.
- #21mediumfoundational
21. LRU Cache
Design a cache that evicts the least-recently-used entry — Quora's answer-caching layer runs this exact doubly-linked-list + hash-map pattern to keep hot Q&A pairs in memory without blowing the cache budget.
- #22mediumfoundational
22. Find K Pairs with Smallest Sums
Return the k pairs from two sorted arrays with the smallest sums — Quora uses this min-heap merge pattern to blend two ranked recommendation lists into a single top-K feed without sorting the full cross-product.
- #23mediumfoundational
23. Longest Substring Without Repeating Characters
Find the longest contiguous substring with all unique characters — Quora's query-normalisation step applies this sliding-window pattern to extract the longest non-repetitive token sequence from user search strings.
- #24mediumfoundational
24. Implement Trie (Prefix Tree)
Build a prefix tree that supports insert, search, and startsWith — Quora's autocomplete engine is a production trie; they ask you to implement one from scratch to verify you understand the branching mechanics under the hood.