# Category Archives: Stack

## Intuit Interview Experience | Set 11 (On-Campus)

Intuit was the first company to visit our campus. They selected 6 students. Online Round ———————— Only people with CGPA of 9+ were allowed to… Read More »

## MakeMyTrip Interview Experience | Set 11 (Developer Position)

I recently go interviewed for MakeMyTrip Developer position. I had 5 rounds: Round 1: 1) Reverse a Linked List – You should be able to… Read More »

## Implement a stack using single queue

We are given queue data structure, the task is to implement stack using only given queue data structure. We have discussed a solution that uses… Read More »

## Design a stack that supports getMin() in O(1) time and O(1) extra space

Question: Design a Data Structure SpecialStack that supports all the stack operations like push(), pop(), isEmpty(), isFull() and an additional operation getMin() which should return… Read More »

## Check if two trees are Mirror

Given two Binary Trees, write a function that returns true if two trees are mirror of each other, else false. For example, the function should… Read More »

## Maximum size rectangle binary sub-matrix with all 1s

Given a binary matrix, find the maximum size rectangle binary-sub-matrix with all 1’s. Example: Input: 0 1 1 0 1 1 1 1 1 1… Read More »

## Stack Class in Java

Java Collection framework provides a Stack class which models and implements Stack data structure. The class is based on the basic principle of last-in-first-out. In… Read More »

## Form minimum number from given sequence

Given a pattern containing only I’s and D’s. I for increasing and D for decreasing. Devise an algorithm to print the minimum number following that… Read More »

## MAQ Software Interview Experience | Set 10 (On-Campus)

1. Written Round : 1) 30 Aptitude questions(30 min). 2) 2-Coding questions(30 min). 2-a) Write an algorithm for dutch national flag problem 2-b) Write an… Read More »

## Walmart Lab Interview Experience | Set 8 (Off-Campus 3 Years Experience)

Round 1 (Coding round): 1) Range [L, R] is given. Need to find what is the maximum repeating digit in prime numbers between L and… Read More »

## Check if a given array can represent Preorder Traversal of Binary Search Tree

Given an array of numbers, return true if given array can represent preorder traversal of a Binary Search Tree, else return false. Expected time complexity… Read More »

## Minimum number of bracket reversals needed to make an expression balanced

Given an expression with only ‘}’ and ‘{‘. The expression may not be balanced. Find minimum number of bracket reversals to make the expression balanced.… Read More »

## Iterative Depth First Traversal of Graph

Depth First Traversal (or Search) for a graph is similar to Depth First Traversal (DFS) of a tree. The only catch here is, unlike trees,… Read More »

## Sort a stack using recursion

Given a stack, sort it using recursion. Use of any loop constructs like while, for..etc is not allowed. We can only use the following ADT… Read More »

## Length of the longest valid substring

Given a string consisting of opening and closing parenthesis, find the length of the longest valid parenthesis substring. Examples: Input : ((() Output : 2… Read More »