怎么编写提醒人结账的短信息_我如何在短短8个月的时间里从编写第一行代码到获得$ 226K的工作机会...

怎么编写提醒人结账的短信息

I got offers from Google, Lyft, Yelp, cloud unicorn Rubrik, IBM Artificial Intelligence, and JP Morgan Chase. My story may help you in your job search.

我收到了Google,Lyft,Yelp,云独角兽Rubrik,IBM AI和JP Morgan Chase的报价。 我的故事可能会对您的求职有所帮助。

介绍 (Introduction)

I hope my story inspires current software engineering job seekers -  especially from non-traditional backgrounds.

我希望我的故事能启发当前的软件工程求职者-尤其是来自非传统背景的求职者。

You may be thinking “how likely is it that I could pull this off too?” In this article, I'll be specific about my decisions and thought processes. I'll also give links for further reading.

您可能在想:“我也能实现这一目标的可能性有多大?” 在本文中,我将具体说明我的决策和思考过程。 我还将提供链接以供进一步阅读。

First, I must acknowledge that I have benefited from significant privilege: I am a white, straight, cis, male with a bachelor’s degree from a top 20 US university. I had also built up a network after three years of working in the San Francisco Bay Area.

首先,我必须承认自己从特权中受益:我是白人,异性恋,顺式男性,拥有美国前20名大学的学士学位。 在旧金山湾区工作了三年之后,我还建立了一个网络。

Every job seeker's story will be different, but I hope yours benefits from mine.

每个求职者的故事都会有所不同,但我希望您能从我这里受益。

决定冒险 (Deciding to take the plunge)

On July 29th, 2018, I made an irrational decision.

2018年7月29日,我做出了一个不合理的决定。

I was choosing between a Chief of Staff role for a hyper-growth adtech company and attending a coding “bootcamp.” The Chief of Staff role was lucrative and certain - seemingly an extraordinary ticket to a Silicon Valley fast track. The bootcamp seemed expensive and risky.

我是在一家增长Swift的广告技术公司的幕僚长职位和参加编码“训练营之间进行选择 参谋长的角色是有利可图的,而且确实可以确定-似乎是硅谷快速通道的非凡门票。 训练营似乎很昂贵而且冒险。

I had written my first line of JavaScript five weeks earlier on June 24th with no intention of becoming an engineer. I already had a degree in Economics and three years’ experience as a non-technical management consultant for nonprofits. I just wanted to make myself a more attractive candidate for roles that involved working with engineers in the Bay Area.

我在6月24日的5周前写了我的第一行JavaScript,但并不想成为一名工程师。 我已经获得经济学学位,并担任非营利组织的非技术管理顾问已有三年经验。 我只是想让自己成为与湾区工程师一起工作的更具吸引力的候选人。

Actually becoming an engineer seemed like a moonshot idea. I had heard stories of people self-teaching and using bootcamps to do so in under a year. But I struggled to believe that I could do the same.

实际上,成为一名工程师似乎是一个月球想法。 我听说过人们在不到一年的时间里自学并使用训练营的故事。 但是我难以相信我可以做到。

Most engineers I knew had four-year computer science degrees, years of experience, and seemed to speak a foreign language. How could I learn all that in so little time? Plus, doing so would require I throw out my career-to-date in operations and strategy — a high cost for an uncertain reward.

我认识的大多数工程师都拥有四年计算机科学学位,多年经验,并且似乎会说一门外语。 我怎么能在这么短的时间内学到所有这些? 另外,要做到这一点,我需要投入我的职业生涯,直到最新的运营和策略,这是一笔高额费用,无法获得肯定的回报。

The Chief of Staff role, on the other hand, looked like a dream come true. I would be the most junior member by ~10 years in “the room where it happens” as the company navigated upcoming acquisition talks. Salary negotiations went better than expected, and it seemed I would likely inherit a department of my own after a few years.

另一方面,参谋长的角色看起来像是梦想成真。 在公司进行即将进行的收购谈判时,我将是“发生的房间”中约10年内最初级的成员。 薪资谈判比预期的要好,几年后我似乎可以继承自己的部门。

But once I started coding I didn’t want to stop. I loved the technical challenge, was thrilled to make headway against something so intimidating. And I figured developing a second professional skillset might prepare me for an unusually impactful career.

但是一旦我开始编码,我就不想停止。 我喜欢这项技术挑战,很高兴能在如此令人畏惧的事情上取得进展。 而且我认为开发第二个专业技能组可能会使我为从事具有非凡影响力的职业做好准备。

An inner voice also asked if becoming an engineer would be as personally transformational as professional: If I succeed in learning this, what couldn’t I learn? This attitude, more than anything else, would become the theme of my journey.

内心的声音还问到,成为工程师是否会像专业人士一样具有个人转变能力: 如果我成功地学习了这一点,我学不到什么? 这种态度最重要的将成为我旅途的主题。

I took an online course and, after coding ~40 hours/week for three weeks, I decided to apply to Hack Reactor, which I had heard described as “the Harvard of bootcamps,” just to see if I could get in. I passed the entrance exam by the skin of my teeth the same week I received the Chief of Staff offer.

我参加了一个在线课程,在每周约40个小时的编码,持续三个星期之后,我决定申请Hack Reactor (我听说这是“训练营的哈佛”),只是为了看看我是否可以进入。我通过了我在收到参谋长报价的同一周,通过牙齿的皮肤进行入学考试。

After 72 hours of soul searching I checked my bank account one last time. I estimated I would have three months’ rent and food after Hack Reactor. Just enough time to find a job, I thought.

经过72小时的灵魂搜索,我最后一次检查了我的银行帐户。 我估计在Hack Reactor之后我会得到三个月的房租和食物。 我想,只有足够的时间找到工作

I chose bootcamp.

我选择了训练营。

I declined by phone with the adtech company, hung up, and was hit by a wave of mixed emotions. Part of me was scared: I’m throwing away a once-in-a-lifetime opportunity for a moonshot idea! Another part excited: The only thing that stands between me and regret is taking risks!

我拒绝了与Adtech公司的电话联系,挂断了电话,并被一波混杂的情绪所打击。 我的一部分被吓到了: 我丢掉了一个千载难逢的机会来实现一个月球出击的想法! 兴奋的另一部分: 我和后悔之间唯一的事情就是冒险!

Soon my excitement won out. No turning back now – I was in for an adventure.

很快我的兴奋就消失了。 现在不要回头–我正冒险。

学习编码 (Learning to code)

“You don't have to be great to start, but you have to start to be great.” –Zig Ziglar

“开始时不必太好,但是必须开始好。” –Zig Ziglar

Hack Reactor and other “bootcamps” aspire to do in three months much of what traditional university CS programs do in four years: prepare students to compete for top-tier software engineering jobs.

Hack Reactor和其他“训练营”渴望在三个月内完成许多传统大学CS计划在四年内所做的工作:为学生做好竞争顶级软件工程工作的准备。

The goal is ambitious, and every moment counts. For 12-14 hours/day, 6 days/week over the course of 3 months, the program threw us repeatedly into overwhelming tasks against tight time constraints.

