Coursera Coding Interview Questions
25 Coursera coding interview problems with full optimal solutions — 15 easy, 7 medium, 3 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Coursera interviewer values, and a FAQ section.
Showing 15 problems of 25
- #15easysometimes
15. Pascal's Triangle
Pascal's Triangle asks you to materialize the first numRows rows of the triangle where every interior cell is the sum of the two cells directly above it. Coursera-reported phone screens use this easy LeetCode 118 warm-up to check three things fast: can you construct a 2-D array cleanly, can you state the row-build invariant out loud, and do you recognize that O(n^2) time is output-bound because the answer itself contains roughly n^2/2 numbers.
- #1easyfoundational
1. Two Sum
Find two indices whose values sum to a target — Coursera uses this to gauge hash-table fluency in a learner-pairing context.
- #2easyfoundational
2. Valid Parentheses
Validate that a string of brackets is well-formed — Coursera uses this to test stack discipline in a course-syntax-checker context.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted linked lists into one — Coursera uses this to test pointer hygiene in a sorted-content-streams setting.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
In-place dedupe of a sorted array — Coursera tests two-pointer fluency in a learner-history dedupe scenario.
- #5easyfoundational
5. Remove Element
Remove all instances of a value in-place — Coursera uses this to test two-pointer fluency for filtering enrollment lists.
- #6easyfoundational
6. Search Insert Position
Find the insert index in a sorted array — Coursera tests binary-search invariants for ordered course-catalog inserts.
- #7easyfoundational
7. Maximum Subarray
Find the contiguous subarray with the largest sum — Coursera uses this to test Kadane in a learner-engagement streak setting.
- #8easyfoundational
8. Plus One
Increment a digit array by one — Coursera uses this to test carry-propagation cleanliness for grade-encoded counters.
- #9easyfoundational
9. Merge Sorted Array
Merge two sorted arrays in-place — Coursera tests back-fill two-pointer technique for in-place enrollment merges.
- #10easyfoundational
10. Binary Tree Inorder Traversal
Return inorder traversal of a binary tree — Coursera tests recursive-vs-iterative tradeoffs in a course-tree walking context.
- #11easyfoundational
11. Same Tree
Decide if two binary trees are structurally identical — Coursera tests recursive structural compare for course-tree diffing.
- #12easyfoundational
12. Maximum Depth of Binary Tree
Find the maximum depth of a binary tree, a foundational tree-traversal problem Coursera uses to test recursive thinking for hierarchical course-content structures.
- #13easyfoundational
13. Balanced Binary Tree
Determine whether a binary tree is height-balanced, a tree-depth problem Coursera uses to gauge clean recursive design.
- #14easyfoundational
14. Path Sum
Check whether a root-to-leaf path summing to a target exists, a DFS problem Coursera uses to test tree traversal for prerequisite-chain checks.