Module 02 of 12

Arrays & Strings

Lessons

About This Module

Arrays are the simplest data structure and the one most others are built on. An array stores its elements side by side in memory, which is why reading any element by index is instant, and also why inserting or deleting in the middle means shifting everything after it. Strings behave like arrays of characters, with one extra twist: in many languages they are immutable, so a careless loop of concatenations quietly becomes slow.

This module starts with how arrays are laid out and used, then looks at dynamic arrays: the lists and vectors you use every day, and how they grow by allocating a bigger block and copying. You will see why an append is cheap on average even though a resize is expensive, which connects straight back to the complexity ideas from Module 01.

The second half is about technique. Strings get their own lesson, and the last lesson covers two pointers and the sliding window, two patterns that turn many brute force O(n²) answers into a single pass. Watch the lessons in order, then continue on to Linked Lists.

Lessons

4 videos
01

Introduction & Declaration of Arrays

Abdul Bari introduces arrays as one of the most fundamental data structures: what an array is, how it is declared, and how its elements sit in memory.

02

Design a Dynamic Array (Resizable Array)

A walkthrough of building a dynamic array class from scratch, including what happens when the array fills up and has to resize. The best way to see why appends are cheap on average.

03

String Full Course for Technical Interviews

Starts with what strings are, their basic operations and the time complexity of each, then works through 15 common interview questions such as anagrams, longest common prefix and longest substring problems.

04

Learn Two Pointers and Sliding Window

A GeeksforGeeks session with Abhinav Awasthi on the two pointers and sliding window techniques, aimed at interview and competitive programming problems on arrays and strings.