How I Use ChatGPT to Prepare for SWE Interviews
These days, I’m giving interviews for Frontend Developer position (React.js/Next.js) and utilizing Generative AI like ChatGPT for it
Here are the multiple ways I use it to prepare for interviews:
1. Ask a doubtNo-brainer.
I was reading an article about Virtual DOM in React.

Then I thought:
If the virtual DOM is bringing one more step of comparing the differences with the previous virtual DOM tree, then how is it improving performance?
I opened ChatGPT in a new tab and shot my question.

Here’s what it replied: ChatGPT link

Okay, cool.
But upon reading its response, I saw a particular phrase which piqued my interest.

Without any dawdle, I copied that phrase and dumped it on the input field.
And I asked it another question.

Now you get the gist.
Basically if you don’t understand anything, just dump your thought over there and ChatGPT will do its job.
(Just read its response thoroughly, it may not be satisfactory at times)
2. Verify some informationYou can also dump some information from other sources and get it explained by the AI model.
For example, I found the below text from a StackOverflow thread.
The DOM is just one of the rendering environments React can render to, the other major targets being native iOS and Android views via React Native. (This is why “virtual DOM” is a bit of a misnomer.)
The reason it can support so many targets is because React is designed so that reconciliation and rendering are separate phases. The reconciler does the work of computing which parts of a tree have changed; the renderer then uses that information to actually update the rendered app.
This separation means that React DOM and React Native can use their own renderers while sharing the same reconciler, provided by React core.
I took it and asked ChatGPT.

It went on to explain the whole matter.
3. Code sample outputA very good use case of ChatGPT here.
Just paste a code sample and check the output.
console.log('Script start');setTimeout(() => { console.log('setTimeout'); }, 0);
Promise.resolve()
.then(() => { console.log('Promise 1'); })
.then(() => { console.log('Promise 2'); });
console.log('Script end');
However, I added a bit of a twist to the above code.
This was my prompt.

I told ChatGPT to change the code a bit and tell me the output.
It explained the code too.

Surely, the best way to do this is to actually copy and paste the code in a code editor. But AI can help here too.
4. Find improvements in your codeAnother one with no rocket-science, right?
This is actually similar to the output of any code. Just that you can vary your prompt a bit and ask for good/bad things in your code.
Example, I took this React code:
items.map((item, index) => (Click here))…and asked this:

ChatGPT found a few issues and gave me the good code in the end.

Well this is how I use ChatGPT to prepare for software developer interviews.
In the age of AI, why not use it to be better in the interviews!
Remember…
In the end, the interviews involve a lot of luck and they are just vibe check, at times.
You could be asked a LeetCode hard problem for a 7.5 LPA role, whereas could be asked about your personal project in a 14 LPA role, no LeetCode (telling from personal experience).
Cheers.
The post How I Use ChatGPT to Prepare for SWE Interviews appeared first on Suman Sourabh.