Top CS Fundamentals Interview Questions (2026)
Practice the 83 most-asked CS Fundamentals interview questions, each with a model answer, key points, and the mistakes to avoid. Filter by difficulty, reveal answers, and rate your confidence to track how interview-ready you are.
83 questions Open in question bank
CS Fundamentals questions
- Find the k-th largest element in an unsorted array.
[Heap]Intermediate· coding₹99 (Interview Prep or Pro plan required) - Count the number of islands in a 2D grid of land and water.
[BFS/DFS]Intermediate· coding₹99 (Interview Prep or Pro plan required) - Given a collection of intervals, merge all overlapping intervals.Intermediate· coding₹99 (Interview Prep or Pro plan required)
- There are numCourses labeled 0..n-1 with prerequisite pairs. Return an ordering in which you can finish all courses, or empty if impossible (Course Schedule II).Advanced· coding₹99 (Interview Prep or Pro plan required)
- Given a sorted array, find the k closest integers to a target x (x may not be in the array). Return them in ascending order.Intermediate· coding₹99 (Interview Prep or Pro plan required)
- Given a sorted dictionary of an alien language (list of words in lexicographic order), derive the order of its characters (Alien Dictionary).Advanced· coding₹499 (Pro plan required)
- Implement atoi: convert a string to a 32-bit signed integer, handling whitespace, sign, and overflow (String to Integer).Intermediate· coding₹99 (Interview Prep or Pro plan required)
- Given a string and a dictionary of words, determine whether the string can be segmented into a space-separated sequence of dictionary words (Word Break).Intermediate· coding₹99 (Interview Prep or Pro plan required)
- Implement a thread-safe asynchronous logger in Java that lets many threads write log entries concurrently while a single writer thread flushes them to disk efficiently.Advanced· coding₹499 (Pro plan required)
- Implement a thread-safe rate limiter in Java that allows at most N operations per second, callable safely from many threads.Advanced· coding₹499 (Pro plan required)
- Implement a bounded blocking queue (producer-consumer) from scratch using locks and condition variables.Advanced· coding₹99 (Interview Prep or Pro plan required)
- Given a weighted graph, find the minimum-cost path from a source to a destination.Intermediate· coding₹99 (Interview Prep or Pro plan required)
- House Robber: given an array of house values, maximize the sum you can rob without robbing two adjacent houses.Intermediate· codingFree
- Given a board of characters and a list of words, return all words that can be formed by sequentially adjacent cells (Word Search II).Advanced· coding₹499 (Pro plan required)
- Count the number of connected components in an undirected graph (or islands in a grid), and discuss the incremental/streaming version.Intermediate· coding₹99 (Interview Prep or Pro plan required)
- Given a large log/event stream, find the top K most frequent elements efficiently.Intermediate· coding₹99 (Interview Prep or Pro plan required)
- Maximum Points You Can Obtain from Cards: given an array
cardPointsand integerk, you take exactly k cards from either the beginning or the end each turn. Return the maximum total points obtainable.Intermediate· coding₹99 (Interview Prep or Pro plan required) - Given an array of words and a maximum line width L, format the text so that each line has exactly L characters and is fully (left and right) justified. Pack as many words per line as possible and distribute extra spaces as evenly as possible; the last line and any line with a single word are left-justified.Advanced· coding₹499 (Pro plan required)
- Given a menu as a list of item prices and a target value K, find all possible combinations of items that sum to exactly K. (A variation of the classic combination-sum / N-sum problem asked in Airbnb's first round.)Intermediate· coding₹99 (Interview Prep or Pro plan required)
- Write a method to parse an input string in CSV format. Handle quoted fields that may contain commas and escaped double quotes (a doubled "" inside a quoted field represents a literal quote).Intermediate· coding₹99 (Interview Prep or Pro plan required)
- Cheapest Flights Within K Stops: given n cities, a list of flights [from, to, price], a source, a destination and an integer K, return the cheapest price from source to destination with at most K stops, or -1 if it is not possible.Advanced· coding₹499 (Pro plan required)
- Given two strings s and t, determine if they are isomorphic - characters in s can be replaced to get t with a consistent one-to-one mapping (no two characters map to the same character). (LeetCode 205 - Isomorphic Strings)Beginner· codingFree
- Given a flowerbed as an array of 0s and 1s (0 = empty, 1 = planted) where no two flowers may be adjacent, determine if n new flowers can be planted without violating the no-adjacent rule. (LeetCode 605 - Can Place Flowers)Beginner· codingFree
- Given exchange rates as a string like "USD:CAD:1.2,CAD:GBP:0.6,USD:AUD:1.4", write a function that converts an amount from a source to a target currency, including multi-step paths (USD to GBP via CAD). Then extend it to return the best achievable rate when several paths exist, and handle rates that form an arbitrage cycle.Intermediate· coding₹499 (Pro plan required)
- Implement a retry helper that calls a flaky function (e.g. a payment or API call) and retries on failure using exponential backoff with jitter, a maximum number of attempts, and a maximum delay cap. Only retry on transient/retryable errors.Intermediate· coding₹99 (Interview Prep or Pro plan required)
- Explain the four pillars of OOP with a real-world example of each.Beginner· conceptualFree
- What are the ACID properties in a DBMS, and why do they matter?Beginner· conceptualFree
- What is normalization? Explain 1NF, 2NF, and 3NF with the problems they solve.Intermediate· conceptualFree
- What is the difference between the OSI model and the TCP/IP model, and which layer does a router operate at?Intermediate· comparisonFree
- Amazon OA: A recursive function computes Fibonacci as fib(n)=fib(n-1)+fib(n-2) with no memoization. What is its time complexity?Beginner· multiple choiceFree