📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
回复: 8
跳转到指定楼层
上一主题 下一主题
收起左侧

《新人求加米》 flexport面经(全集)

全局:

2023(1-3月) 码农类General 硕士 全职@flexport - 猎头 - 技术电面 Onsite 在线笔试 视频面试  | 😃 Positive 😐 Average | Pass | 在职跳槽

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

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

x
新人求加米!

OA:
6 questions, see website:  


Phone:
card token game:
#                 +-----+
# Point value --> |2   G| <-- Card Color
#                 |     |
#        Cost --> |5B   |
#                 |3G   |
#                 +-----+
# Notation: Red - R, Blue - U, Black - B, Green - G, White – W
# In this game players will have a set of colored tokens (Red, Blue, Green, Black, White). Their objective is to purchase cards using those tokens. Cards will have a cost of some number of the above listed colored tokens. For example a card can cost 2 blue tokens and 1 green tokens. If a player has 2 blue tokens and 1 red token they cannot buy the card because they do not have the necessary green currency.
# The goal for this part is to implement a function that determines if a card can be purchased by a particular player given the current state of the game. How you choose to represent the purchase,  game state, and function signature is completely up to you.
# Given a “Card” and “Player” as modeled in part 1, update the game “state” to reflect that card being purchased by‍‌‍‍‌‌‌‌‍‌‍‍‍‌‍‌‌‌‌‍ that player.
—----------------------------------------------------------------------------------------------------
Token card games
Given card with cost in terms of tokens. For eg to buy some Card A, you need 3 Blue tokens and 2 Green tokens. Tokens can be of Red, Green, Blue, Black or White color.. 1point 3acres
Now there is player who is holding some tokens. For eg player has 4 Blue tokens and 2 Green tokens, then player can buy above Card A. Lets say if player only has 2 Blue tokens and 2 Green tokens, then player can not buy Card A above as player is short of 1 Blue token.
Write a method that returns true if player can buy the card or false otherwise.
More examples :
Cost of Card : 2 White, 1 Black and 4 Blue
If Player has : 2 White, 2 Black and 4 Blue, method will return true
If Player has : 2 White, 2 Green and 4 Blue, method will return false.
1、Implement canPurchase and purchase.
2、Discount with card owned
(e.g. if already have 3 Red Cards,next card to purchase costs N Red Money,at actual purchase only need to pay N-3 Red Money).
cost: {"Red":4}
player:{"Red":7,"Bule":5}.
purchase()
player:{"Red":3,"Bule":5}.--
playerCard:{"Red":1}
purchase(). 1point 3acres
player:{"Red":0,"Bule":5}
playerCard:{"Red":2}
3. Gold color: gold color can substitute any color. E.g.one card costs N red money, but only have N-1 red money, and 1 or more gold money, then can afford buying the card.
Proposed solution: since there are only 5 color money/tokens, in Card, define a int[] cost = {1,2,3,4,5} to imply how many color money/token each needed to purchase this card. Purchase function is defined in player, parse in card id to purchase,use player’s money/tokens to compare against the card cost to determine affordability?



checker board
part1: given a state of the board and a player, get all possible next moves of all checkers of the player
part2: given a move, make a movement and update the board
Part3: …
8x8 checker board, can move diagonal to next 2 locations. Can’t move when reach the end or next 2 locations are occupied.
You are to define everything(including class, function, input, output). Write a function to take in current board status, output all possible next move.
Game of checker see details in  
Implement an api (i used Java)
List<Pair<Pair<Integer, Integer>>> nextMove(char[][] board, boolean turn)
Board: records current board status,board[j] can be  'O', 'X' or ''.
turn: define it yourself (could be change to X side to move or O side to move next)
Return: all possible next move (no need to consider killing components, no king, only consider whether can go to the next location)
EX: [ ((2,3),(3,4)), ((5,8),(4,9)),  ... ] => move from (2,3) to (3,4),  move from (5,8)to(4,9),  etc
follow up :
What if add a King for both side, how to modify? What if rule changed to allow killing the other
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
c
3 user interface steps: party size, date, and location ==click search==> A list of restarant, each of which shows list of time available ==click the time==> review of reservation and confirm button to reserve
搜索有空的时间‍‌‌‌‌‍‌‌‌‍‌‍‍‍‍‍‍‌‍‌ 还有预定 这两个函数 包括桌子结构
469
93
Leetcode ip address
Find shortest path 62, 1091
给一个数字string到字母list的map,给一个string,找出所有可能的字母combination。例如'1' -> ['a', 'b'] 跟刷题网的手机按键有多少字母组合题一样。Follow‍‌‌‌‌‍‌‌‌‍‌‍‍‍‍‍‍‌‍‌up,如果多个数字可以map到一个字母list时,怎么做。
Leetcode phone keypad