目标远大,每一刻都很重要。 在3个月的时间里,每天12到14个小时(每天6天),该程序使我们反复面对繁重的工作,而时间紧迫。

At the start of every assignment I would get a sickening pit in my stomach and think, This deadline seems impossible – I don’t even know where to start! But somehow I would (almost) always hack together a working solution just as time expired.

每次作业开始时,我都会感到肚子发麻,想想, 这个截止日期似乎是不可能的-我什至不知道从哪里开始 ! 但是随着时间的流逝,我总会(几乎)总是以某种方式破解一个可行的解决方案。

After enough reps, I started to associate the pit in my stomach with a sense of excitement — the more impossible the challenge seemed, the more satisfying it would be to find a solution.

经过足够的代表之后,我开始将肚子里的坑与兴奋感联系在一起-挑战似乎越不可能,寻找解决方案就越令人满意。

Hack Reactor wasn’t just teaching content, it was teaching a new kind of grit and growth mindset, and the process was exhilarating.

Hack Reactor不仅在讲授内容,还在讲授一种新的勇气成长心态 ,并且过程令人振奋。

Still doubting I would get a job before my savings ran out, I invested in the best learning and self-care habits I could find.

我仍然怀疑我会在积蓄用完之前找到工作,而是投资了我能找到的最佳学习和自我保健习惯。

To ensure ample sleep for learning, I kept strict bedtimes.

为了确保充足的睡眠以供学习 ,我严格遵守就寝时间。

To fight repetitive stress aches, boost wellbeing, and support learning, I worked out every other day.

为了对抗反复的压力性疼痛, 增进健康支持学习 ,我每隔一天锻炼一次。

To improve retention and make each day’s learning a little better than the last, I reviewed core lessons and reflected on what went well and what did not most evenings.

为了提高保留率并使每天的学习情况都比上一天有所改善,我回顾了核心课程,并反思了哪些课程进展顺利,哪些不是大多数晚上。

And most importantly, to maintain baseline wellbeing during such an intense schedule, I meditated for a full hour every morning before class, usually using a mix of vipassana (a form of body scanning) and loving-kindness techniques.

而且最重要的是,为了在如此紧张的日程中保持基线健康,我每天上课前每天早上静坐一小时,通常使用内观(一种身体扫描 )和爱心技巧的结合。

This last habit may strike some as extreme, but the evidence behind meditation improving wellbeing is strong, especially loving-kindness. I cannot overstate how valuable this practice was in helping me embrace the curiosity and joy of learning rather than grow anxious about the challenges of bootcamp and uncertain employment.

这最后的习惯可能有些极端,但是冥想改善幸福感的证据很强,尤其是爱心 。 我不能高估这种做法对帮助我拥抱学习的好奇心和乐趣,而不是对训练营和不确定的就业挑战感到焦虑的价值。

I also benefited from a blessing in disguise. A travel conflict prevented me from enrolling in the in-person immersive, so despite living a 10-minute walk from the SF campus, I had to take the remote program. Between the lack of commute, easy access to food, and the quiet of my apartment, I was able to protect another ~90 minutes a day of uninterrupted deep work.

我也因祸得福。 一次旅行冲突使我无法参加身临其境的沉浸式学习,所以尽管距离SF校园只有10分钟的步行路程,但我还是不得不参加远程课程。 在没有通勤,容易获得食物和安静的公寓之间,我每天能够再保护约90分钟的深度工作

The first six weeks involved two-day pair programming sprints building on semi-completed code repositories. We raced through rewriting the JavaScript Underscore library, building basic data structures from scratch, learning object-oriented vs. functional programming, calculating time and space complexity, and wiring up a full stack app from client to server to database. Our smaller, 24-person cohort grew close joking with one another over video conference 10+ hours/day.

前六个星期涉及在半完成的代码存储库上建立的为期两天的结对编程sprint。 我们通过重写JavaScript Underscore库,从头开始构建基本数据结构,学习面向对象与功能编程,计算时间和空间复杂度以及从客户端到服务器再到数据库的完整堆栈应用程序进行了竞争。 我们规模较小的24人群组每天在视频会议上聊天10个小时以上,彼此之间互相开玩笑。

Three weeks in, I was afraid I wasn’t going to pass the gating mid-course assessment, so I wrote a letter to myself dated in the future explaining how it came to be that I passed the assessment.

三个星期后,我担心自己将无法通过门中评估,因此我写了一封信,信中写着自己的日期,日后会解释我如何通过评估。

I mentioned all my existing self-care and learning habits and added a few more, including reviewing code I didn’t fully understand until I could mentally explain the core concepts to an imaginary 8 year-old (the Feynman Technique).

我提到了我所有现有的自我保健和学习习惯,并增加了一些其他习惯,其中包括复习直到我可以从心理上向一个想象中的8岁孩子解释核心概念之前才完全理解的代码( 费曼技术 )。

Three weeks later, I built my first full stack application from scratch in under 24 hours and passed the exam with flying colors. College was a great education. This was another level.

三个星期后,我在不到24小时的时间内从头构建了我的第一个全栈应用程序,并以优异的成绩通过了考试。 大学是一门伟大的教育。 这是另一个层次。

The second six weeks involved more free-form group projects. Taking inspiration from positive deviance, I tracked down and got in touch with bootcamp alumni who were especially successful in the job search. I followed their guidance to set tight personal deadlines for intimidating technical challenges, select “hot” skills on the job market (like working with Docker and microservices), and diversifying my roles across different projects. I arranged a tutoring session with one alum and successfully implemented a feature that originally took him weeks in two days.

后六周涉及更多自由形式的小组项目。 从积极的偏差中汲取灵感,我追踪并与在训练中特别成功的训练营校友取得了联系。 我遵循了他们的指导,为紧迫的技术挑战设定了紧迫的个人截止日期,选择了工作市场上的“热门”技能(例如与Docker和微服务一起工作),并在不同项目中分散了我的角色。 我安排了一位校友参加辅导课程,并成功地实施了一项功能,该功能最初使他花了两天的时间。

Hack Reactor hires some of its graduates from each cohort to serve as temporary, part-time teaching assistants to support full-time staff. After graduation, I took a 6-week position working ~35 hours/week and helped roll out new curriculum, conducted independent research, lectured job-seeking alumni on my findings, and interviewed incoming Hack Reactor candidates.

Hack Reactor从每个队列中雇用一些毕业生作为临时的兼职教学助手,以支持全职员工。 毕业后,我担任了一个为期6周的工作,每周工作约35个小时,并帮助推出新课程,进行了独立研究,对我的发现进行了演讲,并邀请了即将到来的Hack Reactor候选人。

I negotiated a 6-week position as opposed to the typical 12-week position to give me exposure to the new curriculum while limiting the delay in job searching and studying full-time. I was grateful to learn on the job (teaching in particular boosted my own learning) and the modest pay bought me two more months of living expenses – a big relief!

我协商了一个6周的职位,而不是通常的12周的职位,这使我可以接触到新课程,同时限制了全职工作和学习的延迟。 我很高兴在工作中学习( 特别是教书提高了我的学习能力 ),适度的薪水又给我买了两个月的生活费,这真是一个很大的缓解!

