# prabhakar0tenn/leetcode-companywise-interview-questions architecture

> Architecture diagram of the GitHub repository prabhakar0tenn/leetcode-companywise-interview-questions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prabhakar0tenn/leetcode-companywise-interview-questions
- Repository: https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions

## Overview

1. This repository is a **data archive plus scraper utility**, not an application server. The primary artifact is a large collection of committed CSV files, grouped by company name and by interview-question recency.

2. The **core dataset layer** lives at the repository root: one directory per company such as `amazon/`, `google/`, `uber/`, etc. Each directory contains one or more CSV snapshots like `all.csv`, `thirty-days.csv`, `three-months.csv`, `six-months.csv`, and `more-than-six-months.csv`.

3. The CSVs are the main output boundary of the system. The README says each row includes fields such as **Difficulty, Acceptance %, and Frequency %**, which makes the repository suitable for filtering, sorting, and spreadsheet-based analysis rather than runtime querying.

4. The dataset is **time-sliced by recency**. Not every company has every slice, but the organization consistently encodes a question’s age bucket. The repo README describes the intended categories as last 30 days, 3 months, 6 months, 1 year, and all; the file tree shows the actual stored buckets as the above CSV variants.

5. The **generation pipeline** is the Java code under `src/main/java/`. `Scraper.java` is the main automation entry point described in the README. It is responsible for logging into LeetCode Premium and extracting the companywise question data into CSV files.

6. The scraper is built around **Selenium**, and the README notes it opens in **Microsoft Edge** by default. That means browser automation is a material part of the architecture: the data source is an external web UI, not an API or database export.

7. `Main.java` is likely the launch wrapper for the scraper, while `model/ProblemStatement.java` represents the structured row model used during extraction and CSV serialization. The architecture therefore has a simple flow: scrape HTML/UI content, map it into a model, then write CSV artifacts.

8. `pom.xml` indicates the project is managed as a **Maven Java project**, so the code boundary is small and tool-driven. The runtime dependency surface is mainly Selenium plus whatever CSV/model libraries are declared in the build.

9. There is a clear separation between **source code** and **checked-in generated data**. The CSV directories are the persistent repository output, while `src/` is the regeneration tooling. The README explicitly instructs contributors to delete existing folders before regenerating to avoid conflicts.

10. The repository functions as an **offline reference dataset** for engineers solving interview prep problems. Its primary consumers are humans using CSV editors or scripts to analyze the snapshots; there is no service API, database, or UI layer in the repo itself.

11. Operationally, the scraper is a **manual batch job**: log in, scrape company pages, wait for completion, and commit the refreshed CSVs. The README warns that the process can take hours and may need timeout tuning, which implies long-running browser navigation and page reloads.

12. For an architecture diagram, the important boundaries are: **LeetCode Premium source UI → Selenium-based Java scraper → per-company CSV snapshots in the repo → spreadsheet/analysis usage by consumers**. The repository is essentially a snapshot catalog with a small automation toolchain to refresh it.

Main entry points: [`src/main/java/Scraper.java`](https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/src/main/java/Scraper.java) (Scraper), [`README.md`](https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/README.md) (README), [`src/main/java/model/ProblemStatement.java`](https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/src/main/java/model/ProblemStatement.java) (Problem row), [`src/main/java/Main.java`](https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/src/main/java/Main.java) (Main)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dataset["Dataset"]
  node_company_csvs[("Company folders<br/>dataset root")]
  node_all_slice["All time<br/>snapshot slice"]
  node_thirty_slice["30 days<br/>snapshot slice"]
  node_three_slice["3 months<br/>snapshot slice"]
  node_six_slice["6 months<br/>snapshot slice"]
  node_older_slice["Older than 6m<br/>snapshot slice"]
end

subgraph group_tooling["Tooling"]
  node_selenium["Selenium<br/>browser automation"]
  node_edge["Microsoft Edge<br/>browser runtime"]
  node_main_java["Main<br/>launcher<br/>[Main.java]"]
  node_scraper_java["Scraper<br/>scrape pipeline<br/>[Scraper.java]"]
  node_problem_model["Problem row<br/>row model"]
  node_pom["Maven build<br/>build config<br/>[pom.xml]"]
  node_readme["README<br/>usage guide<br/>[README.md]"]
end

subgraph group_external["External source"]
  node_leetcode_ui(("LeetCode Premium<br/>web source"))
end

subgraph group_consumers["Consumers"]
  node_analysis_users(("Analysis users<br/>human/script consumers"))
end

