Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save atsheehan/7026011 to your computer and use it in GitHub Desktop.
Save atsheehan/7026011 to your computer and use it in GitHub Desktop.

Tech Interview Questions

Linked List

Implement a linked list in Ruby

class Node
  def initialize(data)
    @data = data
  end

  attr_accessor :data, :next
end

Character Frequency

Given a string, print out frequency of use for each letter in the string.

Ex:

frequency('banana') # => { b: 1, a: 3, n: 2 }

Binary search

Given a ASC sorted list of numbers, determine

Factorial

Unique Character Check

Determine if all of the characters in a given string are unique.

Unique Word Count in Sentence

Given a sentence as a string, get the occurrence count of the words in the sentence. Make sure to normalize the data first. (Remove punctuation, be case insensitive)

Design the Schema for an Online Book Store

Schema should allow customer to order books through the online store.

Fibonacci

Palindrome

Write a method that determines whether or not a String is a palindrome.

Second highest number

Given an array of integers, find the second highest integer.

Fizz Buzz

Fizz buzz

Rules:

Print numbers 1..100

If number is divisible by 3, print "fizz" instead of number If number is divisible by 5, print "buzz" instead of number If number is divisible by 3 and 5, print "fizz buzz" instead of number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment