The Dark Side of Negative Reinforcement

What is far less obvious is a simultaneous process that occurs automatically, yet remains “hidden in the shadows,” which is that at the precise moment that we experience relief, we strengthen the…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How To Prepare for Technical Interview at Facebook

The highlight was seeing a live demonstration of their Technical Interview process in which a presenter/developer whiteboarded a solution in front of a 100+ person audience. In an actual 5–6 hour Facebook interview, roughly half the time will be spent completing coding challenges. As a result, it was emphasized that candidates use the time to put their best foot forward.

At Facebook, candidates are given approximately 45 minutes to solve each coding question. Given the time constraint, they suggest making an impression by asking the right questions, then proceeding to implement a brute force approach before optimizing your design. Solving challenges using specific API’s or language features are also accepted, as long as you’re able to explain in detail how they perform. To demonstrate, let’s revisit a code challenge on creating an algorithm to detect unique characters in a String. The signature is as follows:

As with most code, there are many possible approaches. In the article, I review how it can be solved by applying a brute force approach, then proceed to optimize the code so that it runs in linear time — O(n) or better. What wasn’t discussed was solving it purely with native Swift API’s or language features. Interestingly, this seemingly concise solution also satisfies our requirement:

At first glance, the code looks fabulous, but is it indeed the best answer? More importantly, given the stress of a typical interview, would one have the ability to prove or disprove its efficiency? The lesson being — focus less on syntax and instead, work toward showcasing your knowledge by proving your approach.

Liked this essay? Read and discover my Swift Algorithms Book on Medium.

Add a comment

Related posts:

Why I transferred after my first year of college

Prior to entering Columbia College Chicago, I was determined to become a filmmaker by using my creativity to bring light on prevalent issues in society. In order to pursue this goal, I was required…

What are the types of events in event management?

Event management is the process of planning, coordinating, and executing events such as conferences, conventions, trade shows, and weddings. There are many different types of events that can be…

Have You Picked a Word for 2020?

She was working on my neck and shoulder muscles and needed me to give her the full weight of my head while I simply relaxed. It was my first massage in more than a decade, and I truly wanted to…