background preloader

Google

Facebook Twitter

TechInterview Discussion - Google Q. Suppose you have an NxN matrix... Sorting 1 Million Integers - Modified MergeSort. G65: If you have 1 million integers, how would you sort them efficiently?

Sorting 1 Million Integers - Modified MergeSort

(modify a specific sorting algorithm to solve this). You could easily sort 1 million integers in memory on an ordinary computer nowadays, this problem imposes artificial memory restrictions. The most suitable algorithm for this task is Merge Sort. We’ll have to modify it to sort chunks of data from the original file/input into memory and merge them with an already sorted file. Here’s an implementation in C++: Microsoft Linked Lists Interview Questions. Circular Binary Search. You are given a list of numbers.

Circular Binary Search

When you reach the end of the list you will come back to the beginning of the list (a circular list). Write the most efficient algorithm to find the minimum number in this list. Find any given number in the list. The numbers in the list are always increasing but you don’t know where the circular list begins, i.e.: 38, 40, 55, 89, 6, 13, 20, 23, 36. Algorithm And C Programming Code For BFS and DFS.

By , 02-08-2011 at 07:18 AM (38071 Views) Email Blog Entry Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.

Algorithm And C Programming Code For BFS and DFS

Multiplication of numbers. Since the complexity required is O(n), the obvious O(n^2) brute force solution is not good enough here.

Multiplication of numbers

Since the brute force solution recompute the multiplication each time again and again, we can avoid this by storing the results temporarily in an array. Let’s define array B where element B[i] = multiplication of numbers from A[0] to A[i]. For example, if A = {4, 3, 2, 1, 2}, then B = {4, 12, 24, 24, 48}. Then, we scan the array A from right to left, and have a temporary variable called product which stores the multiplication from right to left so far.

Calculating OUTPUT[i] is straight forward, as OUTPUT[i] = B[i-1] * product. The above method requires only O(n) time but uses O(n) space. Yes, actually the temporary table is not required. Algorithm - Expand a random range from 1–5 to 1–7. 140 Google Interview Questions. Google placement paper 2011 – Technical Questions - Placement Papers – Test Paper – Interview Questions – Khoj4u. Here I am publishing questions which I came to know from candidates. Some questions are missing or incomplete. Below is the paper given by candidates who appeared in the placement of this company. Q1) What is the value of i after execution of the following program? Void main() long l=1024; int i=1; { l=l/2; i=i+1; a)8 b)11 c)10 d)100 ans:b Q2) This question is based on the complexity … Q3) s->AB A->a B->bbA Which one is false for above grammar?

Q3) Some Trees were given & the question is to fine preorder traversal. Q4) One c++ program, to find output of the program? Q5) If the mean failure hour is 10,000 and 20 is the mean repair hour. Q6) One question on probability? Q7) In a singly linked list if there is a pointer S on the first element and pointer L is on the last element. Cruftbox. I saw this in one of my magazines at work.

Cruftbox

The GLAT, a funny riff on the standardized tests that pervade academic life. It seems Google Labs is trying to attract some high quality people into their ranks. If only I was a software guy, I'd apply... The questions are a fun mix of items from "What's broken with Unix? Icosahedron. In geometry, an icosahedron (/ˌaɪkɵsəˈhiːdrən/ or /aɪˌkɒsəˈhiːdrən/) is a polyhedron with 20 triangular faces, 30 edges and 12 vertices.

Icosahedron

A regular icosahedron with identical equilateral faces is often meant because of its geometrical significance as one of the five Platonic solids. It has five triangular faces meeting at each vertex. It can be represented by its vertex figure as 3.3.3.3.3 or 35, and also by Schläfli symbol {3,5}. It is the dual of the dodecahedron, which is represented by {5,3}, having three pentagonal faces around each vertex. A regular icosahedron is a gyroelongated pentagonal bipyramid and a biaugmented pentagonal antiprism in any of six orientations. Icosahedrite is a mineral (found in remote parts of Russia) that has the crystal shape of an icosahedron. The name comes from the Greek: εικοσάεδρον, from είκοσι (eíkosi) "twenty" and εδρα (hédra) "seat".