MoEngage Interview DSA Questions || SDE - 2 || Round - 1 || Rejected

moengage logo
moengage
ยท SDE - 2
April 22, 2026 ยท 1 reads

Summary

I interviewed for an SDE-2 position at MoEngage, went through round 1 DSA questions but was ultimately rejected.

Full Experience

๐Ÿš€ MoEngage Interview DSA Questions

Sharing a couple of interesting problems asked in my interview with MoEngage ๐Ÿ‘‡


๐Ÿงฉ 1. Valid Parenthesis String

Given a string s containing only three types of characters: '(', ')' and '*', return true if s is valid.

The following rules define a valid string:

  • Any left parenthesis '(' must have a corresponding right parenthesis ')'.

  • Any right parenthesis ')' must have a corresponding left parenthesis '('.

  • Left parenthesis '(' must go before the corresponding right parenthesis ')'.

  • '*' could be treated as:

    • a single right parenthesis ')', or
    • a single left parenthesis '(', or
    • an empty string "".

Example 1: Input: s = "()" Output: true

Example 2: Input: s = "((*)" Output: true


๐Ÿš— 2. Car Fleet

There are n cars at given miles away from the starting mile 0, traveling to reach the mile target.

You are given two integer arrays position and speed, both of length n, where:

  • position[i] is the starting mile of the i-th car.
  • speed[i] is the speed of the i-th car in miles per hour.

A car cannot pass another car, but it can catch up and then travel next to it at the speed of the slower car.

A car fleet is a single car or a group of cars driving together at the same speed.

If a car catches up to a fleet at the destination point, it is still considered part of the fleet.

Return the number of car fleets that will arrive at the destination.

Example: Input: target = 12 position = [10,8,0,5,3] speed = [2,4,2,1,3]

Output: 3


๐Ÿ”ฅ Good mix of greedy + stack thinking. Try solving without brute force!

Let me know your approach ๐Ÿ‘‡

Interview Questions (2)

1.

Valid Parenthesis String

Data Structures & Algorithms

Given a string s containing only three types of characters: '(', ')' and '*', return true if s is valid.

The following rules define a valid string:

  • Any left parenthesis '(' must have a corresponding right parenthesis ')'.
  • Any right parenthesis ')' must have a corresponding left parenthesis '('.
  • Left parenthesis '(' must go before the corresponding right parenthesis ')'.
  • '*' could be treated as a single right parenthesis ')', a single left parenthesis '(', or an empty string "".

Example 1: Input: s = "()" Output: true

Example 2: Input: s = "((*)" Output: true

2.

Car Fleet

Data Structures & Algorithms

There are n cars at given miles away from the starting mile 0, traveling to reach the mile target.

You are given two integer arrays position and speed, both of length n, where:

  • position[i] is the starting mile of the i-th car.
  • speed[i] is the speed of the i-th car in miles per hour.

A car cannot pass another car, but it can catch up and then travel next to it at the speed of the slower car.

A car fleet is a single car or a group of cars driving together at the same speed.

If a car catches up to a fleet at the destination point, it is still considered part of the fleet.

Return the number of car fleets that will arrive at the destination.

Example: Input: target = 12 position = [10,8,0,5,3] speed = [2,4,2,1,3]

Output: 3

๐Ÿ“ฃ Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!