Skip to content

tombetthauser/google-interview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 

Repository files navigation

The Google Interview

A Starter List of Questions for General Practice

You don't have to be preparing for a FAANG interview to benefit from studying data structures and algorithms as if you were. Because of their size and popularity FAANG interview questions are extremely well documented and in many cases are intended to be publicly transparent. Because of this many other companies model their interview questions on those used by FAANG companies. And as is the case with most companies, the technical questions used by FAANG companies can be found for the most part on sites like Leetcode.

The following is a starter list for applicants preparing for Google interviews and can act as a good starter list for general technical interview preparation. Listed beneath the prompt descriptions are hints / reminders for optimal solutions that are in many cases difficult or nearly impossible to discover within a reasonable time limit, and beneath these are links to the problems on leetcode and external links to walkthroughs in Python.

Remember, in the world of Leetcode, sometimes "Easy" isn't easy and "Hard" isn't hard and if there isn't a hint listed for a problem yet check the Leetcode discussion section and / or youtube until you can make sense of it and find your own path!


Two Sum

Topic: Arrays | Leetcode: Easy 💚

Given an array of integers and a value, determine if there are any two integers in the array whose sum is equal to the given value.

leetcode | youtube

Hint: Use a hashmap to log the complements of each number.

Move Zeros to the Left

Topic: Arrays | Leetcode: Easy 💚

Move all zeros to the left of an array while maintaining its order.

Hint: Use a pointer / pointers. Watch out for order.

leetcode | youtube


Delete Node with Given Key

Topic: Linked Lists | Leetcode: Easy 💚

You are given the head of a linked list and a key. You have to delete the node that contains this given key. Harder version, you aren't given the head but just the node. Sit on that one.

leetcode | youtube (related not exact problem)

Hint: Dont create a new node.

Copy Linked List with Random Pointers

Topic: Linked Lists | Leetcode: Medium 🧡

You are given a linked list where the node has two pointers. The first is the regular ‘next’ pointer. The second pointer is called ‘arbitrary_pointer’ and it can point to any node in the linked list.

Your job is to write code to make a deep copy of the given linked list. Here, deep copy means that any operations on the original list (inserting, modifying and removing) should not affect the copied list.

leetcode | youtube

Hint: Make a hashmap where the keys and values are node instances.

Mirror Binary Trees

Topic: Binary Trees | Leetcode: Easy 💚

Given the root node of a binary tree, swap the 'left' and 'right' children for each node.

leetcode | youtube

Hint: Recursion

Check if Two Binary Trees are Identical

Topic: Binary Trees | Leetcode: Easy 💚

Given the roots of two binary trees, determine if these trees are identical or not.

Hint: Make sure to keep track of your p's and q's. Recursion. And don't forget the elvis operator that isn't actually an elvis operator. Spicy!

leetcode | youtube


String Segmentation

Topic: Strings | Leetcode: Medium 🧡

leetcode | youtube

Given a dictionary of words and an input string tell whether the input string can be completely segmented into dictionary words.


Find all Palindrome Substrings

Topic: Strings | Leetcode: Medium 🧡

Given a string find all non-single letter substrings that are palindromes.

leetcode | youtube


Largest Sum Subarray

Topic: Dynamic Programming | Leetcode: Easy 💚

Given an array, find the contiguous subarray with the largest sum.

leetcode | youtube


Determine if the Number is Valid

Topic: Dynamic Programming | Leetcode: Hard 💔

Given an input string, determine if it makes a valid number or not. For simplicity, assume that white spaces are not present in the input.

leetcode | youtube


Print balanced brace combinations

Topic: Backtracking | Leetcode: Medium 🧡

Print all braces combinations for a given value 'N' so that they are balanced.

leetcode | youtube

Hint: Make a shared return array and count integers for opening and closing prenetheses count then recurse down to a base case related to the counts and n. Kinda remember it but might be missing something?

Minimum Spanning Tree

Topic: Graphs | Leetcode: Medium 🧡

Find the minimum spanning tree of a connected, undirected graph with weighted edges.

leetcode (multiples)

leetcode| youtube


Implement a LRU Cache

Topic: Design | Leetcode: Medium 🧡

Least Recently Used (LRU) is a common caching strategy. It defines the policy to evict elements from the cache to make room for new elements when the cache is full, meaning it discards the least recently used items first.

leetcode | youtube

Hint: Use a linked list representing a queue and a hashmap for looking up nodes.

Find the High and Low Index

Topic: Searching & Sorting | Leetcode: Medium 🧡

Given a sorted array of integers, return the low and high index of the given key. Return -1 if not found. The array length can be in the millions with many duplicates.

leetcode | youtube


Merge Overlapping Intervals

Topic: Searching & Sorting | Leetcode: Medium 🧡

You are given an array (list) of interval pairs as input where each interval has a start and end timestamp. The input array is sorted by starting timestamps. You are required to merge overlapping intervals and return output array (list).

leetcode | youtube

Hint: Use sort and a new return array.

About

A good starter list of general-practice coding problems taken from lists given to Google interviewers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published