Spaces:
Paused
Paused
Update README.md
#2
by grasimus - opened
README.md
CHANGED
|
@@ -12,107 +12,62 @@ pinned: false
|
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
|
| 17 |
-
I built this dataset to solve a recurring problem I observed in data science and engineering education: the lack of realistic, challenging interview material for practice. Every interview is a performance, and to perform well, candidates need access to questions that reflect the actual hiring landscape across various industries and roles.
|
| 18 |
-
|
| 19 |
-
To create this material, I generated the entire dataset locally on my PC using an NVIDIA RTX 3080 GPU running Ollama. Running it locally gave me complete control over the generation pipeline without rate limits or data privacy concerns. I employed advanced prompt engineering techniques, including persona adoption, few-shot prompting, and strict JSON output formatting. I instructed the local language model to act as a senior talent acquisition specialist, dynamically injecting highly elaborated prompts with varying combinations of role, industry sector, interviewer persona, and difficulty tier. My goal was to guarantee that a Junior HR Specialist in Healthcare interviewed by a "Supportive" persona received a completely different and appropriate question compared to a Senior Data Scientist in Cybersecurity facing an "Aggressive" technical interviewer. The result is a structured, balanced question bank containing twenty thousand unique interview pairs.
|
| 20 |
-
|
| 21 |
-
## Dataset Structure
|
| 22 |
-
|
| 23 |
-
The dataset contains the following data structure:
|
| 24 |
-
|
| 25 |
-
| Column | Type | Description |
|
| 26 |
-
|---|---|---|
|
| 27 |
-
| `question` | string | The interview question generated by the LLM |
|
| 28 |
-
| `answer` | string | A model gold-standard answer |
|
| 29 |
-
| `keywords` | string | Domain-specific searchable keywords |
|
| 30 |
-
| `role` | string | Job title (e.g., Data Scientist, Software Engineer) |
|
| 31 |
-
| `sector` | string | Industry sector (e.g., Finance, Healthcare) |
|
| 32 |
-
| `interview_stage` | string | The type of interview round |
|
| 33 |
-
| `interviewer` | string | The persona/tone of the interviewer |
|
| 34 |
-
| `question_category` | string | Sub-category of the question (e.g., System Design) |
|
| 35 |
-
| `question_level` | string | Difficulty / Seniority Level |
|
| 36 |
-
|
| 37 |
-
After generating the data, I conducted a rigorous Exploratory Data Analysis to validate the quality and diversity of my synthetic dataset.
|
| 38 |
-
|
| 39 |
-
## Exploratory Data Analysis
|
| 40 |
-
|
| 41 |
-
### Categorical Distributions
|
| 42 |
-
|
| 43 |
-

|
| 44 |
-
|
| 45 |
-
I began by checking the categorical variables to ensure balance across the dataset. First, I looked at the difficulty distribution across different seniority levels and learned that the model successfully balanced Easy, Medium, and Hard questions across all seniority tiers. Hard questions were slightly rarer, which perfectly mirrors real-world hiring pipelines where challenging questions are reserved for specific technical deep-dives. I also analyzed the distribution of question categories against interview types and discovered that the dataset did not over-represent any single skill. The questions were broadly distributed across twenty different categories, providing comprehensive coverage. Lastly, I verified the industry sector coverage and found a near-uniform distribution across all fourteen targeted sectors. This was a critical lesson: a dataset skewed entirely toward technology companies would be useless for a candidate applying to a hospital or a bank. My data remains truly industry-agnostic.
|
| 46 |
-
|
| 47 |
-
### Text Length Analysis
|
| 48 |
-
|
| 49 |
-

|
| 50 |
-
|
| 51 |
-
I also needed to ensure the text itself felt natural, so I examined the text length distributions. I observed that the generated questions were concise and direct, while the answers provided enough depth to demonstrate expertise without turning into massive walls of text.
|
| 52 |
-
|
| 53 |
-
### Keyword Presence
|
| 54 |
-
|
| 55 |
-

|
| 56 |
-
|
| 57 |
-
To understand the technical vocabulary that dominated the dataset, I visualized the keyword presence. I observed that the language model successfully injected specific, relevant technical terms into the questions, avoiding overly generic fluff. This confirmed that the prompt engineering effectively anchored the questions in realistic technical scenarios.
|
| 58 |
-
|
| 59 |
-
### Near Duplicate Detection
|
| 60 |
-
|
| 61 |
-

