注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
这家公司oa果然如传闻中的恶心,第一轮18道bq+gre,第二轮4道coding+bq,还要录video。我找了地里好多面经题练,结果居然一道都没有。。
废话不多说
1.
Given two axis-aligned rectangles A and B, determine if the two overlap. The rectangles considered overlapping if they have at least one common point.
Input:
Your program should read lines from standard input. Each line contains 8 comma-separated coordinates. The coordinates are upper left x of A, upper left y of A, lower right x of A, lower right y of A, upper left x of B, upper left y of B, lower right x of B, lower right y of B.
Output:
Print out True if A and B intersect, False otherwise.
2.
The example sequence 011212201220200112 ... is constructed as follows:
1. The first element in the sequence is 0. 2. For each iteration, repeat the following action: take a copy of the entire current sequence, replace 0 with 1, 1 with 2, and 2 with 0, and place it at the end of the current sequence. E.g. 0 -> 01 -> 0112 -> 01121220 -> ... Create an algorithm which determines what number is at the Nth position in the sequence (using 0-based indexing).
Input: Your program should read lines from standard input. Each line contains an integer N such that 0 <= N <= 3000000000.
Output: Print out the number which is at the Nth position in the sequence.
3. Given two strings, write a program to determine the longest common subsequence between them. Each string can have a maximum length of 50 characters. Note, this subsequence need not be contiguous.
Input: Your program should read lines of text from standard input. Ignore empty lines. Each non-empty line will contain two semicolon-seperated strings. You can assume that there is only one unique subsequence per line.
Output: For each line of input, print to standard output the longest common subsequence. Ensure that there are no trailing spaces on each line you print.
4. You will be given an M*N matrix. Each item in this matrix is either a '*' or a '.'. A '*' indicates a mine, whereas a '.' does not. The objective of the challenge is to output a M*N matrix where each element contains a number (except the positions which actually contain a mine which will remain as '*') which indicates the number of mines adjacent to it. Notice that each position has at most 8 adjacent positions e.g. left, top left, top, top right, right, ... In the first sample test case, the matrix: * * . . . . . . . . . * . . . becomes * * 1 0 0 3 3 2 0 0 1 * 1 0 0
Input: Your program should read lines from standard input. Each line contains M,N, a semicolon and the M*N matrix in row major form.
Output:
Print out the new M*N matrix (in row major form) with each position(except the ones with the mines) indicating how many adjacent mines are there.
其他的就是什么五分钟说思路,给你情景让你录video回答,看图分析计算什么的(这部分时间给的很短,12mins就要答和计算五道题包括读懂那一大堆材料)
祝各位好运! 求加米!谢谢!
|