TechInterviewPro Flashcards

1
Q

What does this course provide?

A

Tips and tricks to pass the technical interview

Coding, system design, algorithms, behavioral interview, negotiation

Step by step process to switch into full fledge tech career

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is this process?

A

Something that can be learned.

You have to have mindset that this can be practiced

You need to practice for it

It’s a game that can be learned

Could land $200k (6 figures) out of college!

You want to play and win at this game!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Who are the authors?

A

Joma - earning $300k/year working in tech, ex-Facebook engineer, interned at Microsoft, LinkedInn

Patrick (TechLead) - ex-Google tech lead, runs own company, multi-millionaire, app developer, worked at top Silicon Valley firms, at Google conducted 100+ interviews including phone, onsite (coding, data structures, system design, algorithms, behavior)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the end result?

A

You get a job in tech in Silicon Valley

“We don’t believe in shortcuts to success, but if there is a shortcut this is absolutely it. We have helped multiple friends and family land jobs in tech, and are proud to be able to extend our help to you too now. This will still require a lot of work and effort on your part; we can show you the way, but you need to be the one to walk it. You will get more out of this program the more you put yourself into it. These are real, true & tried tips – you can trust in them.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the various stages in the interview process?

A
  1. Homework (coding practice) - features to build, coding problems to solve

2. Phone interview - 25% pass to onsite, initial screening

3. onsite - 10% pass to recieve offers, whiteboard challenge, interviews

  1. offer - often time senstive, leverage and negotation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Who is actually making the decision to bring you on-site or hire you?

A

Not the interviewer.

All the interviewer is doing is recording information.

Creating a file on you.

Code is copied into a report.

Hiring manager will look at scores of candidate, decide to bring in for a role that may or may not match

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why shouldn’t you be disheartened if you don’t get the role you’re applying for?

A

Maybe there just isn’t enough headcount for the role

Example:

limited OS engineer spots

maybe more Android engineer spots

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the first axis to interviewing?

A

Can write clean high quality code?

naming (methods, Classes, variables)

OOP (interfaces, design patterns, abstraction, encapsulation)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the second axis to interviewing?

A

Do you understand data structures and algorithms?

Can you solve problems using appropriate data structures and algorithms?

provide big-o analysis of algorithms

algorithms (search, sort, string manipulation)

linear data structure (arrays, hashmaps, linked lists, queues, stacks)

non linear data structures (trees, heaps, tries, graphs, AVLtrees)

Big O analysis, reverse linked list, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the third axis to interviewing?

A

System Design

Can you design a system and provide analysis (tradeoffs, time complexities)?

System Design is a big one and shows your analysis skills.

Time-space analysis & alternative approaches.

You must show your ability to analyze a solution, regardless of whether you get it right or not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the fourth axis to interviewing?

A

Communication

talk fluidly

technical clarity of communication

explain complicated idea in middle ground

Software Engineering is a team sport, and the ability to communicate clearly and friendly is essential.

The keyword here is “clear.”

In this field it is too easy to start overloading on jargon in an effort to “impress.”

Be human in your conversations, as if you’re talking to your mom.

Just because the interviewer works in “tech,” doesn’t mean they have any clue what you’re talking about (nor does it mean they’re necessarily smart or knowledgeable about your field).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the fifth axis?

A

Speed matters!

What took years to understand is that efficiency is important.

This is about your time management.

Abstract away edge cases, avoid chit chat

solve the problem efficiently

This theme will be re-iterated, but proper time management is the key to success.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What should we focus on during the take-home project?

A

Writing clean, production quality code

They want to see quality of code

Does this look like good clean, production quality code?

Example:

Netflix gave TechLead a weekend long assignment, Yelp gave TechLead a feature to design

Joma got link to coding excercises (1 hour to solve coding problems)

Advice:

Treat this as part of your job, take it seriously.

Allocate proper time and quiet space.

Do the work.

look up information on internet, use resources

Demonstrate clean production quality code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is advice for the phone interview?

A

They can be challenging.

Be prepared with a computer, good phone reception, good headphones, good internet

Speak confidently, project relaxed sense of self, talk freely, be in a social mood

Show you have some competency and could possibly pass an on-site interview

Maybe typing actual code

Real engineer sometimes

