历年广东北电校园招聘笔试试题及答案

出自求职百科

跳转到: 导航, 搜索

这一周真可谓笔试周,北电爱立信思科等公司的笔试全都集中在这一周了。
在网上找到了一些历年的各个公司的笔试试题,不过大都只有题目没有答案。
sigh,只好自己做作业了~~
先贴北电的吧。
先声明:这些仅代表个人观点,并非标准答案。
贴上来,供大家共享、参考与交流。欢迎大家补充指正。
祝愿大家找工顺利。尽快拿到自己梦寐已久的offer,然后。。。。。。。。然后BG我啦,哈哈

历年广东北电校园招聘笔试试题及答案

一:英文题。
1. Tranlation (Mandatory)
  CDMA venders have worked hard to give CDMA roaming capabilities via the development of RUIM-essentially, a SIM card for CDMA handsets currently being deployed in China for new CDMA operator China Unicom. Korean cellco KTF demonstrated earlier this year the ability to roam between GSM and CDMA using such cards. However, only the card containing the user’s service data can roam-not the CDMA handset or the user’s number (except via call forwarding).
翻译:CDMA开发商一直致力于RUIM卡的开发,以赋予CDMA漫游的能力。RUIM卡类似于SIM卡,事实上目前它已经被中国的CDMA运营商中国联通广泛使用。韩国手机制造企业KTF今年早些时候展示了使用此种卡在GSM和CDMA网络中漫游的功能,但是,只有包含用户服务数据的卡能够漫游,CDMA手机本身及用户号码则不能(除了通过呼叫转移)。 

2. Programming (Mandatory)
  Linked list
  a. Implement a linked list for integers, which supports the insert after (insert a node after a specified node) and remove after (remove the node after a specified node) methods;
  b. Implement a method to sort the linked list to descending order.
答:题目的意思是实现一个整型链表,支持插入,删除操作(有特殊要求,都是在指定节点后进行操作),并写一个对链表数据进行降序排序的方法。
那我们不妨以一个线性链表进行编程。

// 单链表结构体为
typedef struct LNode
{
int data;
struct LNode *next;
}LNode, *pLinkList;

// 单链表类
class LinkList
{
private:
pLinkList m_pList;//链首指针
int m_listLength;//链表总长度
public:
LinkList();//构造函数
~LinkList();//析构函数
bool InsertAfter(int afternode, int data);//插入
bool RemoveAfter(int removenode);//删除
void sort();//排序
};


//实现方法
//insert a node after a specified node

bool LinkList::InsertAfter(int afternode, int data)
{
LNode *pTemp = m_pList; //先让指针变量pTemp指向第一个结点
int curPos = -1;
if (afternode > m_listLength ) // 插入点超过总长度
{
return false;
}
while (pTemp != NULL) // 找到指定的节点
{
curPos++;
if (curPos == afternode)
break;
pTemp = pTemp->next;
}
if (curPos != afternode) // 节点未寻到,错误退出
{
return false;
}
LNode *newNode = new LNode; // 将新节点插入指定节点后
newNode->data = data;
newNode->next = pTemp->next;
pTemp->next = newNode;
m_listLength++;
return true;
}


//remove the node after a specified node

bool LinkList::RemoveAfter(int removenode)
{
LNode *pTemp = m_pList;
int curPos=-1;
if (removenode > m_listLength) // 删除点超过总长度
{
return false;
}

// 找到指定的节点后一个节点,因为删除的是后一个节点
while (pTemp != NULL)
{
curPos++;
if (curPos == removenode+1)
break;
pTemp = pTemp->next;
}
if (curPos != removenode) // 节点未寻到,错误退出
{
return false;
}
LNode *pDel = NULL; // 删除节点
pDel = pTemp->next;
pTemp->next = pDel->next;
delete pDel;
m_listLength--;
return true;
}


//sort the linked list to descending order.

void LinkList::sort()
{
if (m_listLength<=1)
{
return;
}
LNode *pTemp = m_pList;
int temp;
// 选择法排序
for(int i=0;i<m_listLength-1;i++)
for(int j=i+1;j<m_listLength;j++)
if (pTemp[i].data<pTemp[j].data)
{
temp=pTemp[i].data;
pTemp[i].data=pTemp[j].data;
pTemp[j].data=temp;
}
}
//前两个函数实现了要求a,后一个函数sort()实现了要求b

3. Debugging (Mandatory)
a. For each of the following recursive methods, enter Y in the answer box if the method terminates (assume i=5), Otherwise enter N.
(题目意思:判断下面的递归函数是否可以结束)

static int f(int i){
return f(i-1)*f(i-1);
}

Ansewr: N,明显没有返回条件语句,无限递归了

static int f(int i){
if(i==0){return 1;}
else {return f(i-1)*f(i-1);}
}

 
Ansewr:Y,当i=0时可结束递归

static int f(int i){
if(i==0){return 1;}
else {return f(i-1)*f(i-2);}
}

Ansewr:N,因为i=1时,f(i-2)=f(-1),进入一个无限递归中

b. There are two errors in the following JAVA program:

static void g(int i){
if(i==1){return;}
if(i%2==0){g(i/2);return;}
else {g(3*i);return;}
}

please correct them to make sure we can get the printed-out result as below:
3 10 5 16 8 4 2 1
答:在第一个if语句前加 System.out.print(i+" ");
  else 里面的g(3*i)改为g(3*i+1)
 
中文笔试题
1.汉译英
  北电网络的开发者计划使来自于不同组织的开发者,能够在北电网络的平台上开发圆满的补充业务。北电网络符合工业标准的开放接口,为补充业务的开展引入了无数商机,开发者计划为不同层面的开发者提供不同等级的资格,资格的划分还考虑到以下因素:补充业务与北电网络平台的集合程度,开发者团体与北电网络的合作关系,等等。
答: Nortel's explorer program allows developers from different organizations to develop satisfactory supplementary operation on the platform that Nortel provides. Nortel network’s open interfaces which are up to the industry standard have brought in millions of business opportunities for the expansion of the supplementary operations. The program offers different qualifications for different level of developers. The division of qualification will take into consideration the factors as follows: the integrated degree between the supplementary operations and the platform of Nortel network, the cooperation between the developers and the Nortel, etc.

2.编程
  将整数转换成字符串:void itoa(int,char);
例如itoa(-123,s[])则s=“-123”;
答:

char* itoa(int value, char* string)
{
char tmp[33];
char* tp = tmp;
int i;
unsigned v;
char* sp;
// 将值转为正值
if (value < 0)
v = -value;
else
v = (unsigned)value;
// 将数转换为字符放在数组tmp中
while (v)
{
i = v % 10;
v = v / 10;
*tp++ = i+'0';
}
// 将tmp里的字符填入string指针里,并加上负号(如果有)
sp = string;
if (value < 0)
*sp++ = '-';
while (tp > tmp)
*sp++ = *--tp;
*sp = 0;
return string;
}

个人工具
公司索引
  • A   B   C   D   E   F   G
  • H   I   J   K   L   M   N
  • O    P
  •     Q    R    S    T
  • U    V    W    X    Y    Z
工具箱