确保担任软件工程师的工作 (Securing a job as a Software Engineer)

On December 7, 165 days after my first line of code, my employment with Hack Reactor ended, leaving me with savings to pay for four months’ rent and food. Hack Reactor warns its graduates to budget six months for job searching. The clock was ticking!

在第一行代码发布后165天的12月7日,我在Hack Reactor的工作结束了,剩下的积蓄用来支付四个月的房租和伙食费。 Hack Reactor警告其毕业生预算六个月的工作寻找时间。 时钟在滴答滴答!

I wrote down my goals. I was ambitious and the odds were stacked against me. I wanted:

我写下了目标。 我野心勃勃,对我而言,可能性很大。 我想了:

  • A top 25th-percentile Hack Reactor outcome in compensation, hoping for over $120K/annual salary

    Hack Reactor的薪酬结果排名第25位,期望每年超过$ 120K
  • The steepest possible learning curve; ideally in a role with both autonomy and access to experienced mentors

    最陡峭的学习曲线; 理想情况下既要具有自主权,又要有经验的导师
  • A team and company culture that was technically strong but people-first

    具有强大的团队和公司文化,但以人为本
  • Interesting and meaningful work

    有趣而有意义的工作
  • A back end role, or at least full stack, which were less common than front end roles landed by bootcamp grads

    后端角色,或至少是完整堆栈,比新兵训练营毕业生登陆的前端角色少见

I never imagined I would get everything I wanted and more. But the search would be a rollercoaster of ups and downs.

我从未想过我会得到我想要的一切,甚至更多。 但是搜索将是跌宕起伏的过山车。

Hack Reactor left me with a terrific foundation in little time, but I was still weeks, if not months, of full-time study away from where I needed to be to interview successfully at top companies.

Hack Reactor在很短的时间内给我留下了一个了不起的基础,但我离全职学习仍然需要数周(即使不是数月)的学习,而这是我需要在顶级公司成功面试的地方。

I would also have to face relentless, ongoing rejection with no certainty of success. Hiring from coding bootcamps is not yet mainstream, and despite evidence suggesting bootcamps grads perform just as well as those with four-year CS degrees in interviews, it would be an uphill battle to land interviews. And the vastness of topics covered in software engineering interviews meant I could never be completely prepared.

我还必须面对无情的,持续的拒绝,而没有成功的把握。 编码训练营的招聘工作尚未成为主流,尽管有证据表明,训练营的毕业生的表现与面试四年制CS学位的毕业生一样好 ,但要争取面试将是一场艰苦的战斗。 而且,软件工程访谈中涵盖的主题之多,意味着我永远无法完全做好准备。

When it was all over, I had applied to 44 companies with 41 referrals and received 14 coding challenges or technical phone interviews, which converted to 8 on-sites and 7 offers by February 15, 2019 - 245 days after my first line of code.

当一切结束时,我已经向44家公司提出了41个推荐,并收到了14个编码挑战或技术电话面试,到2019年2月15日-我的第一行代码之后245天,我转换为8个现场和7个报价。

从失败中开始搜索和学习 (Beginning the search and learning from failure)

"Learning is not attained by chance, it must be sought for with ardor and attended to with diligence." ―Abigail Adams

“学习不是偶然得到的,必须热心寻求并勤奋学习。” ―阿比盖尔·亚当斯(Abigail Adams)

My first weeks of job searching were the toughest. I landed only a handful of coding challenges and an interview with IBM Artificial Intelligence throughout all of December.

我找工作的头几周最艰难。 在整个十二月中,我只遇到了一些编码挑战,并接​​受了IBM人工智能的采访。

Feedback on my first two take-home coding challenges was not encouraging. I went way over time, and was told my code was “neither accurate nor performant.”

对于我头两个带回家的编码挑战的反馈并不令人鼓舞。 我随着时间流逝,被告知我的代码“既不准确也不高效”。

My third coding challenge was a multi-hour, heart-thumping affair in which I passed all tests with seconds to spare but failed to click submit before time expired!

我的第三个编码挑战是一个耗时数小时的令人兴奋的事情,其中​​我通过了所有测试,并节省了几秒钟的时间,但是在时间到期之前未能单击提交!

I told myself it was a numbers game, and every morning after my hour of loving-kindness meditation, I’d take a minute to remind myself of two things:

我告诉自己这是一场数字游戏,每天早上我经过一小时的爱心冥想后,都会花一分钟的时间提醒自己两件事:

  • First, while my goals gave me direction, overly focusing on goals would only leave me dissatisfied with the gap between where I was and where I wanted to be. I wanted habits over goals.

    首先,虽然我的目标为我提供了方向,但过度专注于目标只会让我对自己所处的位置与想要成为的位置之间的差距感到不满意。 我想要习惯而不是目标

  • Second, I reflected that regardless of what job landed, the real prize of this journey was personal, not professional, transformation. I was lucky to have months dedicated full-time to learning how to learn, and I was falling in love with it!

    其次,我反映出,无论从事什么工作,这次旅程的真正收获是个人的转变,而不是专业的转变。 我很幸运能有几个月全职的时间学习如何学习,而我爱上了它!

I knew early failures could be seeds for later success, but they would require special care. I made sure to do a post-mortem on every failed coding challenge and interview, then redo the problem in my text editor until I solved it. One 20-minute prompt took me 9 hours over three days to solve!

我知道早期的失败可能是后来成功的种子,但他们需要特别的照顾。 我确保对每一次失败的编码挑战和面试都进行一次验尸,然后在我的文本编辑器中重做该问题,直到解决为止。 一则20分钟的提示花了我3天9个小时来解决!

I kept notes on new concepts and “aha” moments after I solved a problem, treating them as my invaluable collection of “mental models” I hoped would grow sufficient to pattern match to any interview prompt. I would review them on spaced repetition intervals to most efficiently commit to long-term memory.

解决问题后,我会记下新概念和“啊哈”时刻,将它们视为我宝贵的“ 心理模型 ”集合,我希望这些模型和模式能与任何面试提示相匹配。 我会按一定间隔重复检查它们,以最有效地致力于长期记忆。

For problems involving new code syntax, I’d redo them under time pressure to ensure accurate recall in an interview setting.

对于涉及新代码语法的问题,我会在时间压力下重做,以确保在面试环境中准确地回忆起问题。

These habits did more than enhance retention — they built reassuring confidence. I didn’t know if I’d land a job before money ran out, but it was satisfying that even my greatest disappointments were making me better.

这些习惯不仅增加了保留率,还建立了令人放心的信心。 我不知道我是否会在钱用完之前找到工作,但令我满意的是,即使我最大的失望也使我变得更好。

I settled into a steady routine, ~8 hours a day, 5+ days/week: study and/or interview, diagnose failure/success, reflect, repeat.

我安定下来,每天大约8个小时,每周5天以上,每天进行一次固定的日常工作:学习和/或访谈,诊断失败/成功,反思,重复。

