First page Previous page Next page

Q31: Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. [ I ended up giving about 4 or 5 different solutions for this, each supposedly better than the others ].
tags: microsoft sw programming

Q32: Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all. [ This one had me stuck for quite some time and I first gave a solution that did have floating point computations ].
tags: microsoft sw programming

Q33: Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.
tags: microsoft sw programming

Q34: Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it is a simple test.]
tags: microsoft sw programming

Q35: Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
tags: microsoft sw programming

Q36: How many points are there on the globe where by walking one mile south, one mile east and one mile north you reach the place where you started.
tags: microsoft puzzle

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

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

Q39: Reverse a linked list.
tags: microsoft sw programming

Q40: Insert in a sorted list
tags: microsoft sw programming

Q41: In a Xs and 0s game (i.e. TIC TAC TOE) if you write a program for this give a fast way to generate the moves by the computer. I mean this should be the fastest way possible.
tags: microsoft sw programming

Q42: I was given two lines of assembly code which found the absolute value of a number stored in twos complement form. I had to recognize what the code was doing. Pretty simple if you know some assembly and some fundamentals on number representation.
tags: microsoft sw programming hw

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

Q44: How would go about finding out where to find a book in a library. (You do not know how exactly the books are organized beforehand).
tags: microsoft sw programming puzzle

Q45: Linked list manipulation.
tags: microsoft sw programming

Q46: Tradeoff between time spent in testing a product and getting into the market first.
tags: microsoft sw general

Q47: What to test for given that there is not enough time to test everything you want to.
tags: microsoft sw general testing

Q48: First some definitions for this problem: a) An ASCII character is one byte long and the most significant bit in the byte is always 0. b) A Kanji character is two bytes long. The only characteristic of a Kanji character is that in its first byte the most significant bit is 1. Now you are given an array of a characters (both ASCII and Kanji) and, an index into the array. The index points to the start of some character. Now you need to write a function to do a backspace (i.e. delete the character before the given index).
tags: microsoft sw programming

Q49: Delete an element from a doubly linked list.
tags: microsoft sw programming

Q50: Write a function to find the depth of a binary tree.
tags: microsoft sw programming

Q51: Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
tags: microsoft sw programming

Q52: Assuming that locks are the only reason due to which deadlocks can occur in a system. What would be a foolproof method of avoiding deadlocks in the system.
tags: microsoft sw programming os

Q53: Reverse a linked list.
tags: microsoft sw programming

Q54: Write a small lexical analyzer - interviewer gave tokens. expressions like "a*b" etc.
tags: microsoft sw programming

Q55: Besides communication cost, what is the other source of inefficiency in RPC? How can you optimize the communication?
tags: microsoft sw programming os

Q56: Write a routine that prints out a 2-D array in spiral order!
tags: microsoft sw programming

Q57: How is the readers-writers problem solved? - using semaphores/ada .. etc.
tags: microsoft sw programming os

Q58: Ways of optimizing symbol table storage in compilers.
tags: microsoft sw programming

Q59: A walk-through through the symbol table functions, lookup() implementation etc. - The interviewer was on the Microsoft Compiler team.
tags: microsoft sw programming

Q60: A version of the "There are three persons X Y Z, one of which always lies".. etc..
tags: microsoft puzzle

Previous page Next page


b(ond)log