Skip to content

Feat/enhance daily interview#892

Open
Abfa41 wants to merge 5 commits into
Sachinchaurasiya360:mainfrom
Abfa41:feat/enhance-daily-interview
Open

Feat/enhance daily interview#892
Abfa41 wants to merge 5 commits into
Sachinchaurasiya360:mainfrom
Abfa41:feat/enhance-daily-interview

Conversation

@Abfa41
Copy link
Copy Markdown
Collaborator

@Abfa41 Abfa41 commented Jun 1, 2026

Description

This PR significantly improves the Daily Interview Tip Widget by upgrading both the UI behavior and the question generation engine.

Major improvements include:

  • Introduced a multi-placeholder template engine supporting {concept}, {system}, {skill}, and {situation}
  • Fixed scalability issue where only {concept} was previously replaced
  • Enhanced question generator to support category-aware dynamic question creation
  • Added concept pools per category (DSA, Backend, Frontend, System Design, HR, Behavioral)
  • Improved randomness and question rotation logic for better variety
  • Refactored generator into a more scalable “question engine” approach
  • Improved focus-mode readiness for UI expansion
  • Ensured behavioral and HR templates now generate realistic interview scenarios instead of fallback values
  • Cleaned unused variables and improved generator structure
  • Added and Enhanced animations of the Card.

Related Issue

Fixes #884


Type of Change

  • Bug Fix
  • Feature
  • Enhancement
  • Documentation

Testing

Manually tested the widget in local development:

  • Verified question generation across all categories

  • Checked that placeholders are correctly replaced:

    • {concept}
    • {system}
    • {skill}
    • {situation}
  • Tested category switching and ensured no undefined values appear

  • Verified random question navigation does not repeat same question consecutively

  • Confirmed UI renders correctly for all categories

  • Tested expanded/collapsed answer section behavior

  • Ensured no runtime errors in console

Creativity / UX Improvements

Focus Mode Feature

A new Focus Mode has been introduced to enhance user concentration during interview practice.

When enabled:

  • Removes visual distractions like category tags and filter buttons
  • Simplifies the UI to display only the core question content
  • Enlarges the question text for better readability and emphasis

When disabled:

  • Full UI is restored including filters, categories, and difficulty indicators

This feature improves usability by allowing users to switch between:

  • Learning Mode (full context + hints)
  • Interview Mode (clean focus experience)

Screenshots

  • Before ( Leakage of number of questions, less animations, no filtering )
image
  • After ( More animations, Filtering, Introduced Focus Mode )
image image

Checklist

  • Code follows project guidelines
  • No new compile/type errors
  • Tested manually (category switching, navigation, expand/collapse)
  • No .env, credentials, or node_modules committed
  • Generator logic fully updated for scalability
  • Docs updated (if needed)
  • UI remains stable after refactor

Summary by CodeRabbit

  • New Features

    • Category filtering for interview types (DSA, Behavioral, System Design, Frontend, Backend, HR).
    • Focus mode for a distraction-free study view.
    • Randomized next-question navigation within the selected category.
  • Improvements

    • Expanded interview question library with more seeded content per category.
    • Enhanced animations for question transitions, answer expand/collapse, and staggered tips reveal.

@github-actions github-actions Bot added gssoc level:critical High-impact or critical changes quality:exceptional Exceptional implementation quality gssoc:approved Approved for GSSoC scoring labels Jun 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Hi @Abfa41, thanks for contributing to InternHack! 🎉

I have automatically:

  • 👤 Assigned this PR to you.
  • 🏷️ Applied the gssoc:approved label.

Our workflows will now analyze your changes to classify:

  • 📈 PR Difficulty: level:*
  • 🧩 PR Type: type:*
  • 🌟 PR Quality: quality:*

Tip

