moengage logo
MoengageĀ· SDE - 2

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

Posted
22 Apr 2026
275 reads

Summary

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

How it went

šŸš€ 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 šŸ‘‡

Questions asked (2)

  1. 01

    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. 02

    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

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Moengage recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

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