Technical Interview Problems in Python: Lists
Lesson 1 of 1
  1. 1

    Lists are a fundamental data type in Python. Projects make extensive use of lists to store data in sequential order. You should expect at least one technical interview question that requires wo…

  2. 2

    For our first problem, we would like to “rotate” a list, or move elements forward in a list by a number of spaces, […] . Elements at the greatest index will “wrap around” to the beginning o…

  3. 3

    Optimizing a solution means reducing the memory required (space complexity), or reducing the number of instructions the computer must execute (time complexity). Sometimes this means entirely reth…

  4. 4

    We’ll continue our theme of list rotation by flipping the problem: given a sorted list rotated […] times, return the index where the “unrotated” list would begin. […] **Clarifying Que…

  5. 5

    Our last problem had a sorted dataset as the input. Sure, it was rotated, but it started out sorted. A sorted list gives us ways to leverage that ordering. After all, someone went through a lo…

  6. 6

    Duplicate values? Who needs them! Given a list of values with duplicates, return a list holding the same values in the same order with all duplicates removed. […] This is a great problem…

  7. 7

    For the last problem our suggested solutions had […] time and/or […] space complexity. We can’t improve the time complexity. We have to visit each value to determine whether or not it is a…

  8. 8

    Our next problem calculates sums within a list. Given a list of integers, return the maximum sum possible from a contiguous sub-list. A sub-list is an uninterrupted portion of the list (up to…

  9. 9

    Our last solution had a cubic time complexity: […] . One iteration for the length of the list […] , inside another iteration for the length of the list […] , inside the inner loop, we…

  10. 10

    We’ll end with a classic interview question: given a list of integers and a “target” integer, return a pair of indices whose values sum to the target. […] Clarifying Questions: * A…

  11. 11

    We’ll explore a common trade-off: time vs. space. Our previous solution used nested […] loops to iterate through each element in the list and then iterate again for each element in the lis…

  12. 12

    Lists are a fundamental data structure for any program. When faced with a technical interview problem using lists, here are a few strategies to keep in mind: * Be comfortable with variables which …

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo