All Hard Articles

## Microsoft Interview | Set 8 4

This about my experience of MS interview, which happened last day Division: Microsoft Bing R&D Rounds: Total 4 rounds (All face to face) Location: Hyderabad.… Read More »

## Median of two sorted arrays of different sizes 4.6

This is an extension of median of two sorted arrays of equal size problem. Here we handle arrays of unequal size also. Method 1: (Linear… Read More »

## Find the k most frequent words from a file 4.6

Given a book of words. Assume you have enough main memory to accommodate all words. design a data structure to find top K maximum occurring… Read More »

## Amazon Interview | Set 6 4

Following are my interview details for senior software engineer in 2010. Thought of sharing it, if it helps anybody Telephonic Interview 1 1) Write your… Read More »

## Microsoft Interview | Set 5 4

Hi everyone, I would like to share my experiance with MicroSoft, as i have been the lucky hire. Date: 27th August 2012 No. of Rounds:… Read More »

## Given a number, find the next smallest palindrome 4.1

Given a number, find the next smallest palindrome larger than this number. For example, if the input number is “2 3 5 4 5”, the… Read More »

## Microsoft Interview | Set 3 4.5

I would like to thank GEEKSFORGEEKS team that they made my confidence level high when it comes to coding. I finished my interview today, hope… Read More »

## Amazon Interview | Set 1 4.2

Please find the details of my amazon interviews below. Date of Interviews: 22nd August 2012 No of Rounds: 1 Written + 4 PI Type of Interviews: Campus… Read More »

## Word Wrap Problem | DP-19 4.5

Given a sequence of words, and a limit on the number of characters that can be put in one line (line width). Put line breaks… Read More »

## Struct Hack 4

What will be the size of following structure? filter_none edit close play_arrow link brightness_4 code struct employee {     int     emp_id;     int     name_len;     char    name[0]; };… Read More »

## const_cast in C++ | Type Casting operators 4.4

C++ supports following 4 types of casting operators: 1. const_cast 2. static_cast 3. dynamic_cast 4. reinterpret_cast 1. const_cast const_cast is used to cast away the… Read More »

## DFA based division 4.3

Deterministic Finite Automaton (DFA) can be used to check whether a number “num” is divisible by “k” or not. If the number is not divisible,… Read More »

## Find day of the week for a given date 4.7

Write a function that calculates the day of the week for any particular date in the past or future. A typical application is to calculate… Read More »

## Count numbers that don’t contain 3 4.1

Given a number n, write a function that returns count of numbers from 1 to n that don’t contain digit 3 in their decimal representation.… Read More »

## Variable length arguments for Macros 4.3

Like functions, we can also pass variable length arguments to macros. For this we will use the following preprocessor identifiers. To support variable length arguments… Read More »

## Largest subarray with equal number of 0s and 1s 4.1

Given an array containing only 0s and 1s, find the largest subarray which contain equal no of 0s and 1s. Expected time complexity is O(n).… Read More »

## Count total set bits in all numbers from 1 to n 4.1

Given a positive integer n, count the total number of set bits in binary representation of all numbers from 1 to n. Examples: Input: n… Read More »

## Computer Networks | Set 1 4

Following questions have been asked in GATE CS 2012 exam. 1) The protocol data unit(PDU) for the application layer in the Internet stack is (A)… Read More »

## Palindrome Partitioning | DP-17 4.3

Given a string, a partitioning of the string is a palindrome partitioning if every substring of the partition is a palindrome. For example, “aba|b|bbabb|a|b|aba” is… Read More »

## Operating Systems | Set 6 4.5

Following questions have been asked in GATE 2011 CS exam. 1) A thread is usually defined as a ‘light weight process’ because an operating system… Read More »