Ensure your PR description references the issue it resolves (e.g. Closes #123). This allows the bot to inherit any additional labels from that issue!

Happy coding! 🚀

@github-actions github-actions Bot added the type:feature New feature implementation label Jun 1, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Warning

Review limit reached

@Abfa41, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 9 minutes and 57 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f260df28-7b2d-4fd0-b9b1-1f627e6cee46

📥 Commits

Reviewing files that changed from the base of the PR and between 5e423a2 and 35c50f4.

📒 Files selected for processing (3)
  • client/src/module/student/applications/DailyInterviewTipWidget.tsx
  • client/src/module/student/applications/questions/interviewQuestions.ts
  • client/src/module/student/applications/questions/interviewTemplates.ts
📝 Walkthrough

Walkthrough

Adds template seed files and a generator exporting QUESTIONS, and refactors the Daily Interview Tip widget to consume QUESTIONS with category filtering, randomized per-category navigation, a focus mode toggle, and updated Framer Motion animations for question, answer, and tips.

Changes

Daily Interview Tip Widget and Question Bank

Layer / File(s) Summary
Interview templates (seed data)
client/src/module/student/applications/questions/interviewTemplates.ts
Six template objects (DSA, Behavioral, System, Frontend, Backend, HR) export question, answer, and tips arrays used as seeds for generation.
Question type and generation logic
client/src/module/student/applications/questions/interviewQuestions.ts
Exports Question interface, seed question arrays, fillTemplate and valuePool helpers, generate() to expand templates, and QUESTIONS combining generated items.
Widget state, filtering, and navigation
client/src/module/student/applications/DailyInterviewTipWidget.tsx (imports, state setup, nav logic)
Replaces daily-index logic with categoryFilter, filteredQuestions, currentIndex, and safeIndex; adds focusMode toggle; handleNav randomizes next index; useEffect re-randomizes on category change.
Widget UI, filter bar, and animations
client/src/module/student/applications/DailyInterviewTipWidget.tsx (UI, filter, answers)
Header updated (focus toggle, simplified navigation), animated filter bar with category buttons, question motion.p keyed by currentIndex, adjusted answer expand/collapse transitions, and tips list replaced by motion.ul/motion.li with staggered entrance animations.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement, level:intermediate, quality:clean, type:design

Suggested reviewers

  • Sachinchaurasiya360

Poem

🐰 I stitched templates, seeds, and motion bright,
Questions bloom each tap or category night—
Focus hides the chrome, tips tumble in sight,
Random next hops keep practice light,
Hop on, learn, and code with delight!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is overly vague and generic; 'Feat/enhance daily interview' lacks specificity about what was enhanced and doesn't clearly convey the main changes (template engine, focus mode, question generation). Use a more descriptive title such as 'feat: add multi-placeholder template engine and focus mode to Daily Interview Tip widget' to better communicate the primary changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is comprehensive and well-structured, covering objectives, testing, UX improvements, and includes screenshots; all key sections from the template are properly addressed.
Linked Issues check ✅ Passed The PR successfully addresses all requirements from issue #884: daily tip card with category/difficulty tags, expandable answer/tips, manual navigation, theme compliance, and responsive design.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the PR objectives; the widget refactor, template engine, focus mode, and animations all serve the core goal of enhancing the Daily Interview Tip feature.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Abfa41
Copy link
Copy Markdown
Collaborator Author

Abfa41 commented Jun 1, 2026

@Sachinchaurasiya360 broh, Please review my PR and if any changes are required, do let me know. Please do let me know your Opinion on Focus Mode as well.

@Abfa41 Abfa41 added the type:design UI/UX or design-related updates label Jun 1, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (5)
client/src/module/student/applications/questions/interviewTemplates.ts (1)

1-1: ⚡ Quick win

Remove unused import.

The Question type is imported but never used in this file. The templates are plain object literals with no type annotations.

🧹 Proposed fix
-import type { Question } from "./interviewQuestions";
-
 export const dsaTemplates = {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/module/student/applications/questions/interviewTemplates.ts` at
line 1, Remove the unused type import by deleting the import statement "import
type { Question } from \"./interviewQuestions\";" from interviewTemplates.ts;
the file only contains plain object literals (the template constants) and does
not reference the Question type, so removing this import will eliminate the
unused import warning.
client/src/module/student/applications/questions/interviewQuestions.ts (2)

10-16: ⚡ Quick win

Consider narrowing the category type.

The category field is currently typed as string, but the widget and generation logic use a fixed set of categories: "DSA" | "Frontend" | "Backend" | "System Design" | "HR" | "Behavioral". Using a union type would improve type safety and provide better autocomplete.

♻️ Proposed type refinement
+export type QuestionCategory = "DSA" | "Frontend" | "Backend" | "System Design" | "HR" | "Behavioral";
+
 export interface Question {
-  category: string;
+  category: QuestionCategory;
   difficulty: "Easy" | "Medium" | "Hard";
   question: string;
   answer: string;
   tips: string[];
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/module/student/applications/questions/interviewQuestions.ts`
around lines 10 - 16, The Question interface's category property is too
permissive as string; change its type to the explicit union "DSA" | "Frontend" |
"Backend" | "System Design" | "HR" | "Behavioral" to improve type safety and
autocomplete; update the Question interface declaration (category: ...) in
interviewQuestions.ts to that union and adjust any callers or generators that
construct Question objects (e.g., functions creating or validating categories)
to use the narrowed union values or cast/guard inputs accordingly.

116-116: ⚡ Quick win

Replace any type with proper template interface.

The templates parameter is typed as any, which bypasses type checking and hides potential structure mismatches with the imported template objects.

♻️ Proposed type definition

Define a template interface at the top of the file:

 } from "./interviewTemplates";
 
+interface QuestionTemplate {
+  question: string[];
+  answer: string[];
+  tips: string[][];
+}
+
 export interface Question {

Then update the function signature:

 function generate(
   base: Question[],
-  templates: any,
+  templates: QuestionTemplate,
   category: string,
   target = 30
 ): Question[] {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/module/student/applications/questions/interviewQuestions.ts` at
line 116, Replace the loose any on the templates parameter with a concrete
interface describing the expected template structure: add a Templates (or
InterviewTemplateMap) interface at the top of the file that defines keys and
value shapes used by this module (e.g., title, body, variables, language, etc.),
then update the function signature that currently accepts templates: any to use
that new Templates type; update any places that construct or pass templates to
conform to the interface and adjust call sites/types as needed to satisfy
TypeScript checks.
client/src/module/student/applications/DailyInterviewTipWidget.tsx (2)

93-100: ⚡ Quick win

Use the shared Button component for these new controls.

Both the focus toggle and the category filters are new buttons, but they bypass the shared variants/sizes/state handling in client/src/components/ui/button.tsx. Please compose the motion behavior around Button instead of introducing raw button styling here. As per coding guidelines, "Use the reusable Button component from client/src/components/ui/button.tsx for all new buttons; supports variants (primary, secondary, mono, ghost, danger), modes (button, icon, link), and sizes (sm, md, lg)".

Also applies to: 135-146

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/module/student/applications/DailyInterviewTipWidget.tsx` around
lines 93 - 100, The component uses a raw motion.button with inline classes for
the focus toggle (and similarly for the category filter buttons at 135-146)
which bypasses the shared Button component; replace motion.button with a
motion-wrapped shared Button component from client/src/components/ui/button.tsx
(e.g., import Button and use motion(Button)) so the controls use the centralized
variants/sizes/state handling, preserve the existing tap/hover animations via
whileTap/whileHover props on motion(Button), wire onClick to setFocusMode and
use the Button variant/size props (choose appropriate variant/size consistent
with the app) and ensure the label still reflects focusMode; do the same
refactor for the category filter buttons so they all use the shared Button API
instead of raw styling.

97-98: ⚡ Quick win

Replace the new arbitrary text-size utilities.

These changes add text-[10px] in several new spots. Please switch to the closest scale token instead of bracket sizing so the widget stays on the canonical Tailwind v4 typography scale. As per coding guidelines, "Do not use arbitrary bracket sizes like text-[17px], use standard scale classes instead".

Also applies to: 117-120, 138-143

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/module/student/applications/DailyInterviewTipWidget.tsx` around
lines 97 - 98, The component DailyInterviewTipWidget contains arbitrary bracket
sizing like text-[10px]; replace those with the closest Tailwind typography
token (e.g., text-xs) so the widget follows the canonical scale. Find the
className strings in DailyInterviewTipWidget.tsx (the occurrences at the shown
diff and the other instances mentioned) and swap text-[10px] for the nearest
scale class (suggest text-xs) across all occurrences, keeping the rest of the
utility classes unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/src/module/student/applications/DailyInterviewTipWidget.tsx`:
- Around line 28-32: The component replaced the deterministic daily selection
with Math.random and now randomizes on mount/useEffect and inside handleNav,
causing an initial flash and wrong navigation; restore a date-seeded
deterministic initial index by computing a stable seed-based index synchronously
in the useState initializer for currentIndex (derive seed from the current date
and any category/filter) using filteredQuestions.length, remove the randomizing
useEffect so the component renders the chosen question immediately, and change
handleNav to advance currentIndex by 1 (modulo filteredQuestions.length) rather
than picking a random index; keep the safeIndex/currentIndex logic so q =
filteredQuestions[safeIndex] still works when filters change.

In `@client/src/module/student/applications/questions/interviewQuestions.ts`:
- Around line 96-109: The valuePool object is missing entries for the
{challenge} and {scenario} placeholders used by behavioralTemplates and
hrTemplates; add two new keys (e.g., challenge and scenario) to valuePool with
appropriate string arrays (examples of real challenges and scenarios) so
template substitution works correctly, and ensure the keys match the exact
placeholder names used in behavioralTemplates and hrTemplates.
- Around line 133-138: The variables object currently assigns all placeholders
to the same cycling "value", causing wrong substitutions; update the assignment
so each key uses its own selection from the corresponding pool (e.g.,
conceptPool -> concept, systemPool -> system, skillPool -> skill, situationPool
-> situation) by sampling/advancing indices independently (ensure any index
variables or sampling functions used by createInterviewQuestion or its
surrounding scope are duplicated or separate for concept/system/skill/situation)
and then build const variables: Record<string,string> with those four
independently-chosen values so each placeholder is filled from its correct pool.

---

Nitpick comments:
In `@client/src/module/student/applications/DailyInterviewTipWidget.tsx`:
- Around line 93-100: The component uses a raw motion.button with inline classes
for the focus toggle (and similarly for the category filter buttons at 135-146)
which bypasses the shared Button component; replace motion.button with a
motion-wrapped shared Button component from client/src/components/ui/button.tsx
(e.g., import Button and use motion(Button)) so the controls use the centralized
variants/sizes/state handling, preserve the existing tap/hover animations via
whileTap/whileHover props on motion(Button), wire onClick to setFocusMode and
use the Button variant/size props (choose appropriate variant/size consistent
with the app) and ensure the label still reflects focusMode; do the same
refactor for the category filter buttons so they all use the shared Button API
instead of raw styling.
- Around line 97-98: The component DailyInterviewTipWidget contains arbitrary
bracket sizing like text-[10px]; replace those with the closest Tailwind
typography token (e.g., text-xs) so the widget follows the canonical scale. Find
the className strings in DailyInterviewTipWidget.tsx (the occurrences at the
shown diff and the other instances mentioned) and swap text-[10px] for the
nearest scale class (suggest text-xs) across all occurrences, keeping the rest
of the utility classes unchanged.

In `@client/src/module/student/applications/questions/interviewQuestions.ts`:
- Around line 10-16: The Question interface's category property is too
permissive as string; change its type to the explicit union "DSA" | "Frontend" |
"Backend" | "System Design" | "HR" | "Behavioral" to improve type safety and
autocomplete; update the Question interface declaration (category: ...) in
interviewQuestions.ts to that union and adjust any callers or generators that
construct Question objects (e.g., functions creating or validating categories)
to use the narrowed union values or cast/guard inputs accordingly.
- Line 116: Replace the loose any on the templates parameter with a concrete
interface describing the expected template structure: add a Templates (or
InterviewTemplateMap) interface at the top of the file that defines keys and
value shapes used by this module (e.g., title, body, variables, language, etc.),
then update the function signature that currently accepts templates: any to use
that new Templates type; update any places that construct or pass templates to
conform to the interface and adjust call sites/types as needed to satisfy
TypeScript checks.

In `@client/src/module/student/applications/questions/interviewTemplates.ts`:
- Line 1: Remove the unused type import by deleting the import statement "import
type { Question } from \"./interviewQuestions\";" from interviewTemplates.ts;
the file only contains plain object literals (the template constants) and does
not reference the Question type, so removing this import will eliminate the
unused import warning.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 26b7dc60-821b-4e31-9a0c-eba83ac901a4

📥 Commits

Reviewing files that changed from the base of the PR and between ee47a54 and 7e2ca90.

📒 Files selected for processing (3)
  • client/src/module/student/applications/DailyInterviewTipWidget.tsx
  • client/src/module/student/applications/questions/interviewQuestions.ts
  • client/src/module/student/applications/questions/interviewTemplates.ts

Comment on lines +28 to +32
const [currentIndex, setCurrentIndex] = useState(() =>0);
const [focusMode, setFocusMode] = useState(false);

const safeIndex = currentIndex >= filteredQuestions.length ? 0 : currentIndex;
const q = filteredQuestions[safeIndex];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Restore date-seeded selection and true next-step navigation.

This replaces the old daily-deterministic flow with Math.random(), so the widget no longer guarantees the same question for everyone on a given day. Because the random pick now happens in useEffect, the component also renders one question first and then immediately swaps to another on mount/category changes. handleNav has the same problem: it randomizes instead of actually moving to the next filtered question.

Suggested direction
+const getDailyIndex = (length: number, seed: string) => {
+  let hash = 0;
+  for (const char of seed) hash = (hash * 31 + char.charCodeAt(0)) >>> 0;
+  return hash % length;
+};

-const [currentIndex, setCurrentIndex] = useState(() =>0);
+const [currentIndex, setCurrentIndex] = useState(() =>
+  getDailyIndex(QUESTIONS.length, `${new Date().toISOString().slice(0, 10)}:All`)
+);

 const handleNav = () => {
   if (filteredQuestions.length === 0) return;
-
-  let next;
-
-  do {
-    next = Math.floor(Math.random() * filteredQuestions.length);
-  } while (next === currentIndex && filteredQuestions.length > 1);
-
-  setCurrentIndex(next);
+  setCurrentIndex((prev) => (prev + 1) % filteredQuestions.length);
   setExpanded(false);
 };

 useEffect(() => {
   if (filteredQuestions.length === 0) return;
-
-  setCurrentIndex(Math.floor(Math.random() * filteredQuestions.length));
+  setCurrentIndex(
+    getDailyIndex(
+      filteredQuestions.length,
+      `${new Date().toISOString().slice(0, 10)}:${categoryFilter}`
+    )
+  );
   setExpanded(false);
-}, [categoryFilter]);
+}, [categoryFilter, filteredQuestions.length]);

Also applies to: 44-62

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/module/student/applications/DailyInterviewTipWidget.tsx` around
lines 28 - 32, The component replaced the deterministic daily selection with
Math.random and now randomizes on mount/useEffect and inside handleNav, causing
an initial flash and wrong navigation; restore a date-seeded deterministic
initial index by computing a stable seed-based index synchronously in the
useState initializer for currentIndex (derive seed from the current date and any
category/filter) using filteredQuestions.length, remove the randomizing
useEffect so the component renders the chosen question immediately, and change
handleNav to advance currentIndex by 1 (modulo filteredQuestions.length) rather
than picking a random index; keep the safeIndex/currentIndex logic so q =
filteredQuestions[safeIndex] still works when filters change.

Comment thread client/src/module/student/applications/questions/interviewQuestions.ts Outdated
Copy link
Copy Markdown
Owner

@Sachinchaurasiya360 Sachinchaurasiya360 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — PR #892

The UI improvements (Focus Mode, enhanced animations) are genuinely good additions. However the question generation engine has critical correctness issues that produce broken output, and the overall content quality regresses significantly from the original.

Critical Issues — Unresolved Placeholders

The hrTemplates and behavioralTemplates contain placeholder names that are NOT in the valuePool:

hrTemplates uses {challenge} and {scenario}
behavioralTemplates uses {challenge}

The valuePool only defines: concept, system, skill, situation

These unfilled placeholders will render literally in the widget. A user would see a question reading: What motivates you during {challenge}? or How do you prioritize tasks in {scenario}? This is a broken user experience that ships immediately.

Critical Issue — Semantic Mismatch in Template Engine

All four placeholder types (concept, system, skill, situation) receive the same value:

const variables = {
concept: value,
system: value,
skill: value,
situation: value,
};

The value comes from cycling through the valuePool entries in order. That pool contains: array, stack, queue, graph, React, API (the concept pool), URL shortener, chat system, etc. (system pool), leadership, communication, etc. (skill pool), a tight deadline, a team conflict, etc. (situation pool).

Since all four get the same value, a behavioral template like Describe a situation where you showed {skill} will render as Describe a situation where you showed URL shortener or Tell me about a time you handled array — which is semantically nonsensical. This defeats the purpose of a multi-placeholder template engine.

Significant Quality Regression

The original widget had 15+ full interview-grade questions with 100-200 word answers and specific, actionable tips. The new base seed questions are stubs:

{ question: What is an array?, answer: A linear structure with contiguous memory., tips: [O(1) access, Fixed size] }

These are encyclopedia definitions, not interview answers. A student preparing for interviews needs context, trade-offs, and examples — not one-liners. The generated questions inherit this shallowness and the template answers are equally empty (It improves efficiency by reducing time complexity in operations.).

Code Quality Issues

Type safety: The generate() function signature uses templates: any, bypassing TypeScript type checking entirely. Define a proper interface for the template objects.

Missing EOF newline: Both new files are missing a trailing newline, which triggers linting warnings.

Unused import: interviewTemplates.ts imports type Question from interviewQuestions.ts but does not use it in any exported type.

What to do

Option A (recommended): Keep the UI improvements (Focus Mode, animations) and fix the template engine separately:

  • Either restore the original high-quality questions alongside the new ones
  • Or fix the placeholder mapping so each template type gets a value from its own semantic pool
  • Resolve all unresolved placeholder names before shipping

Option B: Separate the PR into two: (1) UI/animation improvements only (merge-ready), (2) template engine as a follow-up with correct implementation.

Label correction

level:critical is reserved for security vulnerabilities and breaking database changes. This is a UI enhancement — level:intermediate is appropriate. Please request a label update.

@Sachinchaurasiya360 Sachinchaurasiya360 added level:intermediate Requires moderate project understanding and removed level:critical High-impact or critical changes labels Jun 1, 2026
@github-actions github-actions Bot added level:critical High-impact or critical changes and removed level:intermediate Requires moderate project understanding type:design UI/UX or design-related updates labels Jun 1, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
client/src/module/student/applications/questions/interviewQuestions.ts (1)

157-157: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Tips are not passed through fillTemplate.

interviewQuestions.ts assigns tips: templates.tips[i % templates.tips.length] directly, so any {concept}/{skill}/{situation}/{challenge}/{system} placeholders present in interviewTemplates.ts will render unsubstituted.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/module/student/applications/questions/interviewQuestions.ts` at
line 157, The tips string is assigned directly from templates.tips and so
placeholders like {concept}/{skill}/{situation}/{challenge}/{system} remain
unsubstituted; change the assignment to pass the selected tip through the same
fillTemplate call used for questions (e.g., replace tips: templates.tips[i %
templates.tips.length] with tips: fillTemplate(templates.tips[i %
templates.tips.length], {concept, skill, situation, challenge, system}) or by
passing the same variables/context object used for filling the question in
interviewQuestions.ts so tips are rendered correctly.
🧹 Nitpick comments (1)
client/src/module/student/applications/DailyInterviewTipWidget.tsx (1)

93-108: ⚖️ Poor tradeoff

Use the shared Button component for new buttons.

The Focus Mode toggle, the Next button, and the filter pills (Lines 134-147) are new/changed buttons built from raw <button>/motion.button. Route them through the reusable Button (e.g., mode="icon" for the chevron, variant="ghost"/mono for the toggle and filters), using asChild where motion wrapping is needed. The new filter bar also uses text-[10px]; prefer a standard scale class.

As per coding guidelines: "Use the reusable Button component from client/src/components/ui/button.tsx for all new buttons" and "Do not use arbitrary bracket sizes like text-[17px], use standard scale classes instead".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/module/student/applications/DailyInterviewTipWidget.tsx` around
lines 93 - 108, Replace the raw motion.button and button instances with the
shared Button component: wrap the Focus Mode toggle (uses setFocusMode and reads
focusMode) with <Button variant="mono" asChild> so you can keep the
motion.button for animations, and replace the Chevron Next button (uses
handleNav) with <Button mode="icon" variant="ghost">; for the filter pills (the
other buttons that toggle filters) use <Button variant="ghost" or
variant="mono"> as appropriate. Use asChild when you need to keep motion or
custom child elements, and remove arbitrary bracketed sizes (replace text-[10px]
with a standard class like text-xs). Ensure the Button props
(mode/variant/asChild) match existing Button API and preserve onClick handlers
(setFocusMode, handleNav, filter toggles) and accessibility attributes like
title.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/src/module/student/applications/questions/interviewQuestions.ts`:
- Around line 123-142: The current pick function uses Math.random() causing
QUESTIONS (built at module load) to be non-deterministic; replace pick with a
deterministic per-pool indexing strategy so the same bank is produced for all
users each day. Implement a stable selector that maintains an index per value
pool (e.g., concept/system/skill/etc.) and picks arr[index % arr.length] while
incrementing or advancing indices in a predictable way (date-seeded or fixed
cycle), and use that selector when building QUESTIONS and when
DailyInterviewTipWidget derives the daily item so the per-day selection is
consistent across users; update references to pick, valuePool, and QUESTIONS
accordingly.

---

Outside diff comments:
In `@client/src/module/student/applications/questions/interviewQuestions.ts`:
- Line 157: The tips string is assigned directly from templates.tips and so
placeholders like {concept}/{skill}/{situation}/{challenge}/{system} remain
unsubstituted; change the assignment to pass the selected tip through the same
fillTemplate call used for questions (e.g., replace tips: templates.tips[i %
templates.tips.length] with tips: fillTemplate(templates.tips[i %
templates.tips.length], {concept, skill, situation, challenge, system}) or by
passing the same variables/context object used for filling the question in
interviewQuestions.ts so tips are rendered correctly.

---

Nitpick comments:
In `@client/src/module/student/applications/DailyInterviewTipWidget.tsx`:
- Around line 93-108: Replace the raw motion.button and button instances with
the shared Button component: wrap the Focus Mode toggle (uses setFocusMode and
reads focusMode) with <Button variant="mono" asChild> so you can keep the
motion.button for animations, and replace the Chevron Next button (uses
handleNav) with <Button mode="icon" variant="ghost">; for the filter pills (the
other buttons that toggle filters) use <Button variant="ghost" or
variant="mono"> as appropriate. Use asChild when you need to keep motion or
custom child elements, and remove arbitrary bracketed sizes (replace text-[10px]
with a standard class like text-xs). Ensure the Button props
(mode/variant/asChild) match existing Button API and preserve onClick handlers
(setFocusMode, handleNav, filter toggles) and accessibility attributes like
title.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f023cd8b-baca-41ac-9462-1d368efbde06

📥 Commits

Reviewing files that changed from the base of the PR and between 7e2ca90 and f23c7c2.

📒 Files selected for processing (3)
  • client/src/module/student/applications/DailyInterviewTipWidget.tsx
  • client/src/module/student/applications/questions/interviewQuestions.ts
  • client/src/module/student/applications/questions/interviewTemplates.ts
💤 Files with no reviewable changes (1)
  • client/src/module/student/applications/questions/interviewTemplates.ts

Comment thread client/src/module/student/applications/questions/interviewQuestions.ts Outdated
@Abfa41 Abfa41 force-pushed the feat/enhance-daily-interview branch from 5e423a2 to 35c50f4 Compare June 1, 2026 16:52
@Abfa41
Copy link
Copy Markdown
Collaborator Author

Abfa41 commented Jun 1, 2026

@Sachinchaurasiya360 broh, I have updated and resolved the changes which you suggested. Just let me know if any changes are required or not.

@Abfa41 Abfa41 added level:intermediate Requires moderate project understanding type:design UI/UX or design-related updates and removed level:critical High-impact or critical changes labels Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Approved for GSSoC scoring gssoc level:intermediate Requires moderate project understanding quality:exceptional Exceptional implementation quality type:design UI/UX or design-related updates type:feature New feature implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Daily Interview Tip + Interview Questions on Applications page

2 participants