You are given an integer n, write a program to find the smallest multiple of n which consists of 0 and 1. The resultant number could be quite large so return it in the form of a string. This problem is a good example of graph-based problems.
You are given the head of a linked list which probably contains a loop. If the list contains a loop, you need to find the last node of the list which points to one of its previous nodes to create a loop and make it point to NULL, thereby removing the loop.
Given a square chessboard of A x B size, the position of Knight (C, D) and the position of a target (E, F) is given. Write a program to find out the minimum steps a Knight will take to reach the target position. This problem is a good example of BFS algorithm.
You are given an unsorted array of integers(arr) of length n, write a program to sort it in wave form. The array elements in the resultant array must be such that arr >= arr <= arr >= arr <= arr ... and so on. If there are multiple sorted orders in wave-form, return the one which is lexicographically smallest.
Sorting is a process of arranging items systematically. There are several ways to sort a list of items. A very useful sorting algorithm in all of the sorting algorithms is quicksort. Given an array of integers arr, write a program to sort the array in ascending order using Quick Sort.
Given two integers n and k, Write a program to return all possible combinations of k numbers out of 1 2 3 ... n. Elements in a combination must be in a non-descending order. The combinations themselves must be sorted in ascending order, i.e., the combination with the smallest first element should be printed first.
There are N children standing in a line with some rating value. You want to distribute a minimum number of candies to these children such that: Each child must have at least one candy. The children with higher ratings will have more candies than their neighbours. Write a program to calculate the minimum candies you must give.
You are given a matrix arr of m x n size. Write a program to searches for a value k in arr. This arr has the following properties: - Integers in each row are sorted from left to right. - The first value of each row is greater than the last value of previous row. This is a basic optimization problem that will clear the concept of searching.
Given an array of integers arr and a target number k, write a program to find all unique combinations in arr such that the sum of all integers in the combination is equal to k. This famous backtracking problem has previously been asked in Adobe, Amazon, Facebook.
Given an array of non-negative integers arr of length n, where each element represents the max number of steps that can be made forward from that element. You are initially positioned at the first index of the array. Write a program to return the minimum number of jumps to reach the last index of the array.
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.