amazon笔试题
1.判斷一年是否為閏年的方法
2.非遞歸實(shí)現(xiàn)exists方法
template <class T>
class BinaryTree{
protected:
??? T* _data;
??? BinaryTree<T> * _left;
??? BinaryTree<T> * _right;
};
template <class T>
class BST:public BinaryTree<T>{
public:
??? virtual bool exists(const T& item> const;
};
3.找到下面的bugs
#include<stdio.h>
#include<malloc.h>
void foo(int a ,char*b)
{
??? b=(char *)malloc(64);
??? snprintf(b,"you are %d years old!/n",a);
}
int main (void)
{
??? char *f;
??? foo(23,f);
??? printf("%s/n",b);
}
4.Design a subway traffic control system.What objects/classes/modules would you best use for this?
purpose?Please draw diagrams and write up class definitions to better illustrate your?
design.Write anything additional to clarify your design.
2.非遞歸實(shí)現(xiàn)exists方法
template <class T>
class BinaryTree{
protected:
??? T* _data;
??? BinaryTree<T> * _left;
??? BinaryTree<T> * _right;
};
template <class T>
class BST:public BinaryTree<T>{
public:
??? virtual bool exists(const T& item> const;
};
3.找到下面的bugs
#include<stdio.h>
#include<malloc.h>
void foo(int a ,char*b)
{
??? b=(char *)malloc(64);
??? snprintf(b,"you are %d years old!/n",a);
}
int main (void)
{
??? char *f;
??? foo(23,f);
??? printf("%s/n",b);
}
4.Design a subway traffic control system.What objects/classes/modules would you best use for this?
purpose?Please draw diagrams and write up class definitions to better illustrate your?
design.Write anything additional to clarify your design.
總結(jié)
- 上一篇: google玻璃球
- 下一篇: 在继承中派生类成员的访问权限测试