All Medium Articles

[TopTalent.in] How Tech companies Like Their Résumés 3.4

Have all the skills require to be a great Software Engineer? Here are 9 tips to make your résumé look just like how the Tech Companies… Read More »

Efficient Huffman Coding for Sorted Input | Greedy Algo-4 3.3

We recommend to read following post as a prerequisite for this. Greedy Algorithms | Set 3 (Huffman Coding) Time complexity of the algorithm discussed in… Read More »

Amazon Interview | Set 8 3

I recently interviewed with amazon for the position of SDE1 in their TRMS team. The interview procedure was unimaginable rigorous. Here are the details Round… Read More »

Kruskal’s Minimum Spanning Tree Algorithm | Greedy Algo-2 3.5

What is Minimum Spanning Tree? Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and… Read More »

[TopTalent.in] Rushabh Agrawal from BITS Pilani talks about his Google interview experience 3.6

Google is consistently chosen as the best workplace in the world and engineers all around the world would simply love to be a part of… Read More »

Union-Find Algorithm | Set 2 (Union By Rank and Path Compression) 3.4

In the previous post, we introduced union find algorithm and used it to detect cycle in a graph. We used following union() and find() operations… Read More »

Given a sequence of words, print all anagrams together | Set 1 3.2

Given an array of words, print all anagrams together. For example, if the given array is {“cat”, “dog”, “tac”, “god”, “act”}, then output may be… Read More »

Print 1 to 100 in C++, without loop and recursion 3.5

Following is a C++ program that prints 1 to 100 without loop and without recursion. filter_none edit close play_arrow link brightness_4 code #include <iostream> using… Read More »

Add two numbers represented by linked lists | Set 2 3.6

Given two numbers represented by two linked lists, write a function that returns the sum list. The sum list is linked list representation of the… Read More »

Microsoft Interview | Set 9 3

I am Amit Dhaka. Following is my experience of MS IDC intern interview. Date of Written: 9th September, 2012. Date of Interview: 15 October, 2012.… Read More »

Reservoir Sampling 3.8

Reservoir sampling is a family of randomized algorithms for randomly choosing k samples from a list of n items, where n is either a very… Read More »

Find the number of islands | Set 1 (Using DFS) 3.2

Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5… Read More »

Longest Palindromic Substring | Set 2 3.3

Given a string, find the longest substring which is palindrome. For example, if the given string is “forgeeksskeegfor”, the output should be “geeksskeeg”. Recommended: Please… Read More »

Default Assignment Operator and References 3.5

We have discussed assignment operator overloading for dynamically allocated resources here . This is a an extension of the previous post. In the previous post,… Read More »

Longest Palindromic Substring | Set 1 3.5

Given a string, find the longest substring which is palindrome. For example, if the given string is “forgeeksskeegfor”, the output should be “geeksskeeg”. Recommended: Please… Read More »

Iterative Quick Sort 3.3

Following is a typical recursive implementation of Quick Sort that uses last element as pivot. C++ filter_none edit close play_arrow link brightness_4 code // CPP… Read More »

Output of C++ Program | Set 17 3.8

Predict the output of following C++ programs. Question 1 filter_none edit close play_arrow link brightness_4 code #include <iostream> using namespace std;    class A {… Read More »

Count the number of possible triangles 3.3

Given an unsorted array of positive integers, find the number of triangles that can be formed with three different array elements as three sides of… Read More »

Construct BST from given preorder traversal | Set 1 3.7

Given preorder traversal of a binary search tree, construct the BST. For example, if the given traversal is {10, 5, 1, 7, 40, 50}, then… Read More »

Lexicographic rank of a string 3.6

Given a string, find its rank among all its permutations sorted lexicographically. For example, rank of “abc” is 1, rank of “acb” is 2, and… Read More »