You are given an array of integers arr where each element represents the height of a bar in a histogram. Histogram is a graphical display of data using bars of different heights. The bars are placed in the exact same sequence as given in the array. You need to find the area of the largest rectangle found in the given histogram.
You are given an integer array arr of size n. Assume a sliding window of size k starting from index 0. In each iteration, the sliding window moves to the right by one position till n-k. Write a program to return an array representing the maximum number in all sliding windows.
Hashing is a way to store data into some data structure (generally Hash Table is used) in such a way that the basic operations on that data i.e. the insertion, deletion, and searching can be performed in O(1) time. It is one of the important concepts that every programmer and developer should know. In this blog, we will know some of the applications on Hash Table.
There are N gas stations along a circular route, where the amount of gas at station i is arr[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its next station (i+1). At the beginning of the journey, the tank is empty at one of the gas stations. Return the minimum starting gas station's index if you can travel around the circuit once, otherwise return -1.
In this blog, we will see one of the deadlock avoidance methods i.e. Banker's Algorithm. In this algorithm, we will discuss that if we are given the number of resources available and the number of resources required by the process then we can tell that if the system will go in deadlock or not. We will understand this concept with the help of an example.
In this tutorial, we are going to learn about Express.js, why it is used, what all features it offers, and how it is used in the development environment. This tutorial will provide you with the most basic and important knowledge that is required in order to use Express in web application servers.
Given a binary tree, return the zigzag level order traversal of its nodes' values. (i.e, from left to right, then right to left for the next level and alternate between). The problem is a typical Interview problem based on Tree Traversal
Given a binary tree and a sum, write a program to determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Its an easy problem based on Binary tree traversal and a famous interview question
This is an interview problem asked in companies like Amazon, Microsoft, Yahoo and Adobe. The problem is to design a stack that will support push(), pop(), top() and getMin() operation in constant time. We will be discussing two different ways to approach this problem.
In this blog, we will learn about threads and its two types i.e. user-level thread and kernel-level thread. We will also see what are the advantages of using threads in the OS. Finally, we will learn about the difference between process and thread
In this blog, we will learn about various multithreading models like one-to-one, many-to-one, and many-to-many. We will compare these models and analyze which one is the best. Further, we will also see the benefits of multithreading.
Given an array of integers A[ ], if i < j and A[i] > A[j] then the pair (i, j) is called the inversion of an array A[ ]. You need to write a program to find the total counts of inversion in an array A[ ]. The inversion count of an array suggests how close the array is from being sorted. This problem has been asked in Amazon and Google's interview.
In this blog, we will learn about two non-contiguous memory allocation technique i.e. paging and segmentation. We will also learn how the logical address is converted into the physical address in both the techniques. Further, we will analyze the advantages and disadvantages of each technique.
If you want to share your knowledge with others and want to learn back from them, then you must be in some community. Developer Student Clubs is one such community by Google Developers. Learn how to become a Developer Student Clubs lead at your campus.
Heap is a very useful data structure that every programmer should know well. The heap data structure is used in Heap Sort, Priority Queues. The understanding of heaps helps us to know about memory management. In this blog, we will discuss the various about Heap Building and Heap Sort.
In this blog, we will learn about the two types of addresses that are used for memory in the operating system. Further, we will discuss the difference among these types of memories i.e. logical memory and physical memory.
Given an array arr[ ] of n integers, are there elements x, y, z in arr such that x + y + z = 0? Find all unique triplets in the array which gives the sum of zero. The problem is asked in many interviews and required do be solved in O(n^2) with constant space.
In this blog, we will learn what is a deadlock situation, what are various deadlock handling techniques like deadlock prevention, deadlock avoidance, deadlock detection, and deadlock ignorance.
Today, we are going to learn What is System Design. The goal is to make you understand what is System Design which means that there are few simplifications done while writing this. If you understand what System Design is, then my mission will be accomplished. If you read this article completely, I am sure my mission will be accomplished.
This is an interview problem asked in companies like Microsoft, Amazon, Adobe, Flipkart, etc. Here, we need to implement Queue data structure using another data structure Stack. This problem is meant for testing the data structure knowledge.
In this tutorial, we are going to learn how to upload files on the server with the help of Multer and Express in Node.js. The goal is to make you comfortable in building apps that can easily handle any file uploads. At the end of this blog, you will be able to integrate the file uploads in your own apps.
In this tutorial, we will learn to build the RESTful API using Node and Express. The goal is to make you comfortable in building your RESTful API with Node.js and Express. At the end of this blog, you will be able to build your REST APIs using Node.js and Express.
Heap is a very useful data structure that every programmer should know well. The heap data structure is used in Heap Sort, Priority Queues. The understanding of heaps helps us to know about memory management. In this blog, we will discuss various operations that are done on heaps.
Given an integer, your task is to find the square root of the integer. For an integer x to be the square root of the given integer N, x*x must be equal to N. This is an interview problem asked in companies like Amazon, Microsoft and Facebook.
In this blog, we will learn what are the various types of classes in IPv4 and how we can differentiate among the classes on the basis of the number of bits present the network ID and the host ID of these classes.
In this blog, we will learn about the concept of subnetting, why it is done and how it is done. Further, we will learn about supernetting, why it is done and how it is done. We will also see how the supernet mask of any network is calculated.
Priority Queues are similar to queues where we insert an element from the back and remove an element from the front, but with one difference that the logical order of elements in the priority queue depends on the priority of the elements. In this blog, we will discuss the priority queues, its properties, its various implementations, and its applications. We will also analyze and compare the various implementations of the Priority Queue.
Heap is a very useful data structure that every programmer should know well. The heap data structure is used in Heap Sort, Priority Queues. The understanding of heaps helps us to know about memory management. In this blog, we will discuss the structure, properties, and array implementation of heaps.
This is an interview problem asked by companies like Myntra, Visa, Oracle, Adobe, etc. The problem is to remove the duplicate nodes from the given Linked List so that only unique nodes(with unique data values) are present.
Tree Data Structure supports various operations such as insertion, deletion and searching of elements along with few others. This blogs discussed those operations along with explaining its applications.
Given a Linked List, your task is to find whether the given singly linked list is a palindrome or not. This is an interview problem asked in many companies like Amazon, Microsoft, Adobe, Flipkart and other big companies.
In this blog, we will learn various types of constraints that can be applied on a table. These constraints can be used to validate the data present in the table. We will learn about NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK, and DEFAULT
In this blog, we will learn what is a proxy server, how does it work and what are the various types of proxy servers. We will also see why we should use a proxy server and what are the risks associated with it.
Array and Linked List are the two most used data structures. It's really important to understand and compare the advantages and disadvantages of both array and linked list. In this blog, we will compare these two linear data structures. So let's get started.
In this blog, we will learn what is Address Resolution Protocol and how it helps in communication between two devices. We will also discuss what are the problems that can arise while using this protocol and see sample examples of ARP packets which are captured.
The idea of this blog is to discuss the famous data structure called Array. An Array is one of the important data structures that are asked in the interviews. So, we will learn about arrays and we will also discuss about the idea of the dynamic array and its amortized analysis. So let's get started.
In this blog, we will learn one of the flow control method i.e Stop and Wait Protocol. We will discuss various situations that can occur while transmitting the data. We will also mathematically derive the efficiency and the throughput of this protocol.
In this blog, we will learn about the various network traffic types, that are - Unicasting, Anycasting, Multicasting, and Broadcasting. We'll also see their advantages and disadvantages along with their differences.
Data structures are widely used in every aspect of computer science. Data structures are the way of organizing and storing data in a computer so that it can be used efficiently. In this blog, we will look into data structures, its types, operations and applications.
In this blog, we will learn about different data transmission modes based on the direction of exchange, synchronization between the transmitter and receiver, and the number of bits sent simultaneously in a computer network.
In this blog, we will learn about the various keys like the super key, candidate key, primary key, alternate key and foreign key. We will discuss how to identify and differentiate between them with examples.
In this blog, we will learn what is an attribute, its various types and symbols used to represent them. We will see various types of attributes such as single & multi-valued attributes, simple & composite attribute, stored & derived attribute and key attribute.
In this blog, we will study various types of relationships in DBMS which help in defining the association between various entities. Also, we will discuss the types of participation constraints which may exist between the relationship and the entity type.