Skip to content

Files

Latest commit

f4290f7 · Aug 27, 2017

History

History
94 lines (58 loc) · 3.4 KB

InterviewQuestions.md

File metadata and controls

94 lines (58 loc) · 3.4 KB

Interview Questions to Practice

Yahoo!

Stock prices, when to buy and sell.

Stack Adapt

Shuffle a deck of cards

Yelp

Convert numbers to their english letter

Merge strings cat - catapault

Convert 2a -> aa

Given a matrix of 1s and 0s, find the largest square

Owe money circle

Given a list of time intervals, write a function that merge intervals that have overlaps.

Write a function that prints a big "X" with "*" giving the width as input.

Write a function that when called would return the next subsequent fibonacci number.

Write a structure that is a queue but maintains the minimum value in the queue.

Given a tree, find out if its a BST or not.

Given a list of words, group all the anagrams. Given a list of words, find the longest common prefix between them.

Implement binary arithmetic on strings in java.

Write a text wrapper function which takes a width in pixels and a String and returns a String with new lines inserted. (You are also given a function which takes a string and gives you a pixel width).

# List of tickets, in the form (origin, destination)

ORIGINAL_TICKETS = [ ('SFO', 'LAX'), ('LAX', 'JFK'), ('JFK', 'LHR'), ('LHR', 'CDG'), ('CDG', 'DXB'), ('DXB', 'HKG'), ('HKG', 'HAM'), ] Write a function which given the original origin, find the final destination. Then write a function that would find both the original origin and final destination with only access to that ticket list. Finally write a function that finds a missing ticket given the original origin and final destination.

Write a function to compare two strings and return true if they are anagrams.

Given a log file with format:

" 1,2,start 2,3,end 2,4, start """" where each tuple is a (job_id,time,option) where option is start or end, find a way to map concurrent processes to each other

Given a nested list of colors, print the most frequent color in the list of lists. If there is a tie, print out the color in alphabetical order.

Find the k-lowest elements of an unsorted array.

Write a function to find a hidden guess integer given a helper function that will check if guess is too low, too high, or correct.

Given two strings, merge them such that it ignores the overlap

Given a 2D array, Given a 2D array, where there are 0s and 1s (1 representing island) count how many islands are there, for example, [[0,1,1], [1,0,0], [0,1,0]] there are 3 islands there (because in the first row 2 of 1s are connected so they…

Given a 2D array, how do you print spirally?

Given an array of string with 300 elements, how do you pair each of them so that each individual can be paired with all the elements after a couple of repetitions.

When you click on yelp.com what happens?

Design a recommendations system.

Binary search and further modification.

Given a number and a list of numbers, write a program that gives the total number of times the numbers in the list sum to the given number. Numbers in the list can be repeated.

What is the number in the Unix command for SIGKILL?

Implement most recently used cache.

Given an iterator interface for one word, extend an iterator function for two words.

How does java GC work? Implement it.

Using random numbers to generate the value of pi and how will it work in a multi-computer environment.

Inner vs. outer join