I curated and constantly revised my study plans by first getting a sense for what strong performance looked like in each of the different types of interviews I might encounter (data structure/algorithms, front end DOM manipulation, systems design, etc.). Then I’d estimate the probability of encountering each type in upcoming interviews and weigh that against my self-assessment of my performance to decide what to study next.

通过首先了解我可能会遇到的每种不同类型的面试(数据结构/算法,前端DOM操作,系统设计等)中什么样的表现,我制定并不断修订学习计划。 然后,我估计在即将到来的面试中遇到每种类型的可能性,并将其与我对自己表现的自我评估相权衡,以决定下一步要学习什么。

Wanting to ensure I only used the best resources, I kept lists of peer-recommended resources organized by topic. When it was time to study that topic, I’d supplement the list with anything new from a quick Google search and then skim each resource to determine the best one or two before diving deep into those. I’d do most prioritization the day before so I could go straight from my morning meditation into 2-3 hours of uninterrupted deep work the next day.

为了确保仅使用最佳资源,我保留了按主题组织的同行推荐资源的列表。 是时候研究该主题了,我在列表中添加了Google快速搜索中的新内容,然后浏览每种资源以确定最佳的一种或两种资源,然后再深入研究。 我会在前一天进行最优先的排序,这样我就可以从早上的冥想直接进入第二天的2-3小时不间断的深层工作。

I spent another 2-3 hours/day building a pipeline of attractive companies, generating referrals, and submitting applications. It took more time than I liked to complete a single application and I had a limited number of top picks, so I did my best to increase app-to-interview conversation rates by

我又花了2-3个小时/天的时间来建立有吸引力的公司的渠道,产生推荐和提交申请。 完成一个应用程序所花的时间比我喜欢的要多,并且我的首选职位数量有限,所以我尽力将应用程序与面试的对话率提高了

  • emphasizing results over context or action in my resume,

    在我的简历中强调结果胜过上下文或行动,

  • studying which of my approaches and messages generated referrals fastest via email and LinkedIn,

    研究我的哪种方法和消息通过电子邮件和LinkedIn获得最快的推荐,
  • tracking my entire pipeline in a spreadsheet, and

    在电子表格中跟踪我的整个渠道,以及
  • following up on all communications.

    跟进所有通讯。

I treated most applications as experiments in improving return for time invested. Habits paid off here too — steadily putting companies in my pipeline meant that I could immediately look ahead to the next opportunity when I received a rejection.

我将大多数应用程序视为提高投资回报率的实验。 习惯在这里也得到了回报-稳步让公司参与进来意味着我在遭到拒绝后可以立即期待下一个机会。

I also did my best to time applications so I could interview first with less desirable companies while pushing along slower moving processes (like Google’s).

我还尽力安排申请时间,因此我可以先与不那么理想的公司面谈,同时推进流程缓慢的流程(例如Google的流程)。

My interview with IBM proved to be a bright spot to my rocky start, but even still, it doubled as a lesson to persist amidst uncertainty. It consisted of a phone interview and three more interviews at the “on-site.”

我对IBM的采访被证明是我艰难的开端的一个亮点,但即使如此,它仍然是在不确定性中继续存在的一课。 它包括电话采访和“现场”的另外三个采访。

At the start of every interview I experienced that now-familiar pit in my stomach and thought: I do not know how to do this.

在每次面试开始时,我都经历了现在熟悉的凹坑,并想到: 我不知道该怎么做

I responded each time by taking a breath and reminding myself: It’s fun turning this feeling into a working solution at home, so imagine how much more fun it will be here where the stakes are higher and the job is on the line!

我每次都屏住呼吸并提醒自己: 在家把这种感觉变成一种可行的解决方案很有趣,所以想象一下,在赌注更高,工作即将开始的情况下,它将有多有趣!

After the first two interviews, I wondered if my excitement and learning orientation were contagious — my interviewers certainly knew I didn’t see an answer right away, but they seemed to enjoy how the energy in the conversation rose as I neared a solution.

在前两次面试之后,我想知道我的兴奋和学习取向是否具有感染力-我的面试官当然知道我没有立即看到答案,但是当我接近解决方案时,他们似乎很喜欢对话中的能量如何增加。

I left IBM encouraged that, while I may not always crack an interview prompt, I could always enjoy sharing a growth mindset under pressure. I’m sure this mentality helped me convert seven of eight on-sites.

我离开IBM时受到的鼓舞是,尽管我可能不总是破解面试提示,但我总是可以在压力下享受分享成长心态的乐趣。 我确信这种心态帮助我转换了八个站点中的七个。

Fortunately, seeds sown in December’s failures bloomed into January's success.

幸运的是,在12月的失败中播下的种子开花到1月的成功。

建立动力并尽早取得成功 (Building momentum and early success)

"Your hardest times often lead to the greatest moments of your life. Keep going." ―Roy T. Bennet

“您最艰难的时刻通常会带给您一生中最美好的时刻。继续前进。” -罗伊·T·贝内特

The first week of January, IBM called with an informal offer with formal details forthcoming. Could I use this as leverage in the meantime? I thought. I shared the news with a Google recruiter, who responded by accelerating me past the phone interview straight to an on-site.

1月的第一周,IBM发出了正式报价的非正式报价。 同时,我可以将其用作杠杆吗? 我想。 我与一位Google招聘人员分享了这一消息,他的回答是让我通过电话采访直接进入了现场。

Suddenly, I could command recruiters’ attention. I immediately informed all companies I was speaking with that I had an offer. Doing so during the start of the new year immediately heated up my pipeline.

突然,我可以引起招聘人员的注意。 我立即通知所有与我交谈的公司,他们提出了要约。 在新的一年开始时,这样做立即使我的管道升温。

The next week, I felt confident for the first time in all four technical interviews at a JP Morgan Chase on-site, finishing most of them with time to spare. I was overjoyed my work in December had so clearly paid off.

下周,我在JP Morgan Chase现场进行的所有四次技术面试中第一次感到充满信心,完成了其中大部分工作,并花了很多时间。 我很高兴12月份的工作获得了如此明显的回报。

My Google on-site was a few days later. The difference in difficulty was shocking. I performed terribly in my second interview involving asynchronous JavaScript promises.

几天后,我的Google网站上出现了。 难度上的差异令人震惊。 我在涉及异步JavaScript承诺的第二次采访中表现非常出色。

I took a moment in the restroom at the lunch break to regroup with a micro-meditation. I figured I had almost no shot at a job offer, so the objective was now to learn as much as possible from my failure.

午休时我在洗手间花了一点时间,进行微冥想的重组。 我以为自己几乎找不到工作机会,所以现在的目标是从失败中学习尽可能多的东西。

I knew I’d do a post-mortem in the evening. In the meantime, I challenged myself to see how much gratitude and equanimity I could cultivate in such a high-stakes environment. After all, how exciting was it I was interviewing at Google?

我知道我晚上会做验尸。 同时,我挑战自我,看看在如此高风险的环境中我能培养出多少感恩和安宁。 毕竟,我在Google面试的过程有多激动?

The idea seemed to help me pull out of my tail-spin and I got better throughout the afternoon. By the time I left, I even had a glimmer of hope Google might still offer me a job.

