回复: 27
跳转到指定楼层
上一主题 下一主题
收起左侧

Fidessa OA1 OA2 4月

全局:

2016(4-6月) 码农类General 硕士 实习@fidessa - 网上海投 - 在线笔试  | | Other | 应届毕业生

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
本帖最后由 wrj5518 于 2016-4-16 05:10 编辑

刚做完OA2 把OA1和2的问题+答案都post出来吧~ 攒人品。
/******************************************************************* 叫我分割线********************************************************************************/
Intern Pre-Screen(OA1)
第一题是找到重复字符对里属于重复字符对的第一个字母……是不是很难理解……也就是ABBA返回第一个A。
不说了,上代码。这个题输入输出自己研究一下……提前
  1. char findFirstRepeatingChar(string s) {
  2.     vector<int> record (128, 0);
  3.     for(int i = 0; i < s.size(); ++i) {
  4.         record[(int)s[i]]++;
  5.     }
  6.     for(int i = 0; i < s.size(); ++i) {
  7.         if(record[(int)s[i]] > 1)
  8.             return s[i];
  9.     }
  10.    
  11.     return ' ';
  12. }
复制代码
第二题判断一个三角形是不是等腰三角形,等边三角形或者不是三角形和其他三角形……额
不说了,上代码。
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     /* Enter your code here. Read input from STDIN. Print output to STDOUT */
  5.     int lines;
  6.     cin >> lines;
  7.     for(int i = 0; i < lines; ++i) {
  8.         int a, b, c;
  9.         cin >> a >> b >> c;
  10.         //illegal check
  11.         if(a < 0 || b < 0 || c < 0) {
  12.             cout << "None of these" << endl;
  13.             continue;
  14.         }
  15.         // classify
  16.         if(a + b <= c || b + c <= a || a + c <= b)
  17.             cout << "None of these" << endl;
  18.         else if(a == b && b == c)
  19.             cout << "Equilateral" << endl;
  20.         else if(a == b || b == c || a == c)
  21.             cout << "Isosceles" << endl;
  22.         else
  23.             cout << "None of these" << endl;
  24.     }
  25.     return 0;
  26. }
复制代码
/******************************************************************* 叫我分割线********************************************************************************/
Fidessa C++ Development Test 7 (Intern)
楼主做完……趴的HTML趴出来……噗……不让点右键复制……逗我呢?
第一题
At an airport, you have a timetable for arrivals and departures. You need to determine the minimum number of gates you’d need to provide so that all the planes can be placed at a gate as per their schedule.

The arrival and departure times for each plane are presented in two arrays, sorted by arrival time, and you’re told the total number of flights for the day.  Assume that no planes remain overnight at the airport; all fly in and back out on the same day.  Assume that if a plane departs in the same minute as another plane arrives, the arriving plane takes priority (i.e. you'll still need the g
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
, 'c' are already matched and therefore are disregarded).
Last matching index is 5.w

Sample input #3
ABbba
Sample output #3
2
Sample explanation #3
'A' is an upper-case letter.
'A' is followed by an upper-case letter, 'B'.
'B' is followed by its lower-case version 'b' and form a "matching pair".
'b' does not pair with 'A' ('B' and 'b' are already matched and therefore are disregarded), therefore index 3 and all following letters are 'un-matched'.
Last matching index is 2.
  1. int findMatchingPair(const string& input) {
  2.     int res = -1;
  3.     vector<char> S;
  4.     for(int i = 0; i < input.size(); ++i) {
  5.         if(!isalpha(input[i])) break;
  6.         
  7.         if(isupper(input[i])) {
  8.             S.push_back(input[i]);
  9.         }
  10.         else {
  11.             if(S.empty()) break;
  12.             else {
  13.                 if(S.back() == toupper(input[i])) {
  14.                     res = i;
  15.                     S.pop_back();
  16.                 }
  17.                 else
  18.                     break;
  19.             }
  20.         }
  21.     }
  22.     return res;
  23. }
复制代码
……不知道怎么代码在这里格式这么奇怪……大家拿去自己调调吧 IDE里面












评分

参与人数 9大米 +74 收起 理由
wdxrshka + 3 很有用的信息,原题的答案直接copy了
icadi + 5 很有用的信息!
破烂CC + 2 给你点个赞!
爱吃糖的胖妞 + 3 感谢分享!
Tristan + 10 感谢分享!

查看全部评分


上一篇:Worldquant 电面
下一篇:wayfair面经以及代码整理 大家加油
全局:
汇报一下,截止2018年1月,还是一样的题

但是char findFirstRepeatingChar(string s)
变成了 string findFirstRepeatingChar(string s)
回复

使用道具 举报

推荐
 楼主| 小翔926 2016-4-15 03:03:15 | 只看该作者
全局:
重新发下第一个代码……第一次发帖不太会~~大家见谅啊
  1. char findFirstRepeatingChar(string s) {
  2.     vector<int> record (128, 0);
  3.     for(int i = 0; i < s.size(); ++i) {
  4.         record[(int)s[i]]++;
  5.     }
  6.     for(int i = 0; i < s.size(); ++i) {
  7.         if(record[(int)s[i]] > 1)
  8.             return s[i];
  9.     }
  10.    
  11.     return ' ';
  12. }
复制代码

评分

参与人数 1大米 +25 收起 理由
vincent0615 + 25 感谢分享!

查看全部评分

回复

使用道具 举报

🔗
OverGhost 2016-4-15 06:00:56 | 只看该作者
全局:
怒谢楼主!
Flight Gate 那道题的解法很有意思。
回复

使用道具 举报

🔗
 楼主| 小翔926 2016-4-15 06:02:36 | 只看该作者
全局:
OverGhost 发表于 2016-4-14 14:00
怒谢楼主!
Flight Gate 那道题的解法很有意思。

两种做法啊 一种就是这个 双指针 另一种就是做个数据结构 遍历…… 遇到来的+1 走的-1
回复

使用道具 举报

🔗
 楼主| 小翔926 2016-4-15 06:03:25 | 只看该作者
全局:
拿到video面……继续努力……
回复

使用道具 举报

🔗
davidhunter 2016-12-16 06:59:59 | 只看该作者
全局:
小翔926 发表于 2016-4-15 06:03
拿到video面……继续努力……

请问楼主面得怎么样了?
回复

使用道具 举报

🔗
 楼主| 小翔926 2016-12-20 04:01:57 | 只看该作者
全局:
davidhunter 发表于 2016-12-15 14:59
请问楼主面得怎么样了?

挂了啊~~~~~~
回复

使用道具 举报

🔗
davidhunter 2016-12-25 04:39:36 | 只看该作者
全局:

我特么OA1做完了第二天被拒
回复

使用道具 举报

🔗
 楼主| 小翔926 2016-12-29 02:55:50 | 只看该作者
全局:
davidhunter 发表于 2016-12-24 12:39
我特么OA1做完了第二天被拒

我扛到了电面。。。。还是挂 哈哈哈哈
回复

使用道具 举报

🔗
cegu 2017-1-3 06:07:56 | 只看该作者
全局:
davidhunter 发表于 2016-12-25 04:39
我特么OA1做完了第二天被拒

请问层主是参加了2017summer intern的 OA1吗?2017的题和地里的一样吗?谢谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表