ICT Career Guide Beginners
What Happens in a Coding Interview? A Beginner’s Guide
From the first question to the final test
Step inside a real-world coding interview simulation. See what the interviewer asks, follow a JavaScript challenge, correct a mistake and test the solution.
A practical interview journey
Understand, plan, code, test and explain each decision.What actually happens in a coding interview?
An employer gives you a programming problem and assesses how you solve it. In a live session, you may write code while talking to an interviewer, run tests, correct mistakes and explain your decisions. In an independent test, you may submit code for automated evaluation. The exact tools and questions depend on the role. [1] [2]
The practical sequence: understand → clarify → plan → code → test → explain.
Before your first session
What will you see on the coding interview screen?
Imagine opening an invitation link for a junior developer internship. An interviewer greets you and displays a short programming question. A typical browser-based coding environment may give you a question panel, editor, Run button, and output or test-results panel. Some assessments show a timer; some require submission without a live interviewer. [3]
| Screen area | What it does |
|---|---|
| Question panel | States the task, inputs and expected result |
| Code editor | Where you type a program |
| Run / test controls | Execute code and inspect output where the platform supports it |
| Output panel | Displays returned values or errors |
| Timer / submit | Appears when the assessment uses these features |
On a phone, swipe horizontally inside the table to view all columns.
For example, writing console.log(5 + 3) in JavaScript and running it produces 8. Available controls vary across interview platforms. During live coding, the interviewer may see your editor as you work; in an independent assessment, your submission may be evaluated later.
Understand the format
What are the main types of coding interviews?
The word “coding interview” can mean several different practical assessments. The invitation and job description tell you which form to expect. [1] [4]
| Format | Typical activity | Beginner example |
|---|---|---|
| Live coding | Work in a shared editor while explaining choices | Add even numbers in an array |
| Timed online assessment | Solve independently and submit within a time window | Count matching words |
| Debugging | Find and correct a fault in existing code | Repair a webpage button |
| Pair programming | Work together on a small feature | Add search to a product list |
| Take-home assignment | Build and submit the requested work | Make a stock-status function |
On a phone, swipe horizontally inside the table to view all columns.
A coding interview is one possible part of a broader developer interview. Other stages may cover your projects, teamwork, technical knowledge or experience.
Follow a realistic session
A 45-minute coding interview: what happens and when
Amina is a fictional beginner who has applied for a junior developer internship. This timeline illustrates a live assessment, not a fixed requirement for every company.
0–5 minutes · Introductions
Amina briefly describes a school revision quiz she built in JavaScript.
5–10 minutes · Clarify
The interviewer shares a problem; Amina checks assumptions and expected outputs.
10–15 minutes · Plan
She explains her intended solution in ordinary language.
15–35 minutes · Implement
She writes code, talks through important choices and corrects a mistake.
35–42 minutes · Test
She checks an empty array, negative numbers and other cases.
42–45 minutes · Discuss
She explains efficiency and asks what happens next.
University interview-preparation guidance describes common live sessions around 45–60 minutes, but always follow your own invitation. [1]
The central practical example
Full mock interview: solve an even-number problem
Interviewer: “Write a JavaScript function that receives an array of integers and returns the sum of all even numbers.”
| Example input | Expected output | Why |
|---|---|---|
| [4, 7, 2, 9] | 6 | 4 + 2 = 6 |
| [] | 0 | No numbers to add |
| [-4, 5, 8] | 4 | −4 + 8 = 4 |
On a phone, swipe horizontally inside the table to view all columns.
An array holds several values. An even integer divides by two with a remainder of zero. This example starts with basic JavaScript and builds toward testing and efficiency.
Ask questions
Amina asks: “If the list is empty, should I return zero? Can the integers be negative?” The interviewer confirms both.
Explain the plan
Start at zero; examine each number; add it when even; return the sum.
Write the first version
Amina writes a loop but accidentally replaces the total instead of adding.
First attempt — deliberately incorrect:
The program runs but prints 2 instead of 6. This is a logic error: the instructions execute, but the calculation is wrong.
| Number | Even? | Incorrect total | Correct total |
|---|---|---|---|
| Start | — | 0 | 0 |
| 4 | Yes | 4 | 4 |
| 7 | No | 4 | 4 |
| 2 | Yes | 2 | 6 |
| 9 | No | 2 | 6 |
On a phone, swipe horizontally inside the table to view all columns.
Interviewer: “What did you expect?” Amina: “Six. I can see I am replacing the running total each time instead of adding to it.”
She changes total = number to total += number.
Corrected JavaScript:
The % remainder operator checks divisibility. For an integer, number % 2 === 0 is true when it is even. The += operator adds the current number to the accumulated total. [5]
Amina then checks more than the sample input:
| Test input | Expected result | What it checks |
|---|---|---|
| [] | 0 | Empty array |
| [1, 3, 5] | 0 | All odd |
| [-4, 5, 8] | 4 | Negative and positive |
| [0, 0] | 0 | Zeros |
| [-6, -2] | −8 | Negative even values |
| [12] | 12 | One element |
On a phone, swipe horizontally inside the table to view all columns.
Interviewer: “What if the list has 1,000 numbers?” Amina: “My loop examines each number once, so it checks 1,000 values. Its running time is O(n) for n elements, and it uses constant extra working memory, O(1).”
Amina clarified the requirements, found an actual wrong answer, traced the error, fixed it and tested edge cases. A correct answer is important, but her explanation also shows how she works through problems.
Understand errors
What happens when your coding test fails?
A failing test does not always mean the program has the same kind of error. The message and behaviour provide clues.
| Failure | What you see | Useful next step |
|---|---|---|
| Syntax error | The code cannot be parsed | Inspect brackets, quotes and syntax |
| Runtime error | It starts but fails during execution | Check missing or invalid values |
| Wrong answer | It runs but returns the wrong result | Trace calculations and conditions |
| Edge-case failure | Sample passes, unusual input fails | Check empty, negative or boundary inputs |
| Slow execution | Large input takes too long | Review repeated work and algorithm choice |
On a phone, swipe horizontally inside the table to view all columns.
For an unknown failed test, revisit the requirement, reproduce the failure if possible, inspect likely boundary cases, make one reasoned correction and rerun available tests. Some platforms do not reveal every hidden test input.
Do not randomly change code until the displayed result turns green. Explain what you expected, what happened and what you will investigate.
Practical example two
Debug a school webpage: why does the button do nothing?
A fictional school webpage should display Total Marks: 90 when a user clicks a button. The two marks are 65 and 25. The HTML contains:
The JavaScript below is run after those HTML elements have loaded, but it contains a mistake:
The paragraph is named result, but JavaScript looks for results. When no matching element exists, getElementById() returns null. Setting textContent on null causes an error. [6]
Observe the problem
The click does not display a total. Check the browser console if available.
Find the mismatch
Compare the HTML ID result with the JavaScript string results.
Correct and test
Change JavaScript to look for result; click again and confirm Total Marks: 90.
What to say: “The arithmetic was correct, but the element lookup used a different ID. I changed the identifier and verified that the button displays the expected total.”
Practical example three
Build a small shop stock-status function
A small shop needs a status label for each product. The task says: 0 = OUT OF STOCK; 1–4 = LOW STOCK; 5 or more = IN STOCK; invalid or negative quantities must be rejected.
| Quantity | Expected status |
|---|---|
| 0 | OUT OF STOCK |
| 4 | LOW STOCK |
| 5 | IN STOCK |
| 20 | IN STOCK |
| −1 | INVALID QUANTITY |
| 2.5 | INVALID QUANTITY |
On a phone, swipe horizontally inside the table to view all columns.
The first condition rejects quantities that are not non-negative integers. Number.isInteger() checks whether its argument is a JavaScript integer value. [7]
The important boundary is between 4 and 5. An interviewer may ask why input validation comes first or how you tested the boundary.
Complete the requested logic first. Then supply the required source file, run instructions, tests and short explanation. Confirm the deadline and the rules for documentation or AI assistance before beginning. [3]
What matters to the assessor
What do interviewers evaluate?
Assessment criteria differ across employers, but official technical-interview guidance commonly emphasises problem-solving, coding and communication. [2] [4]
| Area | What it reveals | Example |
|---|---|---|
| Understanding | You interpret the requirement | Restate input and expected output |
| Correctness | The program solves the specified task | Pass normal and boundary tests |
| Reasoning | You choose a workable approach | Explain the loop before coding |
| Debugging | You can investigate errors | Find why a total was overwritten |
| Communication | You can explain your choices | Describe what you changed and why |
| Efficiency | You notice performance trade-offs | Explain one pass through n values |
On a phone, swipe horizontally inside the table to view all columns.
One passing output does not guarantee a passing assessment. Your code might miss conditions or fail other tests. Conversely, a mistake that you identify and fix can demonstrate useful debugging ability. What the employer ultimately requires depends on the role.
When you need another approach
What should you say when you get stuck?
Suppose you are asked to return all numbers greater than ten from [5, 12, 8, 20]. The expected result is [12, 20]. You understand the comparison but cannot immediately write the solution.
Restate the task
“I need to examine each number and keep values greater than ten.”
Break it down
Loop through the list, compare each value, store matches and return them.
Describe the difficulty
“I understand the condition but need to decide how to collect the matching values.”
If the interviewer allows clarification, ask a specific question or request a hint when necessary. Then implement and test the part you understand. Explain unfinished work accurately rather than claiming unverified tests passed.
After the exercise
What happens at the end of a coding interview?
The interviewer may ask you to summarise the solution, discuss tests, explain an alternative approach or describe what you would improve. You may then have an opportunity to ask about the team or recruitment process.
Possible next stages include another technical assessment, a project discussion, a team interview or a hiring decision. Some employers provide detailed feedback; others do not. Follow the recruiter’s instructions rather than assuming there is one standard timeline.
Five-minute practice
Try your own mini coding interview
A fictional stationery shop sells notebooks for KSh 80 each. Write a JavaScript function that takes the number of notebooks and returns the total price. For this exercise, assume the quantity is a valid non-negative whole number.
| Notebooks | Expected total |
|---|---|
| 0 | KSh 0 |
| 1 | KSh 80 |
| 3 | KSh 240 |
| 5 | KSh 400 |
On a phone, swipe horizontally inside the table to view all columns.
Understand
Say what the function receives and returns.
Plan
Total price = quantity × 80.
Code, test, explain
Run at least two inputs, then explain the multiplication.
Example solution — read only after you try:
For an extra challenge, extend the function to reject negative quantities, decimals and non-numeric inputs.
Common questions
Frequently asked questions about coding interviews
How long does a coding interview last?
It depends on the format. University guidance describes many live coding sessions around 45–60 minutes, and some independent timed assessments around 30–60 minutes. The invitation is the authority for your particular session. [1]
Will the interviewer watch me type?
During live coding, the interviewer may observe a shared editor or screen. In an independent assessment, your work may be evaluated without a person watching live.
Do I need to memorise code?
Understand the core syntax of your chosen language and practise solving problems without copying solutions. Whether reference material is allowed depends on the assessment rules.
Can I use ChatGPT or another AI assistant?
Only when permitted. Some platforms can provide AI features, but the employer or interviewer controls what use is acceptable. Follow the stated rules. [3]
What if I cannot finish?
Explain what you completed, which tests you ran and where you are stuck. Employers decide outcomes using their own criteria; neither an incomplete answer nor fluent explanations guarantee a result.
Can I attend without previous employment?
Yes, employers may interview students and beginners for suitable internships and entry-level positions. Be ready to explain projects you personally completed.
What if my internet disconnects?
Contact the interviewer or recruiter through their specified channel. Do not assume the assessment automatically pauses or resets.
Can running code still be wrong?
Yes. A program can execute without an error but return incorrect results or miss required cases. Test both normal and boundary inputs.
Key lesson
What should you remember from your first coding interview?
You may be asked to write code, debug an application, explain a technical decision or complete a short project. The central habit is the same: understand → clarify → plan → code → test → explain.
In this guide, the first solution produced a wrong result, the school webpage used a mismatched ID, and the shop task required careful boundary testing. Each example showed how a candidate can turn an unfamiliar challenge into smaller, testable steps.
When you have working programming projects, see NIT’s coding portfolio guide for ways to present and explain your own work.
Learn by building real programs
Register for Full-Stack Software Development at Newton Institute of Technology
Learn frontend and backend programming, databases, APIs, debugging and practical software projects. NIT’s course includes 8 months of training followed by at least 3 months of industrial attachment.
Training8 months + 3+ months attachment
Course feeKSh 90,000
Call / WhatsApp+254 713 584 858
CampusMigori Town, Kenya
Starting levelBeginners welcome
Sources and references
Candidate and interviewer conversations are original fictional teaching examples. Technical and interview claims are supported by the following resources.
- Princeton University, Center for Career Development. Coding Interview Preparation. Interview formats, typical timings and how candidates work through problems. Source.
- Microsoft Careers. Technical Interviewing. Technical problem-solving, coding, testing and communication. Source.
- CoderPad. Interview Preparation Guide for Candidates. Candidate editor, live coding, assignments and AI assistance permissions. Source.
- Amazon Jobs. Software Development Interview Topics. Developer interview subjects and assessment formats. Source.
- MDN Web Docs. Remainder (%) operator. Official JavaScript technical explanation. Source.
- MDN Web Docs. Document.getElementById(). What happens when a matching element does not exist. Source.
- MDN Web Docs. Number.isInteger(). JavaScript integer validation behaviour. Source.
Prepared by Newton Institute of Technology Editorial Team · Editorial date: 11 November 2026.