这个主意似乎帮助我摆脱了困境,整个下午我都好起来了。 到我离开时,我甚至有一线希望Google仍然可以为我提供工作。

Per my post-mortem habit, I went home and found online resources to help me build a JavaScript promise from scratch. The next day I took three phone screens and the ups-and-downs struck again.

按照我的验尸习惯,我回家并找到了在线资源来帮助我从头开始构建JavaScript承诺。 第二天,我拍了三个手机屏幕,起伏再次发生。

I performed strongly on a call with a security startup. I Embarrassed myself with a small energy startup. And I had the comeback of a lifetime on the phone with Rubrik, a cloud storage unicorn.

我在与安全启动公司的通话中表现出色。 我让一家小型能源公司感到尴尬。 然后,我与云存储独角兽Rubrik在电话上度过了难忘的回忆。

Rubrik asked another question on promises, harder than the one from the Google interview I had failed a day before. Having done my post-mortem, I innovated on the spot and raced to the finish just as time ran out.

鲁布里克(Rubrik)就诺言提出了另一个问题,比我前一天失败的Google采访中的诺言要难得多。 完成我的验尸之后,我就地进行了创新,并随着时间的流逝进入了终​​点。

The interviewer said I may have been the first bootcamp grad the company had ever interviewed — they traditionally hire only from prestigious universities — and he couldn’t believe I wrote my first line of code the summer before. I did a little dance in my room.

这位面试官说,我可能是该公司面试过的第一个训练营毕业生-他们传统上只从著名的大学聘用-而且他不敢相信我是在夏天之前写的第一行代码。 我在房间里跳舞了一点。

The next week, JP Morgan Chase called and offered me $110K/year, with no equity or bonus. I didn’t think it was a cultural fit, and I wasn’t yet at my $120K/year target, but I was thrilled to have my first official offer. Someone was going to pay me to code!

下周,摩根大通(JP Morgan Chase)打电话给我,提供了每年11万美元的资金,没有任何股权或奖金。 我认为这不适合文化,我还没有达到我的12万美元/年的目标,但我很高兴能收到我的第一份正式报价。 有人要付钱给我编码!

I started to handle several calls per day from phone interviewers, recruiters, and advisors, and the often unpredictable ups-and-downs continued. Google called and said on-site results were mixed but I’d be moving to Hiring Committee. Uber offered an on-site. I thought I performed strongly on an Amazon phone screen but didn’t get an on-site. And I thought I blew a Yelp phone screen and got an on-site.

我开始每天处理电话面试官,招聘人员和顾问的几个电话,而且经常发生无法预测的起伏不断。 Google打电话说现场结果好坏参半,但我将转到招聘委员会。 优步提供了一个现场。 我以为我在亚马逊手机屏幕上表现出色,但是没有进入现场。 我以为我吹了Yelp手机的屏幕,然后进入了现场。

As on-sites came and went, I had to watch my words around recruiters. The security startup said they were afraid they wouldn’t be able to keep up with big companies like IBM and JP Morgan Chase and asked what salary offers I had received.

随着现场的进出,我不得不看着招聘人员周围的话。 这家安全初创公司表示,他们担心自己无法跟上IBM和JP Morgan Chase这样的大公司,并询问我收到了什么薪水。

I almost bit the bait, but paused and deflected the salary question as Hack Reactor instructs. I’d actually like to go the other way – can you tell me your range and I’ll tell you if you’re in the ballpark?” I said. “Sure, we start at $125K.”

我几乎咬住了诱饵,但按照Hack Reactor的指示停顿了一下薪水问题我实际上是想走另一条路–你能告诉我你的射程,我会告诉你你是否在球场上吗?” 我说。 “当然,我们的起价为12.5万美元。”

$125K. That exceeded my goal!

$ 125K。 那超出了我的目标!

I looked away hoping to disguise my excitement by making it look like I was thinking about it. I turned back and said calmly, If that’s your starting point, I think we can have a conversation.” He responded: “Oh good, I’m relieved we’re still in the running!” Me too, I thought.

我把目光移开,希望通过使自己看起来像在思考中来掩饰自己的兴奋。 我转身平静地说: 如果那是您的出发点,我想我们可以进行对话。” 他回答:“哦,天哪,我们还在跑步中,我很放心!” 我也是,我想。

The formal offer was in a few days later: $125K plus $6K/annual in stock options at current valuation. But the money was almost insignificant! It was a good cultural fit, a fascinating back end role, and mentorship opportunities looked unusually strong. The team of ~40 engineers all had at least two years’ experience and were mostly from top schools like MIT, Stanford, or Berkeley. It was everything I wanted!

几天后才正式提出要约:以当前估值计算,价值12.5万美元,外加每年6000万美元的股票期权。 但是这些钱几乎是微不足道的! 这是很好的文化契合度,令人着迷的后端角色,指导机会看起来异常强大。 大约40名工程师组成的团队都至少有两年的经验,并且大多来自麻省理工学院,斯坦福大学或伯克利大学等顶尖学校。 这就是我想要的一切!

But the offers were just getting started.

但是报价才刚刚开始。

协商报价并选择公司 (Negotiating across offers and selecting a company)

"Effective negotiators look past their counterparts’ stated positions and delve into their underlying motivations... they are relentlessly curious." –Chris Voss

“有效的谈判者超越了对方的陈述立场,并探究了他们的潜在动机……他们毫不留情地感到好奇。” –克里斯·沃斯

Rubrik called two days later and shocked me. They wanted me to be their first-ever bootcamp hire too. Rubrik was already valued at $3.3B — a hot new unicorn and coveted place to work by software engineers with plenty of experience. I laughed with the recruiter, overjoyed such a competitive company wanted me, and hung up so excited I almost didn’t realize I had a missed call from Google.

两天后,Rubrik打电话给我,使我震惊。 他们也希望我成为他们有史以来的第一个训练营。 Rubrik的价值已经达到$ 3.3B,这是一个炙手可热的新独角兽,并且是经验丰富的软件工程师所梦co以求的工作场所。 我和招聘人员一起笑,对一家如此有竞争力的公司要我大喜过望,并挂了电话,激动得几乎没有意识到我接到了Google的未接来电。

I dialed back with bated breath. The recruiter got right to it: “I just got out of Hiring Committee and wanted to call you right away. We’d like to make you an offer — ”

我喘着气回拨了电话。 招聘人员对此表示正确:“我刚刚离开招聘委员会,想立即致电给您。 我们想为您提供报价-”

I couldn’t contain myself. I yelled, jumping into my empty kitchen. Google! The gold standard of software engineering and my hardest interviewer had decided they wanted me! Then she mentioned numbers and things got surreal. $163K all-in: $120 base salary, $18K minimum bonus, and $25K annual in (liquid) equity.

我无法控制自己。 我大喊,跳进空荡荡的厨房。 谷歌! 软件工程的黄金标准和我最努力的面试官决定他们想要我! 然后她提到数字,事情变得超现实。 $ 163K全押:$ 120基本薪水,$ 18K最低奖金和$ 25K年度(流动性)权益。

$163K.

16.3万美元。

Are you out of your mind? I thought. My last tax return declared $77K. That is a stupid amount of money.

