Efficient approach: If we are allowed to buy and sell only once, then we can use following algorithm. Maximum difference between two elements. Here we… Read More

# Tag Archives: Directi

The cost of a stock on each day is given in an array, find the max profit that you can make by buying and selling… Read More

Arranged by a recruiter. They conduct a total of 3 rounds for SDE2 Round 1: 3 questions on DS-Algo of Medium difficulty Given a binary… Read More

Given a binary matrix M where each element of the matrix will be 0 or 1, the task is to find the largest square that… Read More

Set 1: Sliding Window Maximum (Maximum of all subarrays of size k).Given an array arr of size N and an integer K, the task is… Read More

I decided to write this article to help my fellow juniors with there interviews. I am not saying everything which I write in this article… Read More

Media.net came to our campus for Site Reliability Engineer role. The selection process had MCQ round followed by socket programming round, and technical interview round… Read More

Media.net came to our campus for Site Reliability Engineer role. The selection process had MCQ round followed by Coding round, 2 technical interviews and finally… Read More

There were total 2 telephonic rounds and 4 onsite rounds. Telephonic Rounds: Round 1 Given an array of Length N. You have to select two… Read More

Given two strings A and B, both strings contain characters a and b and are of equal lengths. There is one _ (empty space) in… Read More

Given a string ‘S’ consisting of open and closed brackets, the task is find the number of ways in which each character of ‘S’ can… Read More

Given two arrays of integers arr and P such that after a cycle an element arr[i] will be at location arr[P[i]]. The task is to… Read More