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
- Google OA: What is the time complexity of finding the k-th smallest element in an unsorted array of n elements using the Quickselect algorithm, on average?Intermediate· multiple choice₹99 (Interview Prep or Pro plan required)
- Google OA: Which algorithm correctly finds shortest paths from a single source in a graph that contains negative edge weights but no negative cycles?Intermediate· multiple choice₹99 (Interview Prep or Pro plan required)
- Microsoft OA output prediction: What does this C-style snippet print? int i = 5; printf("%d", i++ + ++i);Advanced· multiple choice₹99 (Interview Prep or Pro plan required)
- Microsoft OA: What is the time complexity of the standard dynamic-programming solution to the 0/1 Knapsack problem with n items and capacity W?Intermediate· multiple choice₹99 (Interview Prep or Pro plan required)
- Meta OA: What is the time complexity of computing whether two strings are anagrams by counting character frequencies, for strings of length n over a fixed alphabet?Beginner· multiple choiceFree
- Meta OA: In graph terms, finding the minimum number of edges between two nodes in an unweighted graph is best done with which algorithm?Beginner· multiple choiceFree
- Meta OA: For the problem 'given n intervals, find the minimum number of meeting rooms required', which approach is optimal?Advanced· multiple choice₹99 (Interview Prep or Pro plan required)
- Apple OA output prediction: In C, given 'int arr[5]; ' what does 'sizeof(arr)/sizeof(arr[0])' evaluate to on a typical platform?Intermediate· multiple choiceFree
- Which technique solves "best value under a running constraint" problems such as 0/1 knapsack by storing answers to overlapping subproblems, and which two properties make a problem suitable for it?Intermediate· multiple choice₹99 (Interview Prep or Pro plan required)
- Snowflake OA SQL: A query has 'WHERE status = 'active' AND created_at > '2024-01-01''. Which single index best serves it?Advanced· multiple choice₹99 (Interview Prep or Pro plan required)
- Uber OA: To find the shortest driving time between two points on a road network with non-negative travel times, which algorithm is the standard choice?Intermediate· multiple choice₹99 (Interview Prep or Pro plan required)
- Uber OA: Which HTTP status code family (2xx/4xx/5xx) indicates the client sent a bad request that the server could not process due to client error?Beginner· multiple choiceFree
- Airbnb OA: To find whether any two listings have overlapping booking date intervals among n intervals, which approach is optimal?Intermediate· multiple choice₹99 (Interview Prep or Pro plan required)
- Airbnb OA: The 'search listings within a price budget maximizing total rating' where each listing is taken at most once is an instance of which classic problem?Intermediate· multiple choice₹99 (Interview Prep or Pro plan required)
- Given a batch of N profile-view counts (one count per profile) with K much smaller than N, which approach finds the top K most-viewed profiles in a single pass using only O(K) extra memory, and how does it compare with heapify-all and quickselect?Intermediate· multiple choice₹99 (Interview Prep or Pro plan required)
- You need to detect whether a directed connections graph (member to member) contains a cycle. Which algorithm correctly detects a cycle in a directed graph?Intermediate· multiple choice₹99 (Interview Prep or Pro plan required)
- You are parsing monetary amounts for a payment API. Why should currency amounts generally be stored and computed as integer minor units (e.g., cents) rather than as IEEE-754 doubles?Intermediate· multiple choice₹99 (Interview Prep or Pro plan required)
- In a distributed ledger service, two concurrent transfers read a balance of 100 and each debit 100. What database technique prevents both from succeeding and overdrawing the account?Advanced· multiple choice₹99 (Interview Prep or Pro plan required)
- A currency-conversion feature needs exchange rates between currencies where only some direct pairs are known. Modeling currencies as nodes and known rates as weighted edges, which approach finds a conversion path and detects an arbitrage (profit) cycle?Expert· multiple choice₹499 (Pro plan required)
- What is the time complexity of the following Python code? total = 0 for i in range(n): for j in range(i, n): total += 1Beginner· multiple choiceFree
- In a relational database, which normal form violation is present if a non-key column depends on only part of a composite primary key?Intermediate· multiple choiceFree
- In C, what is the result of printf("%d", x++ + ++x); with int x = 5;, and what does the corrected code int a = x++; int b = ++x; print?Intermediate· output based₹99 (Interview Prep or Pro plan required)
- Which of the following correctly describes a primary key in a relational table?Beginner· multiple choiceFree
- In pseudocode, what does the following loop compute for a positive integer n? result = 1 while n > 1: result = result * n n = n - 1 return resultBeginner· multiple choiceFree
- Which layer of the OSI model is responsible for routing packets between different networks using logical (IP) addresses?Intermediate· multiple choiceFree
- Which sorting algorithm is stable and guarantees O(n log n) time in the worst case?Intermediate· multiple choiceFree
- Which normal form specifically eliminates transitive functional dependencies of non-key attributes on the primary key?Intermediate· multiple choiceFree
- The ACID property 'Durability' guarantees that:Beginner· multiple choiceFree
- Under the READ COMMITTED isolation level, which concurrency phenomenon is still possible?Advanced· multiple choice₹99 (Interview Prep or Pro plan required)
- What is the fundamental difference between a clustered index and a non-clustered index?Intermediate· multiple choice₹99 (Interview Prep or Pro plan required)