你是不是疯了? 我想。 我的上一个纳税申报表申报了$ 77K。 那是一笔愚蠢的钱。

I took the afternoon off and walked around my neighborhood dancing when I thought nobody was looking and calling family members to share the unbelievable news.

当我以为没有人在寻找并打电话给家人分享令人难以置信的消息时,我休假了下午,在附近的社区里跳舞。

The next morning, I was back to the grind, studying negotiation instead of algorithms. Overnight, the recruiters that had shepherded me through interviews became my counterparts in negotiations. I felt like a lone sheep amidst a pack of wolves – these were professionals and numbers could swing tens of thousands of dollars in conversations that lasted minutes.

第二天早上,我回到了研讨班,学习谈判而不是算法。 一夜之间,通过面试领我的招聘人员成了我在谈判中的同伴。 我感觉自己就像一群狼中的孤单羊,这些狼都是专业人士,在持续几分钟的对话中,数字可能会动swing数万美元。

Initially I feared coming across as greedy, but my Hack Reactor career coach was adamant. She said it was expected, and money aside, it demonstrates thoughtfulness, confidence in difficult conversations, and sets expectations for the first weeks on the job.

最初,我担心会遇到贪婪的想法,但我的Hack Reactor职业教练是坚定的。 她说,这是预料之中的,而且除了钱之外,它还表现出了体贴,对艰难对话的信心,并为工作的最初几周设定了期望。

The next few days flew by in a flurry of phone calls with recruiters and advisors, studying, preparing, and conducting post-mortems on negotiations. I wrote one-pagers anticipating every negotiation and conducted post-mortems on what went well and what did not, similar to how I reflected on failed interviews.

接下来的几天,他们与招聘人员和顾问通了电话,研究,准备和进行关于谈判的验尸。 我写了一页寻呼机,预见了每一次谈判,并对事态发展进行了事后总结,类似于我对失败的采访的反思。

I learned to love it. Each conversation was a fascinating puzzle, with layers ranging from high-level strategy, like when and how I shared information, to moment-to-moment tactics, like my tone of voice. It was especially fun to have so many at-bats – I would sometimes talk to multiple recruiters in a single day, each phone call doubling as another opportunity to try out new skills and learn from mistakes.

我学会了爱它。 每次对话都是一个引人入胜的难题,其层次从高层策略(例如我何时和如何共享信息)到瞬间策略,例如我的语气。 有这么多的蝙蝠战斗特别有趣–我有时会在一天内与多个招聘人员交谈,每个电话通话次数增加一倍,这是另一个尝试新技能并从错误中学习的机会。

I had read Harvard Negotiation Project’s Getting to the Yes and Getting Past the No in college and was familiar with concepts like BATNA and win-win solutions. But I took most of my inspiration from Chris Voss’s Never Split the Difference, which I re-read immediately after Google’s offer.

我在大学期间曾读过哈佛谈判项目的“ 走向是”和“ 超越否” ,并且熟悉诸如BATNA和双赢解决方案之类的概念。 但是,我的大部分灵感来自克里斯·沃斯(Chris Voss)的《 永不分开》( Never Split the Difference) ,我在Google提出要约后立即重新阅读。

I also scoured blog posts by Haseeb Qureshi, another earn-to-give bootcamp graduate, and chatted regularly with my Hack Reactor career coach who had advised hundreds of negotiations before mine.

我还搜寻了另一位赚钱的训练营毕业生Haseeb Qureshi的博客帖子,并定期与我的Hack Reactor职业教练聊天,后者曾为我进行过数百次谈判提供建议。

Rubrik’s first offer came in at $163K, matching Google perfectly. Then Yelp called with the latest plot twist. They “leveled-up” my application to a non-entry level role and offered me $160K plus a $20K sign-on bonus for $180K all-in first-year compensation.

Rubrik的第一个报价是$ 163K,与Google完全匹配。 然后Yelp用最新的情节打了个电话。 他们将我的申请“升级”为非入门级别的职位,并向我提供了16万美元,外加2万美元的签约奖金,以支付18万美元的第一年薪酬。

$180K and a non-entry level role?

$ 180K和非入门级别的角色?

I put on my very best performance at my Yelp interview — finishing every challenge with time to spare, adapting code seamlessly to meet new constraints, and making remarks about systems architecture using back-of-the-envelope calculations that seemed to surprise my interviewer. But that didn’t change the fact I had zero experience! Google and Rubrik immediately said they’d prepare a counter offer.

在Yelp面试中,我表现出了我最好的表现-花费所有时间来完成所有挑战,为适应新的限制而无缝地修改代码,并使用信封后的计算对系统体系结构进行评论,这似乎使我的面试官感到惊讶。 但这并没有改变我只有零经验的事实! Google和Rubrik立即表示,他们准备提出还价。

Finally the job search climaxed.

最终,求职达到了高潮。

Lyft emailed asking to get on the phone. Lyft was by far my favorite interview experience, but I didn’t believe my on-site performance merited an offer. I conceptually solved one interview almost immediately, but never got my code to work. I pulled off a late comeback in another but failed to submit as time expired. Stretched thin across multiple rounds of daily negotiations, I responded with this exact email:

Lyft通过电子邮件发送电子邮件要求上电话。 到目前为止,Lyft是我最喜欢的采访经历,但我不认为我的现场表演值得提供。 我从概念上几乎立即解决了一次采访,但从未使我的代码生效。 我又进行了一次较晚的复出,但由于时间到期而未能提交。 在每天多轮的日常谈判中,我用以下确切的电子邮件回复:

“I’m juggling a handful of different calls right now. Do you mind breaking the news by email? I’m guessing it’s a rejection, in which case I would love to get 1-2 sentences of feedback from each interview. Other than that, thank you for your time and shepherding me through the process!”

“我现在正在处理几个不同的电话。 您介意通过电子邮件突发新闻吗? 我猜这是一个拒绝,在这种情况下,我希望每次面试都能获得1-2句话的反馈。 除此之外,感谢您的宝贵时间,并帮助我完成了整个过程!”

She responded with one line: “It’s not a rejection :)”

她回答了一行: “这不是拒绝:)”

What! Would no company reject me? I couldn’t believe my top choice was back on the table. We talked numbers the next day: $210K all-in.

什么! 没有公司会拒绝我吗? 我简直不敢相信我的最佳选择又回到了桌面上。 第二天我们讨论了数字:21万美元全押。

$210K.

$ 21万。

And to think that was Lyft, where I would have loved to work, money aside! A couple of my friends at Lyft were some of my favorite people — harder to say if they were kinder than they were brilliant or vice versa — and my interviewers seemed cut from the same cloth.

可以想到的是Lyft,我会很乐意在这里工作,没有钱! 我在Lyft的几个朋友是我最喜欢的人-很难说他们比他们才华横溢,反之亦然-我的面试官似乎是从同一块布料上剪下来的。

I informed everyone a last minute offer had been made and set a decision deadline for one week, encouraging everyone to make their final offers. I was getting worn down in constant negotiations, I felt a deadline would professionally bound the time everyone was investing in my candidacy, and Voss suggests deadlines can be used to your advantage.

