Skip to content

mutaphore/prog-quest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Programming Interview Questions

Questions I studied to prepare for programming job interviews. Please feel free to create pull requests for any questions, contributions and issues!

Problems

  1. Array Pair Sum

  2. Matrix Region Sum

  3. Largest Continuous Sum

  4. Find Missing Element

  5. Linked List Remove Nodes

  6. Combine Two Strings

  7. Binary Search Tree Check

  8. Transform Word

  9. Convert Array

  10. Kth Largest Element in Array

  11. All Permutations of String

  12. Reverse Words in a String

  13. Median of Integer Stream

  14. Check Balanced Parentheses Given a string of opening and closing parentheses, check whether it’s balanced. We have 3 types of parentheses: round brackets: (), square brackets: [], and curly brackets: {}. Assume that the string doesn’t contain any other character than these, no spaces words or numbers. Just to remind, balanced parentheses require every opening parenthesis to be closed in the reverse order opened. For example ‘([])’ is balanced but ‘([)]‘ is not.

  15. First Non Repeated Character in String Find the first non-repeated (unique) character in a given string.

  16. Anagram Strings Given two strings, check if they’re anagrams or not. Two strings are anagrams if they are written using the same exact letters, ignoring space, punctuation and capitalization. Each letter should have the same count in both strings. For example, ‘Eleven plus two’ and ‘Twelve plus one’ are meaningful anagrams of each other.

  17. Search Unknown Length Array Given a sorted array of unknown length and a number to search for, return the index of the number in the array. Accessing an element out of bounds throws exception. If the number occurs multiple times, return the index of any occurrence. If it isn’t present, return -1.

  18. Find Even Occurring Element Given an integer array, one element occurs even number of times and all others have odd occurrences. Find the element with even occurrences.

  19. Find Next Palindrome Number Given a number, find the next smallest palindrome larger than the number. For example if the number is 125, next smallest palindrome is 131.

  20. Tree Level Order Print Given a binary tree of integers, print it in level order. The output will contain space between the numbers in the same level, and new line between different levels.

  21. Tree Reverse Level Order Print This is very similar to the previous post level order print. We again print the tree in level order, but now starting from bottom level to the root.

  22. Find Odd Occurring Element Given an integer array, one element occurs odd number of times and all others have even occurrences. Find the element with odd occurrences.

  23. Find Word Positions in Text Given a text file and a word, find the positions that the word occurs in the file. We’ll be asked to find the positions of many words in the same file.

  24. Find Next Higher Number With Same Digits Given a number, find the next higher number using only the digits in the given number. For example if the given number is 1234, next higher number with same digits is 1243.

  25. Remove Duplicate Characters in String Remove duplicate characters in a given string keeping only the first occurrences. For example, if the input is ‘tree traversal’ the output will be ‘tre avsl’.

  26. Trim Binary Search Tree Given the root of a binary search tree and 2 numbers min and max, trim the tree such that all the numbers in the new tree are between min and max (inclusive). The resulting tree should still be a valid binary search tree.

  27. Squareroot of a Number Find the squareroot of a given number rounded down to the nearest integer, without using the sqrt function. For example, squareroot of a number between [9, 15] should return 3, and [16, 24] should be 4.

  28. Longest Compound Word

  29. Where is Easter Bunny HQ?

  30. Dictionary anagrams

  31. Compute parity

  32. First missing integer

Problem sources

About

Programming interview questions and solutions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages