You are on page 1of 1

Test Paper for Software Development

(Answering time: 1 hour)

NOTE: The question sheet shall be returned together with your answer sheet and is not supposed to be
taken away.

1. Two given integer arrays A and B are of length N and M, respectively. The elements in both
arrays are ascending. Please write a program which uses all elements in A and B to form a new
array C (the length of C is certainly N+M). And in the newly-formed C array, all elements are still
ascending. If element-comparison is used in your program, the total number of element-
comparisons must be not more than N+M.

2. There is a M (number of columns) x N (number of rows) chessboard. Its left-top box is marked as
(0, 0). Its right-bottom box is marked as (M-1,N-1). A piece of chess starts to go originally from
(0, 0). It is only allowed to go from (x, y) to (x+1, y), (x, y+1), (x+2, y+1), or (x+1, y+2) at any single
step. Please write a program to calculate the number of possible routes from (0, 0) to (M-1,N-
1).

(0, 0)

(M-1, N-1)

3. Put millions of integers A and millions of integer B one by one:


A, A, A, …, A, B, B, B, B, B, …, B
Total number of both A and B is 4000,000,000, Please write a fast algorithm(program) to locate
the position index where the number is A and the next number is B.

4. In Microsoft Excel, rows are marked by numbers (1,2,3,...), but columns are marked with a string
as A, B, C, ..., Z, AA, AB, AC, ..., AZ, BA,BB,BC,...,BZ,...,ZZ,AAA,AAB,... Write a Method (or called
Function)
column(…)
given the column number n as input parameter, return the column mark string in Excel.
For example:
column(1) should return "A"
column(2) should return "B"
column(26) should return "Z"
column(27) should return "AA"
column(52) should return "AZ"
column(53) should return "BA"。

Version: 201412-01 Page 1 of 1

You might also like