我通知所有人都提供了最后一分钟的报价,并将决定截止日期定为一周,以鼓励大家提出最终报价。 在不断进行的谈判中,我感到疲惫不堪,我觉得截止日期会在职业上限制每个人在我的候选资格上投入的时间,而Voss建议截止日期可以用于您的利益。

Google had prepared $189K to come in over Yelp, but said it would come back again given news about Lyft. Rubrik agreed to get on the phone. Yelp and and the security startup said they couldn’t negotiate further, and I was no longer keeping JP Morgan Chase or IBM up to speed. Uber, my only other onsite, did not make me an offer.

谷歌已经准备好以18.9万美元的价格收购Yelp,但表示一旦收到有关Lyft的消息,它将再次回来。 Rubrik同意接电话。 Yelp和安全初创公司表示,他们无法进一步进行谈判,而且我不再保持JP Morgan Chase或IBM的发展速度。 我唯一的其他现场人员优步(Uber)没给我要价。

The Lyft team had me for lunch and I swooned. Teams at Google, Yelp, and the security startup were enjoyable, but 9 people took time out of their day to lunch with me at Lyft, laughing as if I were already part of the team. They wanted to staff me on the company’s number one 2019 priority and a senior engineer told me he would happily serve as a mentor. Lyft was also months away from an IPO.

Lyft团队让我共进午餐,然后我昏了过去。 Google,Yelp和安全初创公司的团队很愉快,但是有9个人抽出时间在Lyft与我共进午餐,嘲笑我好像已经加入了团队。 他们想让我成为公司2019年的首要任务,一位高级工程师告诉我他很乐意担任导师。 Lyft距离IPO还有几个月的时间。

I had it all: mentorship, opportunity in a high-growth environment, a people-first culture, exciting work, and now outrageously high compensation.

我拥有的一切:指导,在高增长环境中的机会,以人为本的文化,令人兴奋的工作以及如今高得离谱的报酬。

Rubrik didn’t counter offer in time, but Google came in at $233K, $216K before their 401(k) match and charity match programs (which I consider good as cash since I earn-to-give and will be donating 25% of my pre-tax income this year). The team was also a good cultural fit, and Google is world-class in developing junior engineers into top talent.

Rubrik没有及时提出报价,但Google在其401(k)比赛和慈善比赛计划之前的收入为23.3万美元,21.6万美元(我认为这是很好的现金,因为我会以捐赠的方式赚取收益,我今年税前收入的百分之几)。 该团队还具有良好的文化背景,Google在将初级工程师培养成高级人才方面具有世界一流水平。

I grappled with the decision for days, wavering between Google and Lyft, but gradually growing confident that, compensation aside, Lyft was an opportunity I couldn’t pass up. I negotiated a final package of $226 all-in compensation: $135K base salary, $71K in equity at pre-IPO valuation, and $20K sign-on bonus. On Monday, February 25, 245 days after my first line of code, I spoke the two words that brought it all to a close: “I accept.”

我忙了几天的决定,在Google和Lyft之间摇摆不定,但逐渐有了信心,除了薪酬之外,Lyft是我无法逾越的机会。 我通过谈判达成了最终的一揽子计划,获得了226美元的全额薪酬:13.5万美元的基本工资,IPO前估值的7.1万美元的股权以及2万美元的签约奖金。 在第一行代码的245天之后的2月25日,星期一,我讲了两个使这一切都告一段落的单词:“我接受。”

Six months later, I couldn’t be happier working at Lyft. And to my delight, my morning reflection was dead on. My team is supportive, my work fascinating, and my compensation strong, but the priceless reward of becoming an engineer was falling in love with learning. Now that I’m in love, I don’t intend to leave it.

六个月后,我在Lyft工作变得更快乐了。 令我高兴的是,我的早晨沉寂了。 我的团队支持我,我的工作着迷,我的薪水也很高,但是成为一名工程师的无价回报是爱上了学习。 现在我恋爱了,我不想离开它。

寻找软件工程角色? (In search of software engineering roles?)

I've curated the list of top resources I used to prep for interviews. I'm also offering coaching sessions to job seekers that commit 10% or more of their future income to high impact charities.  Get access to both here.

我已经整理了用来准备面试的重要资源清单。 我还将为那些将未来收入的10%或更多用于高影响力慈善机构的求职者提供辅导课程。 此处访问两者。

Note: I write with a pen name to maintain a little separation between my personal life and growing presence as a job search coach.

注意:我用笔名书写,以使我的个人生活与求职教练的成长之间保持一点距离。

I shared specific compensation information in this article for two reasons. One, I want this post to be as useful as possible to job seekers from non-traditional backgrounds, many of whom may be less familiar with these numbers. And two, because sharing our salaries is a concrete way to fight pay inequality that hurts everyone, especially minorities.

由于两个原因,我在本文中分享了具体的薪酬信息。 第一,我希望这篇文章对非传统背景的求职者尽可能有用,其中许多人可能对这些数字不太熟悉。 第二,因为分享我们的薪水是与薪酬不平等作斗争的具体方法,这种不平等伤害了所有人, 尤其是少数族裔

Fighting pay inequality is also aligned with the mission and culture of Lyft, which is extraordinarily committed to fighting pay inequality. It administers a third-party pay equity audit every year, and this past year Lyft became a different kind of “unicorn” in Silicon Valley after no systemic pay gap was found. Precise salary information already exists on sites like paysa, levels, and blind, so details shared here are nothing new.

与薪酬不平等作斗争也符合Lyft的使命和文化,Lyft致力于消除薪酬不平等。 它每年都要进行第三方薪酬公平审计,在没有发现系统性薪酬差距的情况下, Lyft在去年成为硅谷的另一种“独角兽”。 精确的薪资信息已经存在于paysalevel盲人之类的网站上 ,因此此处共享的细节并不新鲜。

Finally, I'm grateful for the support of many on this journey, especially Lena Johnson, my job search coach and negotiation advisor, and Robin Kim, my technical mentor. Thank you!

最后,我感谢在此过程中得到许多人的支持,尤其是我的求职教练兼谈判顾问Lena Johnson和我的技术导师Robin Kim。 谢谢!

翻译自: https://www.freecodecamp.org/news/first-line-of-code-to-226k-job-offer-in-8-months/