Http协议,网站访问过程
五子棋简化版3子棋,在3*3board上, - 要写command输入和print(可以看文档), - 两个player 一个机器(随便下) command输入, - 每次下完判断输赢 348?
Coding: Given a string of words divided by spaces and number of N,Return a sentence with 5 words. Every word is picked randomly after the last occurrence, if it is the end of the string next round back to first one. First word is picked randomly from any of the words.  E.g. "let us go to the supermarket to get the to go bundle" First word can be "go", second be be either "to" or "bundle". If n = 5, one possible solution is: "go bundle let us go"
Given a string, implement a method that given a word in the sentence, randomly return one of its following words. Plus, if the given word is in the end of the string, the first word is counted as its following word.  solution: write a hashmap, key is every word in the string, value is a list of word that follows it. Follow up: given a substring of the sentence, return the next words of the substring.
文章随机组成out‍‌‍‍‌‌‌‌‍‌‍‍‍‌‍‌‌‌‌‍put的那道题 提前写完了 问了个follow up 如果不是一个单词一个单词的拼接的话怎么办 一开始是随机抽一个词然后随机选后面的 现在pass进来一个variable N 这个 N 代表每次要检查的最小subarray的长度 一开始还是随机选一个单词 如果N=3 就直接form从这个词开始长度为3的subarray 然后下次再form的时候需要查这整个subarray后面可能出现的词 加到结果里 每次form的时候都查结果里最后3位之后可能出现的词
468
913
有一个shipment class有weight这个filed 然后不同weight区间对应不同rate 需要计算一个 shipment的价格
91

新人求加米!多谢!

评分

参与人数 6大米 +7 收起 理由
frank535 + 2 给你点个赞!
xue610315921 + 1 赞一个
微信用户_8707d2b + 1 很有用的信息!
CuttiePie + 1 赞一个
txdsteven + 1 给你点个赞!

查看全部评分


上一篇:埋塔面筋以及求问product的system design 到底重点是什么,感觉光读alex的书还不够
下一篇:asus 电面
全局:
老哥是不是看到裁员消息来攒米刷面积的👀
回复

使用道具 举报

🔗
 楼主| kool2000 2024-1-27 04:54:50 | 只看该作者
全局:
攒米不容易啊,得先给地里贡献,这是我自己以前面试时整理的,非常全了。靠这些基本都没问题的,面试准过!
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-H1FFK  2024-1-27 14:11:24
kool2000 发表于 2024-1-26 12:54
攒米不容易啊,得先给地里贡献,这是我自己以前面试时整理的,非常全了。靠这些基本都没问题的,面试准过!

我以为公司又开始招人了lol
回复

使用道具 举报

🔗
锋夜飘雪 2024-3-6 10:34:36 | 只看该作者
全局:
匿名用户 发表于 2024-1-27 14:11
我以为公司又开始招人了lol

好像是又开始招人了,我看脉脉好几个人在内推。
请问大佬在里面吗?刚大裁员又招人,请问是什么情况呀
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-TATVI  2024-3-6 12:07:08 来自APP
锋夜飘雪 发表于 2024-03-05 18:34:36
好像是又开始招人了,我看脉脉好几个人在内推。
请问大佬在里面吗?刚大裁员又招人,请问是什么情况呀
北美的裁了,转去国内和印度招人
回复

使用道具 举报

🔗
锋夜飘雪 2024-3-7 22:19:04 | 只看该作者
全局:
匿名用户 发表于 2024-3-6 12:07
北美的裁了,转去国内和印度招人

哦哦好的谢谢大佬
回复

使用道具 举报

全局:
米不够..
回复

使用道具 举报

🔗
winnie123123 2026-1-13 07:51:41 | 只看该作者
全局:
怎么会那么多啊 不准备感觉秒没了
回复

使用道具 举报

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

本版积分规则

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