flipkart logo
Flipkart· SDE - 1

Flipkart SDE - 1

Posted
3 Oct 2025
425 reads

Summary

I recently interviewed at Flipkart for an SDE-1 position and was presented with a Data Structures & Algorithms problem involving detecting duplicate parentheses in a balanced expression. I successfully explained my stack-based approach and provided a C++ solution.

How it went

I had a technical interview at Flipkart for the SDE-1 role. The interviewer presented me with a problem to determine if a given balanced expression contains duplicate parentheses. I clarified the problem statement using the provided examples, noting that duplicate parentheses mean a subexpression is enclosed by more than one pair of brackets. I then walked through my thought process, explaining how a stack could be used to efficiently solve this problem by tracking characters and checking for the count of non-'(' characters between matching parentheses. After detailing my approach, I proceeded to implement the solution in C++.

Questions asked (1)

  1. 01

    Detect Duplicate Parentheses in Balanced Expression

    Data Structures & Algorithms · Medium

    Given a balanced expression, find if it contains duplicate parenthesis or not. A set of parenthesis are duplicate if the same subexpression is surrounded by multiple parenthesis

    Below expressions have duplicate parenthesis -
    ((a+b)+((c+d)))
    The subexpression "c+d" is surrounded by two
    pairs of brackets.


    Below expressions don't have any duplicate parenthesis -
    ((a+b)+(c+d))
    No subexpression is surrounded by duplicate
    brackets.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Flipkart 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!