Postman Coding Interview Questions
32 Postman coding interview problems with full optimal solutions — 10 easy, 17 medium, 5 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Postman interviewer values, and a FAQ section.
Showing 32 problems of 32
- #1easyfoundational
1. Two Sum
Given an array of integers and a target, return indices of the two numbers that add up to the target.
- #2easyfoundational
2. Valid Parentheses
Given a string of brackets, determine if every opening bracket has a matching closing bracket in the correct order.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted linked lists into a single sorted list by splicing nodes.
- #4easyfoundational
4. Best Time to Buy and Sell Stock
Find the maximum profit from one buy-sell transaction on a price timeline.
- #5easyfoundational
5. Reverse Linked List
Reverse a singly linked list in place and return the new head.
- #6easyfoundational
6. Contains Duplicate
Return true if any value appears at least twice in an integer array.
- #7easyfoundational
7. Valid Anagram
Return true if two strings are anagrams of each other.
- #8easyfoundational
8. Valid Palindrome
Determine whether a string is a palindrome after stripping non-alphanumerics and lowercasing.
- #9easyfoundational
9. Binary Tree Inorder Traversal
Return the inorder traversal of a binary tree's values.
- #10mediumfoundational
10. Add Two Numbers
Add two numbers represented by linked lists in reverse-digit order.
- #11mediumfoundational
11. Longest Substring Without Repeating Characters
Find the length of the longest substring without repeating characters.
- #12mediumfoundational
12. Group Anagrams
Group strings into lists where each list contains anagrams of each other.
- #13mediumfoundational
13. LRU Cache
Design a least-recently-used cache with O(1) get and put.
- #14mediumfoundational
14. 3Sum
Find all unique triplets in the array that sum to zero.
- #15mediumfoundational
15. Container With Most Water
Find two vertical lines that with the x-axis form a container holding the most water.
- #16mediumfoundational
16. Spiral Matrix
Return all elements of an m x n matrix in spiral order.
- #17mediumfoundational
17. Word Break
Decide whether a string can be segmented into a sequence of dictionary words.
- #18mediumfoundational
18. Number of Islands
Count connected components of land cells in a 2D grid.
- #19mediumfoundational
19. Coin Change
Return the fewest number of coins needed to make up an amount, or -1 if impossible.
- #20mediumfoundational
20. Clone Graph
Deep-copy a connected undirected graph given a node reference.
- #21mediumfoundational
21. Course Schedule
Decide whether all courses can be completed given prerequisite pairs (cycle detection).
- #22hardfoundational
22. Median of Two Sorted Arrays
Find the median of two sorted arrays in logarithmic time.
- #23hardfoundational
23. Merge k Sorted Lists
Merge k sorted linked lists into a single sorted list.
- #24hardfoundational
24. Trapping Rain Water
Compute how much rain water can be trapped between bars of given heights.
- #25hardfoundational
25. Minimum Window Substring
Find the smallest substring of s that contains every character of t with the required multiplicity.
- #26mediumfoundational
26. Maximum Subarray
Find the contiguous subarray with the largest sum.
- #27mediumfoundational
27. Product of Array Except Self
Return an array where each element is the product of all other elements, without using division.
- #28easyfoundational
28. Climbing Stairs
Count distinct ways to climb n stairs taking 1 or 2 steps at a time.
- #29mediumfoundational
29. Word Search
Check whether a word can be formed in a 2D grid by traversing adjacent cells.
- #30mediumfoundational
30. Implement Trie (Prefix Tree)
Implement a trie supporting insert, search, and prefix-search in O(L).
- #31hardfoundational
31. Serialize and Deserialize Binary Tree
Encode a binary tree to a string and decode it back to an identical tree.
- #32mediumfoundational
32. Longest Palindromic Substring
Find the longest palindromic substring within a given string.