怎么编写提醒人结账的短信息

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是一个简单的酒店管理程序的完整代码: Hotel.java ```java public class Hotel { private String hotelName; private String address; private String phoneNumber; public Hotel(String hotelName, String address, String phoneNumber) { this.hotelName = hotelName; this.address = address; this.phoneNumber = phoneNumber; } public String getHotelName() { return hotelName; } public void setHotelName(String hotelName) { this.hotelName = hotelName; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } } ``` Room.java ```java public class Room { private int roomNumber; private String roomType; private double price; private boolean isAvailable; public Room(int roomNumber, String roomType, double price) { this.roomNumber = roomNumber; this.roomType = roomType; this.price = price; this.isAvailable = true; } public int getRoomNumber() { return roomNumber; } public void setRoomNumber(int roomNumber) { this.roomNumber = roomNumber; } public String getRoomType() { return roomType; } public void setRoomType(String roomType) { this.roomType = roomType; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } public boolean isAvailable() { return isAvailable; } public void setAvailable(boolean available) { isAvailable = available; } } ``` Customer.java ```java public class Customer { private String name; private String phoneNumber; private int roomNumber; private double totalPrice; private Date checkInDate; private Date checkOutDate; public Customer(String name, String phoneNumber, int roomNumber, double totalPrice, Date checkInDate, Date checkOutDate) { this.name = name; this.phoneNumber = phoneNumber; this.roomNumber = roomNumber; this.totalPrice = totalPrice; this.checkInDate = checkInDate; this.checkOutDate = checkOutDate; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public int getRoomNumber() { return roomNumber; } public void setRoomNumber(int roomNumber) { this.roomNumber = roomNumber; } public double getTotalPrice() { return totalPrice; } public void setTotalPrice(double totalPrice) { this.totalPrice = totalPrice; } public Date getCheckInDate() { return checkInDate; } public void setCheckInDate(Date checkInDate) { this.checkInDate = checkInDate; } public Date getCheckOutDate() { return checkOutDate; } public void setCheckOutDate(Date checkOutDate) { this.checkOutDate = checkOutDate; } } ``` HotelManagementSystem.java ```java import java.util.ArrayList; import java.util.List; public class HotelManagementSystem { private Hotel hotel; private List<Room> rooms; public HotelManagementSystem(Hotel hotel) { this.hotel = hotel; this.rooms = new ArrayList<>(); } public void addRoom(Room room) { rooms.add(room); } public void removeRoom(int roomNumber) { for (Room room : rooms) { if (room.getRoomNumber() == roomNumber) { rooms.remove(room); return; } } } public Room getRoom(int roomNumber) { for (Room room : rooms) { if (room.getRoomNumber() == roomNumber) { return room; } } return null; } public List<Room> getAvailableRooms() { List<Room> availableRooms = new ArrayList<>(); for (Room room : rooms) { if (room.isAvailable()) { availableRooms.add(room); } } return availableRooms; } } ``` BookingSystem.java ```java import java.util.ArrayList; import java.util.Date; import java.util.List; public class BookingSystem { private List<Customer> customers; public BookingSystem() { this.customers = new ArrayList<>(); } public void bookRoom(Customer customer) { customer.getRoom().setAvailable(false); customers.add(customer); } public void cancelBooking(Customer customer) { customer.getRoom().setAvailable(true); customers.remove(customer); } public double checkOut(Customer customer) { double totalPrice = customer.getTotalPrice(); customers.remove(customer); return totalPrice; } } ``` Main.java ```java import java.util.Date; import java.util.List; import java.util.Scanner; public class Main { private static HotelManagementSystem hotelManagementSystem; private static BookingSystem bookingSystem; public static void main(String[] args) { Hotel hotel = new Hotel("ABC Hotel", "123 Main St", "555-1234"); hotelManagementSystem = new HotelManagementSystem(hotel); bookingSystem = new BookingSystem(); Room room1 = new Room(101, "Single", 80); Room room2 = new Room(102, "Single", 80); Room room3 = new Room(103, "Double", 120); hotelManagementSystem.addRoom(room1); hotelManagementSystem.addRoom(room2); hotelManagementSystem.addRoom(room3); Scanner scanner = new Scanner(System.in); int choice = 0; do { System.out.println("1. View available rooms"); System.out.println("2. Book a room"); System.out.println("3. Cancel booking"); System.out.println("4. Check out"); System.out.println("5. Exit"); System.out.print("Enter your choice: "); choice = scanner.nextInt(); switch (choice) { case 1: viewAvailableRooms(); break; case 2: bookRoom(); break; case 3: cancelBooking(); break; case 4: checkOut(); break; case 5: System.out.println("Goodbye!"); break; default: System.out.println("Invalid choice, please try again."); break; } } while (choice != 5); } private static void viewAvailableRooms() { List<Room> rooms = hotelManagementSystem.getAvailableRooms(); if (rooms.size() == 0) { System.out.println("No rooms available."); } else { System.out.println("Available rooms:"); for (Room room : rooms) { System.out.println("Room " + room.getRoomNumber() + " - " + room.getRoomType() + " - $" + room.getPrice() + " per night"); } } } private static void bookRoom() { Scanner scanner = new Scanner(System.in); System.out.print("Enter your name: "); String name = scanner.nextLine(); System.out.print("Enter your phone number: "); String phoneNumber = scanner.nextLine(); System.out.println("Available rooms:"); List<Room> rooms = hotelManagementSystem.getAvailableRooms(); for (Room room : rooms) { System.out.println("Room " + room.getRoomNumber() + " - " + room.getRoomType() + " - $" + room.getPrice() + " per night"); } System.out.print("Enter the room number you want to book: "); int roomNumber = scanner.nextInt(); Room room = hotelManagementSystem.getRoom(roomNumber); System.out.print("Enter the check-in date (MM/dd/yyyy): "); String checkInDateStr = scanner.next(); Date checkInDate = parseDate(checkInDateStr); System.out.print("Enter the check-out date (MM/dd/yyyy): "); String checkOutDateStr = scanner.next(); Date checkOutDate = parseDate(checkOutDateStr); double totalPrice = room.getPrice() * calculateDaysBetweenDates(checkInDate, checkOutDate); Customer customer = new Customer(name, phoneNumber, roomNumber, totalPrice, checkInDate, checkOutDate); customer.setRoom(room); bookingSystem.bookRoom(customer); System.out.println("Booking confirmed. Total price: $" + totalPrice); } private static void cancelBooking() { Scanner scanner = new Scanner(System.in); System.out.print("Enter your name: "); String name = scanner.nextLine(); System.out.print("Enter your phone number: "); String phoneNumber = scanner.nextLine(); for (Customer customer : bookingSystem.getCustomers()) { if (customer.getName().equals(name) && customer.getPhoneNumber().equals(phoneNumber)) { bookingSystem.cancelBooking(customer); System.out.println("Booking cancelled."); return; } } System.out.println("Booking not found."); } private static void checkOut() { Scanner scanner = new Scanner(System.in); System.out.print("Enter your name: "); String name = scanner.nextLine(); System.out.print("Enter your phone number: "); String phoneNumber = scanner.nextLine(); for (Customer customer : bookingSystem.getCustomers()) { if (customer.getName().equals(name) && customer.getPhoneNumber().equals(phoneNumber)) { double totalPrice = bookingSystem.checkOut(customer); System.out.println("Thank you for staying with us. Total price: $" + totalPrice); return; } } System.out.println("Booking not found."); } private static Date parseDate(String dateStr) { try { return new SimpleDateFormat("MM/dd/yyyy").parse(dateStr); } catch (ParseException e) { return null; } } private static int calculateDaysBetweenDates(Date startDate, Date endDate) { long diff = endDate.getTime() - startDate.getTime(); return (int) TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS); } } ``` 希望这个程序能够满足您的需求。如果您有任何疑问或需要进一步的帮助,请随时告诉我。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值