They have a few key questions to see how far you can get

Don’t skip steps

Talk about Big-O, ask clarifying questions, solve problem

If you seem competent, they’ll bring you onsite

domain specific questions - OS related or ML engineer related

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the two types of phone screens?

A

1 - Recruiter trying to smoke you.

Asking behavioral questions.

What you’re looking for? Do you fit role? Seem pleasant?

List of yes/no software engineering questions given by an engineer.

Just have to answer them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What should we be prepared with for our phone interview (screen)?

A

Be prepared with:

a computer (w/ good internet)

good phone reception (w/ good headphones)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What type of questions do interviewers ask on phone screening?

A

Niche, domain specific questions

Advice?

Know your tech stack, role applying or domain well

Look up the top questions related to your tech stack, language or role

Top questions for JavaScript

Top questions for React or Node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What questions should you be prepared to answer on the phone-screen?

A

Prepare for common questions:

Why do you want to work here?

What projects have you done?

What is your visa status?

Why did you leave your last job?

What are you looking for?

Do you want full-time or part-time?

What type of role do you want?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are key tips for the phone interview?

A

Know your Resume - Do not under-estimate the phone-screen. While sometimes it is conducted by a non-technical recruiter, at companies like Google it is conducted by the same engineers who may be conducting the on-sites (and while expectations are lower, they may still ask the same tough questions as an on-site!). Be sure to be able to impress quickly.

One big piece of advice here is to show confidence. Many candidates aren’t prepared, can’t talk smoothly, are stuttering or too shy. Especially on the phone, it is hard to gauge whether the candidate is even still there or listening, or whether they’re shy & quivering. Let your enthusiasm show!

Keep time-management in-mind. Phone interviews generally have a time limit, so keep the chit-chat minimal (unless it’s with a recruiter). This is still an interview, where time-management is essential.

Pick 1-2 projects that you’ll be able to explain strongly. The more current, the better. If they ask “So how are you, what have you been up to? Tell me where you’re at now…“ Prepare an answer for this.

Research the Company - Even though you are early in your job hunt, to the interviewer they don’t feel that this is early at all. So, you need to be as prepared as if you were going in to the on-site. Research the company and know the role well.

Prepare for smoke screens - Depending on your chosen field, prepare for smoke-screen questions. These are often quick “yes/no” type of questions on common tricks. In Javascript, it would be questions like “What is a closure?” while in iOS it is “What is a memory cycle?” or “How is a block different from a delegate?”

Prepare for common questions

Why do you want to work here?

What projects have you done?

What is your visa status?

Why did you leave your last job?

What are you looking for?

Do you want full-time or part-time?

What type of role do you want?

Be near a computer - Usually you will need to code on a site like coderpad.io. Familiarize yourself with this.

Audio - Have your phone ready for to use in speaker mode. Even better, plug in some earphones. Usually, the earphones that come with a phone have a better microphone and will let you use the phone hands-free. The earphones can also help if the interviewer has a thick accent, which they occasionally do. You’ll want to make the best of any situation. Set aside a quiet time & location that you can take the call seriously.

Stay enthusiastic - I know that sometimes you can feel down about your job hunt. No matter what, stay enthusiastic. This is all part of “playing the game.” Let a bit of humor show. Most candidates are scared stiff, since the phone-screen weeds out probably 90% of people. Think of it from the perspective of the interviewer – “Oh, great, another candidate who is super nervous to get a call from . Probably unqualified…” So, show a bit of humor, suave & confidence so they don’t bucket you into that group.

Take notes - During the phone screen, you’ll be able to take notes. It’s great to keep notes on the interviewer’s name & role, so you can later ask questions about their position. I like to keep a pen and notepad handy.

Speak clearly and concisely - Since the interviewer can’t see you, pay extra attention to speaking fluidly.

You only need to show potential - Don’t sweat it if you can’t ace everything. Usually for the phone-screen, expectations are lower and if you can show you have potential, that may be sufficient. Focus on demonstrating your analytical ability (as well as a cordial personality) - there is more leeway here on your code not looking its greatest over the phone.

