EMC 2011 Campus Recruitment Written Exam
November 2010
· Software Development Engineer
· Software QA Enginer and
· Research Scientist
· Software Intern
Instructions
You will have 2 hours to take this exam. This exam contains 10 pages, and is divided into 3 sections. The exam has 100 points in all. During this exam, you are NOT allowed to use any computers, calculators, or other electronic devices. Please review the questions first, and pace yourself accordingly. Make sure that you spend enough time on the single choice sections. We’ll grade the single choice section first, and will only grade the programming and English sections of those who passed the single choice section.
Good luck!
Section 1: Information only (0 points each, 0 points total)
This section contains 3 multiple-choice questions. These questions do not count for any points, and are only for informational purposes. Please mark your answers on the answer sheet.
1. What is your first choice in terms of position (job role)?
A. EMC Software Development Engineer (Located in Beijing or Shanghai)
B. EMC Software QA Engineer (Located in Beijing or Shanghai)
C. EMC Research Scientist (Located in Beijing)
D. EMC Software Intern (Located in Beijing or Shanghai)
2. If your position choice is EMC software Development or QA Engineer, what is your choice of location?
A. Beijing only
B. Shanghai only
C. Flexible, prefer Beijing
D. Flexible, prefer Shanghai
Section 2: Single-choice (3 points each, 60 points total)
This section contains 20 single-choice questions. For each question, only one answer is correct. Please mark your answers on the answer sheet. Answers marked on this question sheet will not be read or scored.
A correct answer will score 3 point; a blank answer will score 0 points; an incorrect answer will score negative 1 point. You are allowed to leave an answer blank.
1. There is a pile of sand which is weighted 90 grams. Now we have two weights, one 7-gram and one 4-gram. How many times at least do we need to separate the sand into 36 grams and 54 grams?
A. 2
B. 3
C. 4
D. 5
2. There are six white balls and four red balls in a box. Now we need to get four balls out of the box, what is the probability of one white ball at least and two red balls at most?
A. 56%
B. 63%
C. 66%
D. 69%
3. There are four switches on the wall which are all off. We are allowed to change status of only three of them at a time, how many times do we need to change them all to on? If there are three switches, we are allowed to change status of only two of them every time, how many times do we need to change them all to on?
A. 3, 5
B. 4, 3
C. 4, never
D. never, never
4. class Window {
Window(int marker) {
System.out.println(“Window(“ + marker + “)”);
}
}
class House {
Window w1 = new Window(1);
House() {
System.out.println(“House()”);
w3 = new Window(33);
}
static Window w2 = new Window(2);
void f() {
System.out.println(“f()”);
}
Window w3 = new Window(3);
}
public class OrderOfInitialization {
public static void main(String[] args) {
House h = new House();
h.f();
}
}
Output:
A. Window(2)Window(1)Window(3)House Window(33)f()
B. House()Window(33) Window(1) Window(2) Window(3)f()
C. f()House()Window(33) Window(1) Window(2) Window(3)
D. Window(1) Window(2) Window(3)House()Window(33)f()
5. What’s the result of the statement:
System.out.println(‘4’ + 3);
A. 7
B. 43
C. 55
D. Compilation error
6. How many objects are created in the following piece of Java code?
A. 3
B. 5
C. 2
D. 1
7. How many error lines are there in the following C++ program? :
1 #include <iostream>
2 using namespace std;
3 int val;
4 int func(int a = val);
5 int func(int a = val) {return 0;}
6 int p = printf(“EMC”);
7 static union {int a, b, c;}
8 int a = 5;
9 int main(void) {
10 int a[6], (&b)[6] = a;
11 return 0;
12 }
A. 1
B. 2
C. 3
D. 4
8. In a C program, there is a function “func”: int func(int (*val)[3]) {return 0;} and there are these definitions:
int **a; int (*b)[]; int (*c)[3]; int d[1][2][3];
which of the following calls is not correct for “func()” ?
The answer is ()
A. func(a)
B. func(b)
C. func(c)
D. func(d[0]
9. The output of the code below will be:
f(int a) {
int count = 0;
do{
count ++;
while(a=a&(a-1));
return count;
}
main() {
printf(“%d/n”, f(1949));
}
The answer is ()
A. 5
B. 6
C. 7
D. 8
10. #include <stdio.h>
int find_bit(int var)
{
int b = var;
int i = 0;
int tmp = 0;
while(i<32)
{
tmp = b & 1;
if(tmp == 0)
break;
b = b >> 1;
i ++;
}
return i;
}
int do_bit(int *a, int b)
{
*a = *a >> b;
*a |=1;
*a = *a << b;
return 0;
}
int main()
{
int a = 127;
int bit = find_bit(a);
do_bit(&a, bit);
printf(“%d/n”, a);
return 0;
}
The answer is:
A. 0
B. 126
C. 127
D. 128
11. The fastest way to calculate the nth item of the Fibonacci series from scratch (meaning no pre-calculated values is available) has a time complexity of:
The answer is ()
A. O(2n)
B. O(n2 )
C. O(n)
D. O(log(n))
12. A complete binary tree with n nodes is stored in a binary linked list. Given only the pointer to the root node, the fastest way to find its last node(the deepest as well as rightmost node) has a time complexity of:
The answer is ()
A. O(n)
B. O(log(n)*log(n))
C. O(log(n))
D. O(1)
13. One kind of synchronization method in operating system is semaphore. P() and V() are two atomic operations on semaphore. For the following threads, which initial values will result in deadlock?
Thread 1: Thread 2:
P(a); P(c);
P(b); P(b);
V(b); V(b);
P(c); P(a);
V(c); V(a);
V(a); V(c);
The answer is ()
A. a = 2, b = 1, c =1.
B. a = 1, b = 2, c = 1.
C. a = 1, b = 1, c = 2.
D. All of above
14. A user uses ftp to start a file transfer. While the transfer is in progress, the connection breaks and then later is restored.
Which OSI layer will handle the file transfer from the point where it left off?
A. Presentation
B. Application
C. TCP/IP
D. Session
E. Link
15. The email address for education network is like: name@mail.xxxx.edu.cn . The name is composed by characters, Arabic numbers or underline, and “xxxx” is the abbreviation name of a university. All are in lowercase. How to express it by regular expression?
The answer is ()
A. [a-z]+[0-9]+_@mail.[a-z]+.edu.cn
B. [a-z0-9_]+@mail.[a-z]+.edu.cn
C. [a-z0-9_]*@mail.[a-z]*.edu.cn
D. [a-z]*[0-9]*_@mail.[a-z]*.edu.cn
E. None of above
16. Which two of the following commands could find files named “core” in or below the directory /tmp and delete them.
1) find /tmp –name core –type f –print | xargs /bin/rm –f
2) find /tmp –name core –type f –print | xarg /bin/rm –f
3) find /tmp –name core –type f –exec rm ‘{}’/;
4) find /tmp –name core –type f –exec ‘{rm}’/;
The answer is ()
A. 1, 3
B. 1, 4
C. 2, 3
D. 2, 4
17. Which data structure becomes inefficient when over 80% full?
A. Stack
B. Hash table with chaining
C. Hash table with linear probing
D. B-tree
E. Linked list
18. Which of the following algorithm would you use if you are concerned about worst case execution speed?
A. Binary insert sort
B. Quick sort
C. Bubble sort
D. Heap sort
19. What does HTTP Error Code 401 mean?
A. Moved Permanently
B. Bad Request
C. Unauthorized
D. Not Implemented
20. If a binary tree is constructed using nodes with two pointers for each node, how many null pointers does a tree with N nodes have?
A. N – 1
B. N
C. N + 1
D. Depends on the number of edges
E. Depends on the degree of the tree
Section 3: Programming Questions Total 30 points) (Question 1: 5 points; question 2: 10 points; question 3: total 15 points, 1)-3) blanks, 2 points each, 4)-6) blanks 3 points each.)
This section contains 3 programming questions. These questions evaluate your programming skills. Please write your answers on answer sheets. For each problem, you may write your answer using any one of these programming languages: C, C++, C#, or Java.
1. Add any missing C code so that the test condition is always true. The if statement is fixed, you can’t modify it.
if((*foo = 0) || ((void*)foo == (void*)&foo))
{
printf(“The code must go through this line”);
}
2. Given an arbitrary binary tree, propose a method to determine the first common ancestor of 2 randomly selected nodes in the tree.
Please write the function in either C or Java of your choice.
3. Please fill in the blanks in the answer sheet.
1) Fill each of the following blanks with no more than one line of C code, so that the function is complete. Each blank wroth 2 points.
typedef struct _Node
{
struct _Node *left;
struct _Node *right;
int data;
} Node;
typedef struct _Stack
{
Node *node;
int flag;
} Stack;
const int MAX_NUM = 100;
void Print(Node *cur);
void Process(Node *root)
{
Stack s[MAX_NUM];
int top = 0;
Node *cur = root;
while(cur || top > 0)
{
if(cur)
{
s[top].node = cur;
s[top ++].flag = 0;
cur = cur->left;
}
else if( )
{
cur = s[--top].node;
Print(cur);
}
else
{
cur = s[top – 1].node;
s[top – 1].flag = 1;
}
}
}
2) Fill each of the following blanks with no more than one line of C code, so that the function is complete. Each blank wroth 3 points.
typedef struct _Node
{
int data;
struct _Node *next;
} Node;
int QuickSort(Node *start, Node *end, Node **head)
{
Node *trav;
int data;
Node *newHead = start;
Node* newHead2 = start;
if(start && start != end)
{
pivot = start->data;
trav = start->next;
Node *travPar = start;
while( )
{
if(trav->data < pivot)
{
trav->next = newHead;
newHead = trav;
trav = travPar->next;
}
else
{
travPar = trav;
trav = trav->next;
}
}
if(head)
*head = newHead;
QuickSortList(newHead, start, head);
}
return 0;
}
Section 4: Written Essay (10 points)
Please write an essay in English to address the following question. You should write your response on this sheet and the next. Your essay should be between 200 and 350 words. This question is to test your English writing ability.
l Ryan and four friends want to start a movie sharing plan within the mini community. Ryan discovered two ways to share the movies he made with friends.
l Plan A, Sharing by DVD. Ryan will make extra copies of his movies, hand out to his friends.
l Plan B, Sharing by FTP. Ryan will stage an always-on FTP storage server to share all his creations with friends through network.
l The sharing plan will last one year and may have 100+ movies shared during the period.
Could you help Ryan to distinguish the more GREEN solution (GREEN here means more energy effective, less carbon emission) from Plan A and Plan B? It will be necessary to use scientific modeling and computing to prove your estimation. The calculation result could be converted int pounds of carbon emission ( 碳排放量 ).
本文的发表基于如下前提:
-
EMC 2011 校园招聘已经结束
-
EMC公司乐意接受广大应届生为其公司的招聘做充分准备
-
本文读者的目的是在参考学习
如果EMC公司觉得本人行为欠妥,本人将及时终止本文在互联网的传播。