node_pom -->|"deps"| node_scraper_java
node_main_java -->|"starts"| node_scraper_java
node_scraper_java -->|"uses"| node_selenium
node_selenium -->|"drives"| node_edge
node_edge -->|"navigates"| node_leetcode_ui
node_scraper_java -->|"maps to"| node_problem_model
node_problem_model -->|"writes"| node_company_csvs
node_company_csvs -->|"contains"| node_all_slice
node_company_csvs -->|"contains"| node_thirty_slice
node_company_csvs -->|"contains"| node_three_slice
node_company_csvs -->|"contains"| node_six_slice
node_company_csvs -->|"contains"| node_older_slice
node_readme -->|"documents"| node_scraper_java
node_readme -->|"describes"| node_company_csvs
node_company_csvs -->|"consumed by"| node_analysis_users
node_readme -->|"guides"| node_analysis_users

click node_main_java "https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/src/main/java/Main.java"
click node_scraper_java "https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/src/main/java/Scraper.java"
click node_problem_model "https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/src/main/java/model/ProblemStatement.java"
click node_pom "https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/pom.xml"
click node_readme "https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_company_csvs,node_all_slice,node_thirty_slice,node_three_slice,node_six_slice,node_older_slice toneBlue
class node_selenium,node_edge,node_main_java,node_scraper_java,node_problem_model,node_pom,node_readme toneAmber
class node_leetcode_ui toneMint
class node_analysis_users toneRose
```

## Components

### Dataset

Checked-in company CSV snapshots organized by recency bucket.

- **Company folders**: dataset root · One directory per company containing committed CSV snapshots.
- **All time**: snapshot slice · Full historical CSV snapshot for each company.
- **30 days**: snapshot slice · Recent-activity CSV bucket for questions from the last month.
- **3 months**: snapshot slice · Recent-activity CSV bucket for questions from the last three months.
- **6 months**: snapshot slice · Recent-activity CSV bucket for questions from the last six months.
- **Older than 6m**: snapshot slice · Longer-horizon CSV bucket for questions older than six months.

### Tooling

Java/Maven scraper used to regenerate the archive.

- **Selenium**: browser automation · Automation layer used to drive Edge and extract page content.
- **Microsoft Edge**: browser runtime · Default browser used by the scraper during login and navigation.
- [Main](https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/src/main/java/Main.java): launcher · Java entry point that starts the scraping job. · `src/main/java/Main.java`
- [Scraper](https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/src/main/java/Scraper.java): scrape pipeline · Coordinates login, traversal, extraction, and CSV generation. · `src/main/java/Scraper.java`
- [Problem row](https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/src/main/java/model/ProblemStatement.java): row model · Structured in-memory representation of a scraped problem statement. · `src/main/java/model/ProblemStatement.java`
- [Maven build](https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/pom.xml): build config · Project build and dependency management for the Java scraper. · `pom.xml`
- [README](https://github.com/prabhakar0tenn/leetcode-companywise-interview-questions/blob/master/README.md): usage guide · Describes scraping workflow, data fields, and regeneration instructions. · `README.md`

### External source

LeetCode Premium web UI scraped by browser automation.

- **LeetCode Premium**: web source · External question source accessed through the browser UI.

### Consumers

Human and script-based analysis of the CSV outputs.

- **Analysis users**: human/script consumers · Engineers using spreadsheets or scripts to filter, sort, and study the archive.

## Connections

- Maven build → Scraper: deps · Build declares the scraper dependencies.
- Main → Scraper: starts · Launch wrapper invokes the scraper workflow.
- Scraper → Selenium: uses · Scraper relies on Selenium for browser automation.
- Selenium → Microsoft Edge: drives · Automation runs in Microsoft Edge by default.
- Microsoft Edge → LeetCode Premium: navigates · Browser session logs in and visits company pages.
- Scraper → Problem row: maps to · Extracted page data is normalized into row objects.
- Problem row → Company folders: writes · Modeled rows are serialized into per-company CSV snapshots.
- Company folders → All time: contains · Repository stores an all-time snapshot per company.
- Company folders → 30 days: contains · Some companies include a 30-day slice.
- Company folders → 3 months: contains · Some companies include a 3-month slice.
- Company folders → 6 months: contains · Some companies include a 6-month slice.
- Company folders → Older than 6m: contains · Most company folders include the older-than-six-months snapshot.
- README → Scraper: documents · README explains how to run and tune the scraper.
- README → Company folders: describes · README frames the CSV archive as the primary output.
- Company folders → Analysis users: consumed by · Humans and scripts inspect the CSVs offline.
- README → Analysis users: guides · README positions the repo as an analysis-oriented archive.