About looking up answers - I’ve heard stories about some candidates who will “secretly” be typing up the answer to a phone quiz, while stalling for time. Interviewers can sometimes hear your keyboard clacking away… If you don’t know, it may be better to just sayI think I’ve heard about this one a while ago, but I can’t recall right now… This is an area I’m really eager to learn more about though, most recently I’ve been putting more time into learning about X.” Remember, the goal is not to evaluate whether you know the answer to some pop quiz question– it is to evaluate whether you are good at learning, whether you are able to work with the team.

Preparation is the key to success. The phone interview is one that catches a lot of people off-guard since it is so early in the process, but if you just invest in over-preparing a bit here, you will already be well-ahead of other candidates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

OS What is the onsite-process?

A

Bring you in on a weekday (they work on weekdays)

Bring you for the whole day 9am - 5pm

at least 5 x interviews, one hour each

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What should we be prepared to talk about during the onsite, phone screen, etc.?

A

2-3 technical projects you can talk about concisely.

Identify key points you’ve done (not what your team did).

Big-O analysis

alternative versions

thought process, rational, details of system design

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What are some tips for preparing for an on-site interview?

A

Prepare a strong response to “So, tell me about yourself. What brings you here?”

  • Have a cordial, concise, and friendly self-introduction that piques curiosity. Avoid arrogance! Many interviewers will dive straight into a coding problem – this is OK, but if you can pique their curiosity enough to have them ask you more about some project you’ve done, you will start off stronger.

2-3 technical projects you can talk about concisely. Identify key points you’ve done (not what your team did).

  • some interesting stories you can talk about that show technical challenge.
  • alternative versions analysis
  • time and space complexity analysis
  • system design thinking on your project
  • component design on your project (database schema, scaleability, reliability)

Be prepared to talk about the top 2-3 points on your resume. Re-arrange your resume a bit if you need to, or add projects to them so you can point to them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How many interviews do you have in one day?

A

Typical 4-6 interviews

One interview is lunch interview (sometimes evaluated)

A mix of topics:

Junior Level:

large coding focus (coding brainteasers, designing algorithms, datastructure)

Senior Level:

Systems design, behavioral (leadership, communication)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

OS What are the coding questions interviews?

A

designed by the engineer - not passed by a recruitor or a standard question bank

Engineer thinks it might be interesting, throws a question at you.

Typically, 45 minutes.

15 minutes introduction

10-15 minutes solve question - time space analysis, be on your game, time management is key

10 minutes - followup problems (at least two)

5 minutes - wrap up

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What are the types of things discussed in the 10-15 minute part of one of the coding interview?

A

What projects they’ve done?

How deep can you talk about the projects technically?

Time space analysis details of your project?

Alternative versions of your projects?

How deeply they can go into each project?

What their interest level is?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What matters a lot?

A

the first 5 minutes and last 5 minutes matter. A lot!

These are your first & last impressions. Everyone says they’re “passionate about coding,” but if you can show that passion by explaining about a project you’ve done that will be ideal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What kind of questions do interviewers tend to ask?

A

Whatever they want -

There’s no “indoctrination” of interviewers, people just ask whatever they want.

People are free to ask whatever they want, although many people will tend to just ask some standard question that they’ve heard about before.

they develop 2-3 questions, and just repeatedly ask those over and over again.

key is to show how you solve it and dig deeper into the problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

How do you want to come off in your onsite interview?

A

as someone who is collaborative, eager to learn, and humble

Key traits:

  • Eager to learn
  • friendly and collaborative
  • technically curious
  • able to learn from mistakes
  • willing to accept feedback and improve oneself
  • get-it-done attitude
  • results-oriented
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

OS What should you think about during the onsite interview?

A

type of role you are applying for

There are many different types of engineers, who work with different technologies, depending on varying organization size

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What type of people do startups tend to want?

A

People who can hit the ground running, already having some experience in technologies like Javascript, web development, iOS, Android, etc.,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What will larger tech companies prefer about you?

A

Larger tech companies may prefer that you learn their proprietary tech stacks.

Must demonstrate willingness, eagerness to learn!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What are the key questions to master for the behavioral interview?

A
  1. A situation where there was a challenging failure and how you recovered from that through learning (learning from failure).
  2. How you were able to accept feedback and change behavior based on that (accept feedback).
  3. Technical curiousity, enthusiasm and drive to learn (learning curiosity).
  4. How do you deal with people you can’t agree with and how to build consensus. (conflict management)
  5. A project you are proud of or some recent work (technically interesting project).
  6. Why do you want to work at this company? Make it person to you, specific company mission. (What is your motivation)
  7. Take on personal projects, show to work on initiative (Initiative and leadership)
  8. How were you able to tackle a situation with no clear answer? How did you tackle the ambiguity and bring direction to the scenario? (Tackling ambiguous situations)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What is a complete narrative in the behavioral interview?

A

Start, Challenge

Next, what you did as an individual (action)

Finally, what is the result of the action (result)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What is the key to success?

A

Preparation

well rested, stories clear and concise, coding interview

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What is STAR acryonym stand for?

A

Situation, task, action, result

Use this to prepare stories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What does it mean to “show” don’t tell on the behavioral interview?

A

It means give real, concrete stories people can dig into!

give sufficient detail

don’t handwave this!

Prepare before hand and hit key points!

Conflict resolution, building consensus, taking feedback

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

What is a highly valued trait everybody is looking for?

A

The ability to take feedback

To improve because of feedback

Most people to jerks, arrogant, don’t admit to shortcoming!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What is the second key trait for the behavioral interview?

A

The ability to recover from failure.

Many times you’ll build something you got it wrong.

Conflict, things didn’t go your way.

A system crash, how did you recover?

How can you learn from the failure and prevent it?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

Tell me about a time where you failed?

A

Come up with a few stories.

Will dig more.

What were your motives.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What is the third key trait for the behavior interview?

A

The ability to gain consensus.

Teams disagreeing on things such as prioritization.

How did you build consensus?

What was the process for gaining consensus?

Getting people together.

Leading a discussion.

Document where people could voice opinions.

Stearing people toward a direction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

What do we want to make sure we have for preparation in the behavioral interview?

A

That we have good stories, good actions, good results

That match the company philosphy (culture).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

What is a key trait for junior engineers to demonstrate in the behavioral interview?

A

Eagerness to learn.

Junior engineer’s immediate priority is to learn quickly

vs.

cross team leadership, etc.

Pretend you care and be curious!

Show your curiousity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

What will it be like to work with you?

A

Hiring managers want to know!

Go into an interview collaboratively.

Smile, lean forward, positive energy.

Build rapport.

Feel like you belong there.

You can hangout there.

They can treat you as a normal employee.

Get them to like you, treat you like a friend.

Don’t need people to teach you, look out for you.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

When does the interview begin?

A

With a first impression.

Get them to like you, treat you like a friend.

Smile, lean forward, positive energy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

Can you learn?

A

The ability to learn is essential

Can you learn from mistakes, failures

Facebook, Netflix, Amazon, Google - using proprietary tech stack, learn quickly.

Struggle a little bit, work through together, accept feedback.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

What is at fault with a failure?

A

A process or system, not the employee

find ways to fix the process or system.

learn from failure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

Do you take initiative?

A

Do something out of your own curiosity, initiative, interest!

Junior and Senior engineers must have this!

Show initiative through:

side projects, open source contributions, pet projects, new programming languages learned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

G What is a top tip for your interview?

A

Time management

Make sure you are on track, cut chit chat, save time

give you time to talk of projects, get through white boarding questions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

How should you end your interview?

A

End on a good note

Ask a good final question

First and Last impressions matter!

The way you talk, dress sends first impression

Good questions:

What new technology is the company exploring?

What is the hot new technology?

What are your thoughts on design patterns?

What other recent developments?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

How should you act during the interview?

A

Confident

You are an expert at your craft

You are expected to have competency

collaborative, fairly confident tone

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

What is a time management trick during the coding interview?

A

Abstract away the edge cases

Abstract away code to manage your time

How fast can you do it, solving the problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

What should you prepare?

A

A strong introduction (30 seconds about you)

Discuss:

Talk about recent work, summarize who you are

Most people read resume first time in front of you!

They didn’t study about you prior to meeting you.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

What should you always bring to each interview?

A

Bring your own marker pen and copy of resume!

Don’t rely on them for a marker.

54
Q

T What is the key component for transitioning into software engineering?

A

Highlight your strengths

Create projects related to software engineering to show you are transitioning into software engineering

55
Q

