---
title: "Discussion on \"How I Created an Interview CLI with Node.js for self-interview preparation\" | Hashnode"
description: "Discussion on \"How I Created an Interview CLI with Node.js for self-interview preparation\". I have created an interview preparation CLI, which will show random questions when I run a CLI command \"interview\"."
url: "https://hashnode.com/posts/how-i-created-an-interview-cli-with-nodejs-for-self-interview-preparation/6158a96570a8165c11f64203"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How I Created an Interview CLI with Node.js for self-interview preparation](https://karthikdevarticles.com/how-i-created-an-interview-cli-with-nodejs-for-self-interview-preparation?utm_source=hashnode&utm_medium=feed)

I have created an interview preparation CLI, which will show random questions when I run a CLI command "interview".

Oct 2, 2021 · 3 min read · karthikdevarticles.com  
Updated Apr 25, 2022  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#interview](https://hashnode.com/tag/interview)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#codenewbies](https://hashnode.com/tag/codenewbies)

## Written by

[Karthik](https://hashnode.com/@karthikdevarticles)

@karthikdevarticles

  
[View profile](https://hashnode.com/@karthikdevarticles)

Full Stack Developer | Blogger | UX Design

## Responses 1

Markdown supported · ⌘↵ to post

[Diky Hadna 👾](https://hashnode.com/@dkhd)

[Oct 2, 2021](https://hashnode.com/posts/how-i-created-an-interview-cli-with-nodejs-for-self-interview-preparation/6158a96570a8165c11f64203/comment/6158ad2370a8165c11f64254)

Nice work 🔥🔥🔥

But I think it's better to read total line number instead of hardcode the `10`.

It's something like this:

```
const totalLine = <get_the_total_line_number_from_txt>

const n = crypto.randomInt(0, totalLine);
```

Keep up the good work 🎉🎉🎉

[Karthik](https://hashnode.com/@karthikdevarticles)

[Oct 2, 2021](https://hashnode.com/posts/how-i-created-an-interview-cli-with-nodejs-for-self-interview-preparation/6158a96570a8165c11f64203/comment/6158ad2370a8165c11f64254#reply-6158c0b670a8165c11f64438)

Thank you (💯) 🙂, have updated the code.
