Coding Without AI interview questions

The basics every interviewer assumes you know: types, conversions, loops, arrays, strings, reading errors and fixing syntax, shown in JavaScript, PHP and Python side by side.

Readiness: 0 of 30 nailed

How to use this page: 1. Read a question2. Type your answer3. Check with AI4. Open the model answer5. Timed drill when you’re 70% ready

Types and conversions

FoundationWrite it by hand

Convert the array ['4', '2', '7'] into numbers, and also into the single number 427.

FoundationPredict the output

What does this JavaScript print?

console.log('5' + 3);
console.log('5' - 3);
FoundationConcept

What is the difference between == and ===?

FoundationWrite it by hand

Convert '42' to a number and 42 to a string, in JS, PHP and Python. What happens with '42abc'?

FoundationConcept

What is the difference between null and undefined in JavaScript (and null/None elsewhere)?

FoundationConcept

What is JSON, and how do you convert to and from it?

Strings

FoundationWrite it by hand

Reverse a string by hand, without a built-in reverse function. Then check if a word is a palindrome.

FoundationWrite it by hand

Count the vowels in a string.

Arrays and maps

FoundationWrite it by hand

Count how many times each word appears in a sentence.

FoundationWrite it by hand

Remove duplicates from [3, 1, 3, 2, 1], keeping the original order.

JuniorPredict the output

What does this print?

console.log([10, 9, 1, 100].sort());
JuniorConcept

Which common array methods change the original array?

Loops and conditions

FoundationWrite it by hand

Write FizzBuzz: print 1 to 15, but “Fizz” for multiples of 3, “Buzz” for multiples of 5, and “FizzBuzz” for both.

FoundationWrite it by hand

Find the largest and second-largest number in an array without sorting.

JuniorWrite it by hand

What is recursion? Write factorial recursively.

FoundationConcept

When would you use for, while, for...of/foreach, and array methods like map?

FoundationIt’s broken: why?

This loop crashes or prints undefined at the end. Why?

const arr = ['a', 'b', 'c'];
for (let i = 0; i <= arr.length; i++) {
  console.log(arr[i].toUpperCase());
}
FoundationWrite it by hand

Sum the digits of a number, like 4821 → 15, without converting to a string.

JuniorConcept

When would you choose recursion over a loop?

Reading errors

FoundationIt’s broken: why?

You see TypeError: Cannot read properties of undefined (reading 'name'). What does it mean and how do you find the cause?

const user = users.find(u => u.id === id);
console.log(user.name);
FoundationIt’s broken: why?

Find the syntax errors in this PHP.

<?php
function greet($name) {
  $message = "Hello " + $name
  if ($name == "admin") {
    echo $message
  }
JuniorReal-world scenario

“Something is broken and there’s no error message. How do you debug it?”

FoundationConcept

How do you read a stack trace?

FoundationReal-world scenario

What’s the difference between debugging with console.log and using a debugger?

Performance basics

JuniorConcept

What is Big-O notation? What is the complexity of a loop inside a loop?

Values and references

JuniorPredict the output

What does this print?

const a = { score: 1 };
const b = a;
b.score = 99;
console.log(a.score);
FoundationPredict the output

What does this print?

let name = 'outer';
function change() {
  let name = 'inner';
}
change();
console.log(name);

Tools

FoundationConcept

Explain git add, commit, push and pull simply.

Mindset

FoundationHow to reply

Why do interviewers test fundamentals if AI can write the code?

FoundationHow to reply

How do you approach a coding problem when you don’t know where to start?

Also prepare