What are a few ways to transition into software engineering from less technical backgrounds?

A

12 week intensive bootcamps!

HackReactor

Google summer hackathons

Structure, proper tech stack, forced to put together a final project.

Lots of people from bootcamps that end up doing nothing.

It depends on instructor, cohort, it’s variable.

It’s all about how hard you work and how well you can pass interviews.

56
Q

What is self learning?

A

get on the right stack (proper technology)!

Setup some pet projects.

Ruby on rails, python, Java, JQuery (odd combination, not in demand)

57
Q

T How to build up your resume for transitioning into software engineering?

A
58
Q

How can we show our strengths in software engineering when transitioning from other fields?

A

Bring your unique background to a project

Example:

If you are an english major, do a project on natural language processing.

If you are a BioMolecular engineer, do a project on DNA analysis, etc.

59
Q

What do you want to show when transitioning into software engineering?

A

Show enthusiasm for coding

Pet projects are very important

Pet projects convince interviewer that you are serious

Validates why you want to switch

60
Q

What is unique about applying for startups?

A

You can exemplify your ability to perform multiple roles

Can handle DB maintenence, handle project management, customer support emails

61
Q

How do you guide your career into a FANG company?

A

Maybe start with less salary

get some project experience

guide career into FANG company

62
Q

What is the best approach for studying to take a technical interview?

A

Study a bit everyday vs. cramming before the interview

It’s a good idea to keep practicing even after getting a job

Keep the skills sharp!

Churning out of companies can help bump salary

63
Q

Where should we focus when preparing for technical interviews?

A

Where you are weak

Example:

Not knowing python syntax (want real code) make it runable cannot do only pseudo-code

Learn python, get syntax correct

DS and Algorithms - understand space/time complexity, how answer is gotten, understand every line of code, remember it, etc.

64
Q

How to stay motivated when preparing for coding interviews?

A

Build a habit.

Force self in first few weeks, then becomes habit

It’s hard at first, then it becomes fun

becomes like a brain teaser

65
Q

What should you do a few days before the on-site interview?

A

Take a few days off work

Grind hard for 12 hours a day

Studying algorithms

Solving problems

learning about the company

preparing stories

66
Q

How to get on-site interviews?

A

Reach out to recruiters or friends in the company for referrals

67
Q

What do you have to have before an on-site interview?

A

A good night sleep

Get in a positive mood (affirmations)

Get confidence up, perform better!

Super important

You’ll perform much better

68
Q

Why are you switching into software engineering?

A

Get a good narrative

Had technical background, interested in other field, got into these other thing, realized missed building/coding things

like craft of coding, have pet projects to support this claim!

69
Q

SD What is a system design interview?

A

Covers construction of an entire system (end-to-end)

senior engineer level

How do you design Twitter?

What does database look like?

What do web services look like?

How do you scale this?

What does read/write API look like?

Junior engineers

How to make it multi-threaded?

What if you had multiple cores?

How to optimize for memory?

How to optimize for time, space?

70
Q

What is the first type of system design interview question?

A

Wholistic system design (constructing a whole system)

design bitly

design Twitter

design Tinder

How do you design a distributed file system?

What kind of database (SQL vs. noSQL)?

How is the database setup?

How to do a fetch, write?

What if you have need to shard data (many users)?

How do you shard? What are tradeoffs?

What is the key you balance it on?

OS, networks, database scaling

How do you design web API?

Class with key values

is there privacy / security?

error checking?

no bugs?

71
Q

What is the second type of system design interview question?

A

Give you constraints

How do you design around constraints

What is in memory?

What is in hard disk?

72
Q

What else do you need to know for a system design interview question?

A

How to do calculations (back of envelope)

500 ms request

file 8 bytes meta data

16 bytes character string

how big is a letter? (1 byte)

string size? (256 bytes)

integers? (4 bytes)

boolean? (1 bit)

73
Q

What do the questions in a system design interview depend on?

A

The type of role you’re applying for

OS engineer?

Web scale-ability engineer?

android engineer?

UI engineer?

OS system design interview is different than web-scale-ability engineer and android engineer

74
Q

What are all system design questions?

A

Open ended

allows you to show your strengths

show your strengths - API designs, database sharding

How broad can you go?