|
| 62 |
-
|
| 63 |
-
A common pitfall with synthetic data is repetitive generation. To test for this, I implemented a near-duplicate detection script using TF-IDF cosine similarity. I was thrilled to see that almost all pairwise similarities were close to zero. There were absolutely no pairs crossing the high similarity thresholds, giving me mathematical proof that my dataset was clean and unique.
|
| 64 |
-
|
| 65 |
-
### Role Keyword Alignment
|
| 66 |
|
| 67 |
-
|
| 68 |
|
| 69 |
-
|
|
|
|
|
|
|
| 70 |
|
| 71 |
-
|
| 72 |
|
| 73 |
-

|
| 104 |
|
| 105 |
-
|
|
|
|
|
|
|
| 106 |
|
| 107 |

|
| 108 |
|
| 109 |
-
**
|
| 110 |
-
|
| 111 |
-
1. **Behavioral & HR:** Culture Fit, Soft Skills, and
|
| 112 |
-
2. **Core Engineering:** Coding, System Design, and
|
| 113 |
-
3. **Operational
|
| 114 |
|
| 115 |
-
|
| 116 |
|
| 117 |
---
|
| 118 |
|
|
@@ -125,5 +80,3 @@ The application utilizes a Vector-Based Retrieval strategy to recommend the most
|
|
| 125 |
3. **Query Embedding:** The input query is passed through the selected `e5-small-v2` model, converting it into a 384-dimensional query vector.
|
| 126 |
4. **Vector Similarity Search:** The system computes the **Cosine Similarity** between the user's query vector and the pre-computed question embeddings database.
|
| 127 |
5. **Retrieval:** The system identifies the vector with the highest similarity score (argmax) and retrieves the exact matching interview scenario.
|
| 128 |
-
|
| 129 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
+
## 3. Embedding Model Selection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
To power the retrieval engine, I evaluated three open-source, 384-dimensional sentence-embedding models from Hugging Face: `all-MiniLM-L6-v2`, `BAAI/bge-small-en-v1.5`, and `intfloat/e5-small-v2`. The evaluation ran on a random sample of 2,500 questions and measured three things:
|
| 18 |
|
| 19 |
+
1. **Encoding speed** β how long it takes to embed the sample.
|
| 20 |
+
2. **Semantic separability** β Silhouette Score (cosine) of the embedding space against the 16 true question categories.
|
| 21 |
+
3. **Retrieval quality** β Precision@1, Precision@5, and Mean Reciprocal Rank (MRR), where a retrieved question counts as relevant if it belongs to the same category as the query.
|
| 22 |
|
| 23 |
+
One implementation detail worth noting: `e5-small-v2` is an asymmetric retrieval model and requires a `query: ` prefix on queries and a `passage: ` prefix on documents β without them its performance collapses. These prefixes were applied throughout the evaluation and the application.
|
| 24 |
|
| 25 |
+

|
| 26 |
|
| 27 |
+

|
| 28 |
|
| 29 |
+
**Observations:**
|
| 30 |
|
| 31 |
+
* **Speed:** `all-MiniLM-L6-v2` was by far the fastest (~28s for 2,500 questions), while `e5-small-v2` was the slowest (~84s, roughly 3Γ longer).
|
| 32 |
+
* **Semantic separability:** all three silhouette scores were slightly negative β expected, since interview categories share a great deal of vocabulary and overlap heavily in meaning β but `e5-small-v2` scored best (β0.033), ahead of `bge-small-en-v1.5` (β0.040) and `all-MiniLM-L6-v2` (β0.046).
|
| 33 |
+
* **Retrieval:** `e5-small-v2` won on all three metrics: Precision@1 = 0.18, Precision@5 = 0.16, MRR = 0.30. Interestingly, `all-MiniLM-L6-v2` came second (P@1 = 0.16, MRR = 0.28) and `bge-small-en-v1.5` last (P@1 = 0.15, MRR = 0.26), so raw model size was not the deciding factor. For context, these are strict proxy metrics β a match counts only if the retrieved question shares the exact category β and with 16 categories a random ranker would score P@1 β 0.06, so the winner performs roughly 3Γ better than chance.
|
| 34 |
|
| 35 |
+
**Conclusion:** `intfloat/e5-small-v2` won both quality evaluations (separability and retrieval), so despite being the slowest of the three, it was selected as the core embedding model. All 20,444 questions were then encoded with the `passage: ` prefix, L2-normalized, and saved as an `.npy` vector store that the application loads at startup.
|
| 36 |
|
| 37 |
+
---
|
|
|
|
| 38 |
|
| 39 |
+
## 4. Embeddings Analysis & Clustering
|
| 40 |
|
| 41 |
+
To validate that the chosen model organizes the interview domain in a meaningful way, the embedding space was analyzed with three complementary techniques: K-Means clustering with the Elbow Method, t-SNE projection, and hierarchical clustering.
|
| 42 |
|
| 43 |
+
### K-Means & the Elbow Method
|
| 44 |
|
| 45 |
+

