All company sheets
MongoDB logo

MongoDB DSA interview questions

58 problems to practise before your MongoDB online test or coding round. Most widely asked first.

58
Questions
13
Easy
36
Medium
9
Hard

Commonly reported. Problems candidates often report from this company’s coding rounds. These are Astra’s own tags, not an official question list.

MongoDB is hiring · 17 open roles on Astra right nowView roles

58 questions

  1. 1

    Maximum Subarray

    EasyArrayTagged at 7 companies
  2. 2

    Invert a Binary Tree (Mirror Tree)

    EasyRecursionTagged at 7 companies
  3. 3

    Find Two Indices That Sum to a Target Value

    EasyArrayTagged at 7 companies
  4. 4

    Move All Zeroes to the End of an Array In-Place

    EasyArrayTagged at 7 companies
  5. 5

    Find All Numbers Disappeared in an Array (O(1) Space)

    EasyArrayTagged at 7 companies
  6. 6

    Find the Missing Number in an Array from 1 to N

    EasyArrayTagged at 7 companies
  7. 7

    Sort an Array of Squares of a Sorted Array

    EasyArrayTagged at 7 companies
  8. 8

    Merge Intervals

    MediumArrayTagged at 7 companies
  9. 9

    Find Minimum in Rotated Sorted Array

    MediumArrayTagged at 7 companies
  10. 10

    Non-overlapping Intervals

    MediumGreedyTagged at 7 companies
  11. 11

    Swap Every Two Adjacent Nodes in a Linked List

    MediumRecursionTagged at 7 companies
  12. 12

    Search for a Word in a 2D Grid Board

    MediumRecursionTagged at 7 companies
  13. 13

    Implement Merge Sort Algorithm Recursively

    MediumRecursionTagged at 7 companies
  14. 14

    Find the Minimum Element in a Rotated Sorted Array

    MediumBinary SearchTagged at 7 companies
  15. 15

    Find Product of Array Elements Except Self

    MediumArrayTagged at 7 companies
  16. 16

    Find the Longest Subarray of 1s After Deleting One Element

    MediumArrayTagged at 7 companies
  17. 17

    Find Minimum Number of Arrows to Burst Balloons

    MediumArrayTagged at 7 companies
  18. 18

    Chrome Tab History Unique Domains

    MediumSliding WindowTagged at 7 companies
  19. 19

    IoT Sensor Anomaly Detection

    MediumSliding WindowTagged at 7 companies
  20. 20

    String Compression Decoder

    MediumTwo PointersTagged at 7 companies
  21. 21

    Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold

    MediumSliding WindowTagged at 7 companies
  22. 22

    Valid Parentheses

    EasyStringTagged at 6 companies
  23. 23

    Find the Intersection of Two Linked Lists

    EasyLinkedListTagged at 6 companies
  24. 24

    Remove Duplicates from an Unsorted Linked List

    EasyLinkedListTagged at 6 companies
  25. 25

    Check if Two Binary Trees are the Same

    EasyTreeTagged at 6 companies
  26. 26

    Check if a Binary Tree is a Subtree of Another Tree (Microsoft/Amazon)

    EasyTreeTagged at 6 companies
  27. 27

    Group Anagrams

    MediumStringTagged at 6 companies
  28. 28

    Minimum Swaps To Make Sequences Increasing

    MediumDPTagged at 6 companies
  29. 29

    Predict the Winner of the Dota2 Senate Game

    MediumStack and QueueTagged at 6 companies
  30. 30

    Minimum Add to Make Parentheses Valid

    MediumStack and QueueTagged at 6 companies
  31. 31

    Design a Stack with Increment Operation Support

    MediumStack and QueueTagged at 6 companies
  32. 32

    Find the Minimum Cost Tree From Leaf Values

    MediumStack and QueueTagged at 6 companies
  33. 33

    Find Minimum Turns to Open the Lock

    MediumStack and QueueTagged at 6 companies
  34. 34

    Find Least Number of Perfect Squares that Sum to N

    MediumStack and QueueTagged at 6 companies
  35. 35

    Find the Length of the Loop in a Linked List

    MediumLinkedListTagged at 6 companies
  36. 36

    Convert Binary Tree to a Circular Doubly Linked List

    MediumLinkedListTagged at 6 companies
  37. 37

    Delete N Nodes After M Nodes of a Linked List

    MediumLinkedListTagged at 6 companies
  38. 38

    Validate a Binary Search Tree (In-order Traversal)

    MediumTreeTagged at 6 companies
  39. 39

    Find Minimum Deletions to Make Character Frequencies Unique

    MediumStringTagged at 6 companies
  40. 40

    Remove All Adjacent Duplicates in a String II (K Duplicates)

    MediumStringTagged at 6 companies
  41. 41

    Determine if Two Strings are 'Close' Strings

    MediumStringTagged at 6 companies
  42. 42

    Implement a String Compression Function (e.g., 'aabcccccaaa')

    MediumStringTagged at 6 companies
  43. 43

    Amazon Delivery Truck Loading

    MediumDynamic ProgrammingTagged at 6 companies
  44. 44

    Check if Graph is Bipartite using BFS

    EasyGraphTagged at 5 companies
  45. 45

    Meeting Rooms II

    MediumHeapTagged at 5 companies
  46. 46

    Word Search

    MediumBacktrackingTagged at 5 companies
  47. 47

    Google Search Autocomplete Engine

    MediumTrieTagged at 5 companies
  48. 48

    Chrome Browser History

    MediumDesignTagged at 5 companies
  49. 49

    Ticketmaster Double Booking Prevention

    MediumDesignTagged at 5 companies
  50. 50

    Shortest Palindrome

    HardStringTagged at 5 companies
  51. 51

    Reverse Nodes in k-Group Blocks

    HardLinkedListTagged at 5 companies
  52. 52

    Flatten a Linked List (with Next and Bottom Pointers)

    HardLinkedListTagged at 5 companies
  53. 53

    Find the Median from a Continuous Data Stream

    HardTreeTagged at 5 companies
  54. 54

    Find the Binary Tree Maximum Path Sum (Amazon/Apple)

    HardTreeTagged at 5 companies
  55. 55

    Instagram Feed Aggregator

    HardLinked ListTagged at 5 companies
  56. 56

    Dungeon Game

    HardDPTagged at 4 companies
  57. 57

    Split Array Largest Sum

    HardDPTagged at 4 companies
  58. 58

    Find Median from Data Stream

    HardHeapTagged at 3 companies

More company sheets