How deep can you go in your specialization?

75
Q

What is the first step for system design?

A

Understanding the goal for the system

define: use cases, constraints, assumptions

What needs to be prioritized?

(speed, reliability, availability)

How many files will there be?

How many people are reading from the system?

How many people are writing to the system?

What does the load look like?

What is response time constraint?

What about data consistency?

Can have stale cache data or up to date data at all times?

Do you need value back right away or read comes later on from a stale cache?

Who are the customers using this?

How many people are using the service?

76
Q

What is the second step to system design interviews?

A

high level design

What are the inputs/outputs of the system?

What components do you need?

database, load balancer, web server, services (queue mechanism, notification services), overall system layout

77
Q

What is the third step in system designs?

A

Come up with the components

know the essential building blocks is key to A++ the system design interview

load balancing, caching, CDNs, databases + indexing, database sharding, SQL vs. NoSQL, API design

break things down

Is it reading from cache or direct database?

How to keep cache updated?

What happens if system goes down?

How to recover the cache if system goes down?

How to recover the cache in system failures?

78
Q

SD LB What does a single load balancer introduce?

A

A single point of failure in the application

Solution?

Two, Three load balancers

Website can resolve to different IP addresses, resolve to one of the load balancers, request can sent to server farm

79
Q

What is the fourth step to system design?

A

Scale-ability

How do you scale the system?

understand system and how scaling options affect system

Understand trade-offs (reliability, availability, security, maintainability)

Ex.

load balancer introduces single point of failure.

What happens to reliability, security or maintainability of the system?

what if this component is a bottleneck?

Will you scale horizontally or vertically?

How do you deal with running out of file space?

80
Q

What is a load balancer?

A

One of the key components in any web backend system

Implementation?

AWS Elastic, NGIX

What?

Balances the traffic load by distributing application traffic across multiple application servers

How?

Acts as a traffic cop

Efficiently distributing incoming network traffic across a group of backend servers, also known as a server farm or server pool

  • Distributes client requests or network load efficiently across multiple servers
  • Ensures high availability and reliability by sending requests only to servers that are online
  • Provides the flexibility to add or subtract servers as demand dictates

Why?

Improve reliability - if one server is down, can send traffic to another server

Modern high‑traffic websites must serve hundreds of thousands, if not millions, of concurrent requests from users or clients and return the correct text, images, video, or application data, all in a fast and reliable manner. To cost‑effectively scale to meet these high volumes, modern computing best practice generally requires adding more servers.

Addition?

Can include a cache, send back a request before it pings an application server (faster response)

81
Q

SD LB What is an alternative to load balancers?

A

Creating microservices

Instead of a single server to handle all service requests

dedicate one server per service type

Ex. chat server, website forum server, timeline feed service - application already load balancing, hitting many machines, distributing traffic to microservice servers

82
Q

What are the current load balancing solutions?

A

https://www.nginx.com/products/nginx/

best-in-class load‑balancing solutions used by high‑traffic websites such as Dropbox, Netflix, and Zynga.

Purchase on AWS marketplace

83
Q

What are the common load balancer algorithms?

A
  • Round Robin – Requests are distributed across the group of servers sequentially.
  • Least Connections – A new request is sent to the server with the fewest current connections to clients. The relative computing capacity of each server is factored into determining which one has the least connections.
  • IP Hash – The IP address of the client is used to determine which server receives the request.
84
Q

What is a cache server?

A

The best way to reduce the load on your database

This is a server

Comes up in system design interviews all the time!

Before you hit the database, you hit the cache server, if value is present client reads cache data without pinging database

after hitting the database, cache server can store data requests (complex queries / joins) for future requests

reduce latency

Could be a distributed cache over multiple machines!

85
Q

SD CQ What are the pros and cons of various cache validation mechanisms?

A

Write-through cache - database is up to date, valuable data not lost, database write is slow due to cache layer

First in first out - first item in is first out

Least recently used

Most recently used

86
Q

How can you do caching validation to ensure correct data is in the cache?

A

When user changes settings, remove cache value

store meta deta in cache according to timestamp

key hashed to users privacy settings at a date or time

87
Q

What are system softwares for implementing distributed cache servers?

A

very distributed, extremely scaleable