|
| 46 |
|
| 47 |
+
For each of the three candidate models, K-Means was fitted for K = 2 to 15 and the inertia (sum of squared distances) was plotted. The curves decline smoothly without a sharp elbow β another sign that interview questions form a continuum rather than isolated islands β but the bend suggested a different natural granularity per model: **K = 10** for MiniLM, **K = 8** for BGE, and **K = 6** for E5. Each model was then re-clustered at its own optimal K and projected to 2D (TruncatedSVD) for visual comparison:
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+

|
| 51 |
|
| 52 |
+
The E5 map shows the cleanest macro-structure: even at the smallest K, its clusters occupy distinct, coherent regions of the projection instead of interleaving.
|
| 53 |
|
| 54 |
+
### t-SNE Projection (True Categories)
|
|
|
|
| 55 |
|
| 56 |

|
| 57 |
|
| 58 |
+
To check how well each embedding space respects the *true* labels, the five most frequent question categories were projected with t-SNE (a non-linear method better suited to deep embeddings than PCA) and colored by their real category. As expected from the silhouette analysis, the categories are not linearly separable in any of the three spaces β interview questions genuinely blend topics (a "Coding & Problem Solving" question in FinTech shares vocabulary with "Tools & Frameworks"). However, clear **local neighborhood structure** is visible, and it is strongest in the E5 panel (right): "Prioritization Under Pressure" concentrates into a dense central region and "Tools & Frameworks" forms distinct pockets. This local coherence is exactly what a nearest-neighbor retrieval engine relies on, and it is consistent with E5 winning the Precision/MRR comparison.
|
| 59 |
+
|
| 60 |
+
### Hierarchical Semantic Taxonomy
|
| 61 |
|
| 62 |

|
| 63 |
|
| 64 |
+
Finally, a mean (centroid) embedding was computed for each of the 16 question categories, L2-normalized, and clustered hierarchically using **Ward's linkage**. The category labels only define the 16 groups β the *relationships between them* are discovered purely from the geometry of the embedding space. The resulting dendrogram organizes the interview domain into three interpretable branches:
|
| 65 |
+
|
| 66 |
+
1. **Behavioral & HR:** "Culture Fit & Values", "Salary & Expectations", "Communication & Soft Skills", and "Business Impact & Metrics" merge together at low distance.
|
| 67 |
+
2. **Core Engineering:** "Coding & Problem Solving", "System Design & Architecture", "Scalability & Growth Planning", and "Innovation & Emerging Tech" form a distinct technical branch. Notably, "Motivation & Career Goals" attaches to this branch via "Tools & Frameworks" β the model apparently associates career-growth questions with technology-stack questions, a genuinely surprising discovery.
|
| 68 |
+
3. **Operational & Situational:** "Incident Response & Ownership", "Prioritization Under Pressure", "Collaboration & Cross-Team Work", and "Conflict Resolution" cluster together with "Debugging & Troubleshooting" and "Technical Roadmap & Strategy" β the "how do you act under real conditions" side of interviewing.
|
| 69 |
|
| 70 |
+
The fact that this taxonomy matches how humans intuitively divide interviews β HR vs. hard skills vs. situational behavior β without ever being told those relationships confirms that the retrieval system operates in a semantically structured vector space.
|
| 71 |
|
| 72 |
---
|
| 73 |
|
|
|
|
| 80 |
3. **Query Embedding:** The input query is passed through the selected `e5-small-v2` model, converting it into a 384-dimensional query vector.
|
| 81 |
4. **Vector Similarity Search:** The system computes the **Cosine Similarity** between the user's query vector and the pre-computed question embeddings database.
|
| 82 |
5. **Retrieval:** The system identifies the vector with the highest similarity score (argmax) and retrieves the exact matching interview scenario.
|
|
|
|
|
|