First page Next page

Q67: Given an array of characters. How would you reverse it. ? How would you reverse it without using indexing in the array.
tags: microsoft sw programming

Q549: You are given a small sorted list of numbers, and a very very long sorted list of numbers - so long that it had to be put on a disk in different blocks. How would you find those short list numbers in the bigger one
tags: google sw

Q480: Get the width of a binary tree
tags: google Algorithm

Q234: How can you check the exit status of a process?
tags: google unix

Q172: In what cases do you need to double clock a signal before presenting it to a synchronous state machine?
tags: Intel AMD Sun hardware architecture design

Q157: Give examples of data hazards with pseudo codes.
tags: microsoft intel amd nvidia hw comparch architecture hardware

Q570: Given a Data Structure having first n integers and next n chars. A = i1 i2 i3 ... iN c1 c2 c3 ... cN. Write an in-place algorithm to rearrange the elements of the array as A = i1 c1 i2 c2 ... in cn
tags: google sw

Q516: There are a set of 'n' integers. Describe an algorithm to find for each of all its subsets of n-1 integers the product of its integers.
tags: google sw

Q556: If you look at a clock and the time is 3:15, what is the angle between the hour and the minute hands?
tags: google puzzle

Q38: What are the different ways to implement a condition where the value of x can be either a 0 or a 1. Apparently the if then else solution has a jump when written out in assembly. if (x == 0) y=a else y=b There is a logical, arithmetic and a data structure solution to the above problem.
tags: microsoft sw programming hw

Q542: Given a list of numbers and a target sum, how would you efficiently determine whether a pair of numbers from the list can add up to the target sum? (list based approach is O(n^2) while hash-table based approach is O(n) )
tags: google sw

Q525: What is the difference between local and global variables
tags: google sw

Q519: Implement division (without using the divide operator, obviously).
tags: google sw

Q7: You've got someone working for you for seven days and a gold bar to pay them. The gold bar is segmented into seven connected pieces. You must give them a piece of gold at the end of every day. If you are only allowed to make two breaks in the gold bar, how do you pay your worker?
tags: microsoft puzzle

Q239: Rank the functions in order of their asymptotic behaviour ( which is the greatest) 1. 2^n 2. n! 3. n^googol ( googol=10^100) 4. n^n
tags: google software math

Q553: Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens
tags: google puzzle

Q22: What is your ideal working environment.
tags: microsoft general

Q111: You have an abstract computer, so just forget everything you know about computers, this one only does what I am about to tell you it does. You can use as many variables as you need, there are no negative numbers, all numbers are integers. You do not know the size of the integers, they could be infinitely large, so you cannot count on truncating at any point. There are NO comparisons allowed, no if statements or anything like that. There are only four operations you can do on a variable. 1) You can set a variable to 0. 2) You can set a variable = another variable. 3) You can increment a variable (only by 1), and it is a post increment. 4) You can loop. So, if you were to say loop(v1) and v1 = 10, your loop would execute 10 times, but the value in v1 would not change so the first line in the loop can change value of v1 without changing the number of times you loop. You need to do 3 things. 1) Write a function that decrements by 1. 2) Write a function that subtracts one variable from another. 3) Write a function that divides one variable by another. 4) See if you can implement all 3 using at most 4 variables. Meaning, you are not making function calls now, you are making macros. And at most you can have 4 variables. The restriction really only applies to divide, the other 2 are easy to do with 4 vars or less. Division on the other hand is dependent on the other 2 functions, so, if subtract requires 3 variables, then divide only has 1 variable left unchanged after a call to subtract. Basically, just make your function calls to decrement and subtract so you pass your vars in by reference, and you cannot declare any new variables in a function, what you pass in is all it gets. Linked lists
tags: microsoft sw programming puzzle

Q43: Give a fast way to multiply a number by 7.
tags: microsoft sw programming

Q184: Design a divide-by-3 counter with equal duty cycle ?
tags: Intel AMD nVidia ATI Sun HP NationalSemi hardware hw design circuit logic

Q142: How do you write a "ping" routine in java?
tags: microsoft sw programming java networking

Q573: Write a function to find the middle node of a single link list
tags: google sw

Q571: How many lines can be drawn in a 2D plane such that they are equidistant from 3 non-collinear points
tags: google puzzle math

Q103: A real life problem - A square picture is cut into 16 squares and they are shuffled. Write a program to rearrange the 16 squares to get the original big square.
tags: microsoft sw programming puzzle algorithms

Q37: Give a very good method to count the number of ones in a "n" (e.g. 32) bit number.
tags: microsoft sw programming

Q567: Design and describe a system/application that will most efficiently produce a report of the top 1 million Google search requests. You are given: 1. You are given 12 servers to work with. They are all dual-processor machines with 4Gb of RAM, 4x400GB hard drives and networked together.(Basically, nothing more than high-end PCs) 2. The log data has already been cleaned for you. It consists of 100 Billion log lines, broken down into 12 320 GB files of 40-byte search terms per line. 3. You can use only custom written applications or available free open-source software.
tags: google sw hw os

Q210: From K sorted arrays, each of size N, how would you construct one big array, and what would the big-O of the procedure be? What if you only had memory of size 2N.
tags: google microsoft software programming algorithm

Q29: Given a rectangular (cuboidal for the puritans) cake with a rectangular piece removed (any size or orientation), how would you cut the remainder of the cake into two equal halves with one straight cut of a knife ?
tags: microsoft math puzzle

Q221: Given the sequence S1 = {a,b,c,d,...,x,y,z,aa,ab,ac.... } and given that this sequence corresponds (term for term) to the sequence S2 = {1,2,3,4,....} Write code to convert an element of S1 to the corresponding element of S2. Write code to convert an element of S2 to the corresponding element of S1.
tags: google software programming algorithm

Q99: why is disk interleaving adopted
tags: microsoft database

Next page


b(ond)log