Memcache - free, open source (used by dynamic applications to eleviate database load)

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

Apache Cassandra is a free and open-source, distributed, wide column store, NoSQL database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure

88
Q

What don’t you want to store in the cache server?

A

Highly valueable user data

It can be lost at any time

used for caching - redundent request

gotten from source of truth, then stored in cache

This memory is not persistent

89
Q

SD CQ What problem does a cache server solve for a database server?

A

What?

Provides distributed, very fast read and write into quickly

Problem?

A single database under high stress introduces a single point of failure, very fragile

How?

Can take a lot of load off the database

store previous complex queries for future

90
Q

CQ How do you ensure cache is up to date?

A

cache and validation mechanisms

cache full (round robin, last used, custom string in entry)

can have chron background job perging useless cache data

91
Q

What is an example of using a cache server to read/write data rather than direct hits the database?

A

Example:

You want to count number of visits to website

each time you increment some value, ties up single database, very slow

lots of writes, caching later, highly optimized as key value store

92
Q

What is a write-through cache?

A

cache will automatically propogate changes into the database

write to database is slow because have to write through cache

93
Q

When do we use CDNs?

A

When we have video, audio or image-heavy assets that need to reach users quickly!

CDN’s can help scale.

94
Q

What are CDN services?

A

AWS Cloudfront (Amazon Web Service CDN)

Softlayer (IBM cloud)

95
Q

What is the impact of a CDN?

A

Web server will run faster!

Your server only handles client requests!

Not serving large image assets!

After heavy images and videos offloaded server performance increases!

96
Q

What is a Content Delivery Network (CDN)?

A

A distributed network of servers that host your static files

What?

Images, videos, audio files

HTML, CSS

Why?

Fast access to large asset files in any part of the world

As if locally stored in a region

Who?

Most media-heavy website use CDNs

97
Q

How does a CDN work?

A

URL resolves to an IP address that is geographically close to the user!

Mechanism?

pool

  • store a cache of assets from your server in the region for future queries (easy to maintain)
  • slower first queries

push

  • upload set of files that get pushed to CDNs
  • the first lookup is fast (pro)
  • have to manually upload files, must maintain repository (con)
98
Q

What is a database?

A

Store data in persistent disk

Has a database server with an API to retrieve data

Query data, put data in, get data back

Database has an algorithm to retrieve data back

use SQL queries (delete, join tables, query range data)

99
Q

What is a common system designs interview question?

A

Design a schema for a database:

relational vs. non-relational database

What are all the tables you have?

What are fields in user table?

What are IDs / links that connect tables?

100
Q

What should you think of first when designing a database that scales?

A

Algorithm for retrieving data quickly

Indexes - binary search trees based on the field

Every table should have unique ID

101
Q

What is an index?

A

A binary search tree based on ID (primary key) or name

Can do a binary search to identify in O (log n)

Can have multiple indexes (name, date) double index table

Adds space complexity (binary search trees)

Can increase insert time (have to update indexes)

102
Q

What are some of the issues with indexing in databases?

A

It adds space complexity - have to build binary search trees for each index

Slows down inserts - everytime you insert have to update binary search tree (log n operation!)

103
Q

How should you represent various items in a database?

A

ID to uniquely identify it

represent location w/ longitude and latitude

represent date/time using date (integer)

represent userID using 64-bit integer (scaleable)

104
Q

SD DBI What don’t you want to store in the database?

A

don’t store too heavy data

move heavy data (descriptions, large data) out of database insert into file system, CDN or separate table

Ex. if use uploads photo of pet

it’s possible to store image in binary format in table

but it boggs down table, makes database slower to query

105
Q

What is the slowest processes in a database?

A

Joins

You want to optimize joins using indexes (binary trees)

identify joins in log n time!

index on name of person

index pet person by ID

join on ID can find which pets, he owns fast!

106
Q

What are some tips for designing the database schema?

A

Every table should have an ID field that represents row uniquely (ID to uniquely identify)

Move large data (picture files) into separate file system or separate table (not slow query times)

location = longitude / latitude

date = integer (timestamp)

userID = 64 bit integer (scaleability)

107
Q

If you’re a junior engineer what types of questions come up often?

A

Designing a database schema

entries joining with other entries

unique IDs on tables

