Find the point where a monotonically increasing function becomes positive first time
Leave a comment | Filed under ArraysGiven a function ‘int f(unsigned int x)’ which takes a non-negative integer ‘x’ as input and returns an integer as output.
Read More »You are given a set of links, e.g. a —> b b —> c b —> d a —> e Print the tree that would form when each pair of these links that has the same character as start and end point is joined together.
Read More »Given an input string and a dictionary of words, find out if the input string can be segmented into a space-separated sequence of dictionary words. See following examples for more details.
Read More »I recently attended a walk-in for Software development Engineer (SDE- 1) at Amazon, Bangalore.
Read More »Can a class be static in Java ? The answer is YES, we can have static class in java. In java, we have static instance variables as well as static methods and also static block. Classes can also be made static in Java.
Read More »In C, fopen() is used to open a file in different modes. To open a file in write mode, “w” is specified.
Read More »This article is not for those algo geeks. If you are interested in systems related stuff, just read on…
Read More »Eulerian Path is a path in graph that visits every edge exactly once. Eulerian Circuit is an Eulerian Path which starts and ends on the same vertex.
Read More »Given a linked list and two integers M and N. Traverse the linked list such that you retain M nodes then delete next N nodes, continue the same till end of the linked list. Difficulty Level: Rookie
Read More »How to implement a stack which will support following operations in O(1) time complexity? 1) push() which adds an element to the top of stack. 2) pop() which removes an element from top of stack.
Read More »Given n numbers, each with some frequency of occurrence. Return a random number with probability proportional to its frequency of occurrence.
Read More »There are two conventions to define height of Binary Tree 1) Number of nodes on longest path from root to the deepest node. 2) Number of edges on longest path from root to the deepest node.
Read More »I would like to contribute for GeeksForGeeks by sharing my experience of Amazon Interview process. This was for a SDE position in Hyderabad.
Read More »Given a directed graph, find out whether the graph is strongly connected or not. A directed graph is strongly connected if
Read More »Recently I attended the Amazon walk-in and got selected for the position of SDE I.
Read More »Problem statement: Consider a row of n coins of values v1 . . . vn, where n is even. We play a game against an opponent by alternating turns. In each turn, a player selects either the first or last coin from the row,
Read More »1st Round(Written Test) Consists of three sections with each section 1 hour to solve. Hence the written round was for 3 hours. I really liked the written round since
Read More »Given an array of of size n and a number k, find all elements that appear more than n/k times
21 Comments | Filed under ArraysGiven an array of size n, find all elements in array that appear more than n/k times. For example, if the input arrays is {3, 1, 2, 2, 1, 2, 3, 3} and k is 4, then the output should be [2, 3].
Read More »Super Day Process 1st Round – Written test to be completed in 1hour 20 mins containing questions on C++, SQL and Aptitude questions.
Read More »Print all possible combinations of r elements in a given array of size n
10 Comments | Filed under ArraysGiven an array of size n, generate and print all possible combinations of r elements in array. For example, if input array is {1, 2, 3, 4} and r is 2, then output should be {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4} and {3, 4}.
Read More »1) Started with telephonic interview – a) Find the occurrence of first 1 in an array and the array contains only 0s and 1s in sorted manner.
Read More »I recently got interviewed for a position in Microsoft, following is my interview experience.
Read More »Consider a coding system for alphabets to integers where ‘a’ is represented as 1, ‘b’ as 2, .. ‘z’ as 26. Given an array of digits (1 to 9) as input, write a function that prints all valid interpretations of input array.
Read More »Evaluate an expression represented by a String. Expression can contain parentheses, you can assume parentheses are well-matched.
Read More »[TopTalent.in] Interview With Nandini from VNIT Who Bagged an Off Campus Job in Microsoft
Leave a comment | Filed under MiscIt is not just intelligence but intelligence coupled with inherent confidence is what makes a person truly remarkable.
Read More »