All pastes #37995 Raw Edit

Mine

public text v1 · immutable
#37995 ·published 2006-01-22 12:16 UTC
rendered paste body
1	

What is the probability of two people arriving at a restaurant withing 21 minutes of each other between 1 PM and 3 PM?The answer needs to be rounded to 4 decimal places with no trailing zeroes. (e.g .15 needs to be represented as 0.15, 0.154567 needs to be represented as 0.1546)


	
Ans:- 		


2	

5 people got on a train at its starting point. There are 11 stations on which they can get off (excluding the starting point. What is the total number of different ways they can do this considering that at least 4 people get off at least at one station?


	
Ans:- 		


3	

A machine has 64 KB of virtual memory and 1 KB of physical memory. This machine uses a set-associative page table with a page size of 64 bytes and 4 sets. The low order bits of the virtual page number are used to decide the set in which a virtual page is placed. The page replacement algorithm in each set is round-robin: on the first page fault, the first page in the set is replaced. On the second page fault, the second page in the set is replaced and so on. The contents of the page table are given in increasing order of physical page number below, where the virtual page number is in hex: 0x358, 0x15c, 0x110, 0xb4, 0x189, 0x3cd, 0x2c1, 0xa5, 0x2ba, 0x13e, 0x372, 0x396, 0x2eb, 0x1af, 0x323, 0x187. A program issues the following virtual addresses in hex: 0x6674, 0xf584, 0xbad4, 0x279c, 0xd618, 0x4420, 0xc8fc, 0x8e44. What are the final contents of the Page Table?


	
Ans:- 		


4	

I have a 4 bit number "n" in mind (that is, 0 <= n <= 15). To help you guess this number, I have answered seven questions below (the least significant bit is bit 1 and the most significant bit is bit 4):

Q1. Is bit 1 equal to 1? Yes
Q2. Is bit 2 equal to 1? No
Q3. Is bit 3 equal to 1? Yes
Q4. Is bit 4 equal to 1? Yes
Q5. Is the sum of bits 1, 2 and 4 even? Yes
Q6. Is the sum of bits 1, 3 and 4 even? Yes
Q7. Is the sum of bits 2, 3 and 4 even? No

The catch here is that the answer to exactly one of the seven questions above is wrong, the other six are correct.
Which answer is wrong? (For example, if the answer to Q6 above is wrong, your response should be 6.)


	
Ans:- 		


5	

6 0s are placed from 0th cell to 5th cell of an array; 7 1s are placed from 7th cell to end of the array. On the whole, there are 14 cells, so that just one cell remains unoccupied. 0s only move rightward; 1s move leftward. Every move is either a move to the next empty cell or a jump over one cell which has different value. In any case, no two values are allowed in the same square. The goal is to move 1s into 7 leftmost positions and the 0s into 6 rightmost positions. How many minimum moves are needed to achieve this?


	
Ans:- 		


6	

All 7 digit permutations of number 1234567 are sorted and kept in an array of 5040 elements. (0th element is 1234567, 1st element is 1234576 and 5039th element is 7654321.) What is the 1785th element in this array?


	
Ans:- 		


7	

A character in an alphabet is represented in 14 bits. How many characters are there in the alphabet which do not have any sequence of 2 adjacent 1s?


	
Ans:- 		


8	

Given a 9 X 9 sided square(rows 0 to 8, columns 0 to 8) where the cell(5,4) contains a RED dot (rest of the cells dont contain the RED dot). How many squares are present of any size without having the RED dot in them?


	
Ans:-