Indexies on fields (fast queries)

108
Q

What is horizontal scaling?

A

adding more machines to the system (compute power)

doesn’t work with a single database

How does it affect fault tolerance, availability, reliability, efficiency, simplicity (keep in mind)?

109
Q

What is a good question to ask when designing a table?

A

What types of queries am I going to be making on this table?

110
Q

SD RR What are techniques for scaling database?

A

Redundency and replication!

Why?

Usually one database as source of truth

cannot throw a load balancer with many different databases!

Usually just one table

111
Q

What is replication?

A

A very popular way to scale database!

mention in the system design interview!

Modes:

Master-master replication

master-slave replication

112
Q

What is master-slave database relationship?

A

Have one master database - write into

hundred+ slave databases - read out only, no writes, never write into, replicates master (slight latency)

When?

Read-heavy application, don’t write often

Ex. Youtube

upload once in a while, 99% of people reading data!

Can have scale slave databases, scale this way for reads!

113
Q

What is master-master database relationships?

A

Mutliple databases replicating eachother acting as master

soon as you write into one database, replicates into other datbases

Can write into either database, can read from

each can have muliple slaves

issues?

more complex to visualize

slow writes to database (bottlenecks)

trying to replicate into database, could be down

have load performance issues

Alternative?

Use sharding over this method

114
Q

What is another pro of master-slave database relationships?

A

a slave can back up the master database

115
Q

What is the use case for database sharding?

A

A write heavy application

Ex. Twitter

people sending tweets every second

Why?

Master-slave solve read heavy applications

write-heavy applications not solved w/ master-master relationship, can’t have hundreds of DBs replicating eachother!

116
Q

What are the two forms of database partitioning?

A

Sharding (horitzontal partitioning) - balance rows between databases (half ppl in database A, half in database B)

vertifcal partitioning - separating tables out - move table to different machine, one table is on it’s own machine, join according to userID with another table on a different machine

117
Q

What don’t you want to jump to right away?

A

database sharding

Why?

the sharding mechanisms can be tricky (chosing where to right data, read data)

Alternatives?

in-memory cache like memcache can scale out your reads

118
Q

What is sharding?

A

different databases represent portions of a single table

distributing a single table across multiple databases

every database contains a fraction of the data (table)

119
Q

What are some of the pro’s and con’s of SQL databases vs. NoSQL databases?

A

SQL pros

  1. Data is structured - can do range queries, has guarantees about data

SQL cons

1.

NoSQL Cons -

  1. Data isn’t structured - key-value dictionary data isn’t structured, range queries are not possible, have to do queries based on key-values
  2. Not really consistent - can take time for data to persist to disc, writes don’t take right away, write delays, race conditions, data integrity lost.

NoSQL Pros -

  1. Distributed - distributed across many machines, scaleable across machines, can pump tons of writes into them
  2. Scaleable - can handle intense data load
  3. MongoDB persists to disk
  4. Graph database - good for graphs
120
Q

What is a good negotiation strategy?

A

Try to get as many offers as you can at once

bring offers to others until you get same range for all

121
Q

When is it hard to negotiate?

A

When you don’t have leverage

Competing offers is leverage

122
Q

What is negotiation really about?

A

Leverage

competing offers, counteroffers from current employer

123
Q

What is a mistake new grads make with offers?

A

Being happy to receive one and NOT negotiating!

Just starting, salary will be lower.

Use leverage with competing offers

124
Q

What should you remember?

A

optimize for the long term

position yourself well 10 years in the future

125
Q

What is one of the effective ways to boost your income?

A

Jumping jobs

You have power with an income the competing company must match or beat, potential counter offers

126
Q

What are other things to ask when negotiating?

A

Sign on bonus

Move start date

127
Q

What are some of the tactics recruiters use?

A

exploding offers

not revealing offer unless you’re willing to accept it right away

delays in interview process at different companies

(1-2 months Google vs. 1 week Startup)

128
Q

Is my coding clean?

A

Check the Google Style guides:

https://google.github.io/styleguide/

129
Q

What are the four components to an offer?

A

Salary (yearly)

Sign on bonus (paid first year, paid end of year)

Equity (stocks)

Performance Bonus (15% extra salary)

130
Q

SD IOS/Android

A