2020巨人网络暑期实习面经

2020巨人网络暑期实习面经

    本人末流985 数字媒体技术 大三学生,今天参加了巨人网络暑期实习生游戏客户端一面,全程十分钟,只问了怎么制作制作游戏功能的技术问题。

一面

  • 自我介绍
  • 做一个放大招的技能逻辑,实现敌人僵直、浮空效果
  • 减少了魔法值之类的怎么处理
  • 实现特效绑定在武器上
  • 遇到不会的功能怎么办
  • 英语怎么样
  • 用不用谷歌

反问都有什么不足,答多学英语,多上谷歌。十分钟结束,无基础考察,感觉一般吧。

二面(直接翻车)

  • 讲项目
  • 具体怎么实现攻击功能
  • 手撕代码:实现一个string类(翻车)
  • 智力题:三个篮子分别装苹果,梨和混装,贴三个标签,全乱序,只拿一次水果区分三个篮子到底是什么

惨痛的翻车,复习这么久,很多基础的东西还是不够扎实。写一个string类是面试常考题,我居然不会,哎。

class my_string {
	friend std::ostream& operator<<(ostream& os, const my_string& str);
	friend std::istream& operator >>(istream& is, my_string& str);
public:
	my_string(const char * str = NULL);
	my_string(const my_string &);
	~my_string();
	my_string operator=(const my_string &);
	my_string operator+(const my_string &);
	bool operator==(const my_string&);
	char& operator[](int);
	int size() { return strlen(this->data) + 1; }
private:
	char* data;
};
 
my_string::my_string(const char* str)
{
	if (str == NULL)this->data = NULL;
	else
	{
		this->data = new char[strlen(str) + 1];
		strcpy(data,str);
	}
	
}
 
my_string::my_string(const my_string& other)
{
	if (other.data == NULL)this->data = NULL;
	else
	{
		this->data = new char[strlen(other.data)+1];
		strcpy(this->data,other.data);
	}
}
 
my_string::~my_string()
{
	delete[] this->data;
}
 
my_string my_string::operator=(const my_string& other)
{
	delete[] this->data;
	if (other.data == NULL)this->data = NULL;
	else
	{
		this->data = new char[strlen(other.data)+1];
		strcpy(this->data,other.data);
	}
	return *this;
}
 
my_string my_string::operator+(const my_string& other)
{
	if (other.data == NULL)return *this;
	else if(this->data == NULL)
	{
		this->data = new char[strlen(other.data) + 1];
		strcpy(this->data, other.data);
		return *this;
	}
	else
	{
		my_string strTmp;
		strTmp.data = new char[strlen(this->data) + strlen(other.data) + 1];
		strcpy(strTmp.data, this->data);
		strcat(strTmp.data, other.data);
		return strTmp;
	}
}
 
bool my_string::operator==(const my_string& other)
{
	int tmp = 0;
	tmp = strcmp(this->data,other.data);
	if (tmp == 0)return 1;
	else return 0;
}
 
char& my_string::operator[](int index)
{
	return this->data[index];
}
 
ostream& operator<<(ostream& os, const my_string& str)
{
	os << str.data;
	return os;
}
 
istream& operator>>(istream& is, my_string& str)
{
	char buffer[4096];
	is >> buffer;
	str.data = buffer;
	return is;
}

其他面经:

2020大连西山居暑期实习面经
2020腾讯暑期游戏客户端实习面经
2020完美世界暑期实习面经

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值