0% found this document useful (0 votes)
14 views30 pages

SechPoint Interview Prep

The document is an interview preparation guide for a Mid-Level Software Engineer position at SechPoint Tech, covering essential topics such as Node.js, SQL, Docker, and Apache Kafka. It includes beginner-friendly explanations, code examples, and key concepts related to each technology. The guide is structured into chapters that address fundamental to advanced topics relevant to the role, providing a comprehensive overview for candidates.

Uploaded by

abdevil1724
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views30 pages

SechPoint Interview Prep

The document is an interview preparation guide for a Mid-Level Software Engineer position at SechPoint Tech, covering essential topics such as Node.js, SQL, Docker, and Apache Kafka. It includes beginner-friendly explanations, code examples, and key concepts related to each technology. The guide is structured into chapters that address fundamental to advanced topics relevant to the role, providing a comprehensive overview for candidates.

Uploaded by

abdevil1724
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Interview Preparation Guide

SechPoint Tech — Mid-Level Software Engineer

[Link] · Python · SQL · Docker · Kafka · Linux · Cloud · [Link]

Prepared for: Adnan Sameer Z

Role: Mid-Level Software Engineer (2–5 Years)

Covers every topic from fundamentals to advanced concepts


with beginner-friendly explanations and real code examples
Chapter 1

[Link]
Event Loop · Middleware · REST APIs · Modules

Q: What is [Link] and how does it work?


[Link] is a runtime environment that lets you run JavaScript outside the browser — on a server. It is built on
Google's V8 engine and uses a single-threaded, non-blocking, event-driven architecture.

• V8 Engine: Converts JavaScript into fast machine code the CPU can run
• Event Loop: Handles async tasks without blocking the main thread
• Libuv: A C library that provides a thread pool for background tasks like file I/O
• Non-blocking I/O: Node doesn't wait — it processes thousands of requests efficiently
■ Think of Node as a smart waiter who takes orders, sends them to the kitchen, and serves other tables —
never standing idle waiting for food.

Q: What is the Event Loop in [Link]?


The event loop is what makes [Link] non-blocking. It constantly checks if any async tasks are done and
runs their callbacks.
[Link]("1 - Start");
setTimeout(() => [Link]("2 - Timer done"), 2000);
[Link]("3 - Keep going");
// Output:
// 1 - Start
// 3 - Keep going
// 2 - Timer done (after 2 seconds)
■ Node did NOT wait for the timer. It moved on and came back when it was done.

Q: What are modules in [Link]?


A module is a reusable block of code. [Link] has 3 types:

• Built-in: Come with Node — fs, http, os, path, crypto


• Local: Files you create and export yourself
• Third-party: Installed via npm — express, mongoose, dotenv
// Built-in
const fs = require('fs');
const path = require('path');
// Local module ([Link])
[Link] = { add: (a,b) => a + b };
// Using local module
const math = require('./math');
[Link]([Link](5, 3)); // 8
// Third-party
const express = require('express'); // after npm install express

Q: What is middleware in [Link]?


Middleware is a function that runs between the incoming request and the final route handler. It has access to
req, res, and next.
const express = require('express');
const app = express();
// Logger Middleware
[Link]((req, res, next) => {
[Link](`${[Link]} ${[Link]}`);
next(); // pass to next middleware
});
// Body Parser Middleware
[Link]([Link]());
// Route
[Link]('/', (req, res) => {
[Link]('Hello!');
});
// Error Handling Middleware (4 args - special!)
[Link]((err, req, res, next) => {
[Link](500).send('Something went wrong!');
});
[Link](3000);
■ If you forget to call next(), the request gets stuck and never reaches the route!

Q: What are HTTP methods and when to use each?


[Link]('/users', handler); // Read - fetch data
[Link]('/users', handler); // Create - add new data
[Link]('/users/1', handler); // Update - replace entire record
[Link]('/users/1', handler); // Update - change part of record
[Link]('/users/1', handler); // Delete - remove record
• GET: Read data (no body sent)
• POST: Create new resource (body contains new data)
• PUT: Replace entire resource
• PATCH: Update only specific fields
• DELETE: Remove a resource

Q: What is REST API?


REST (Representational State Transfer) is a design pattern for building APIs. A RESTful API uses HTTP
methods to perform CRUD operations on resources.

• Stateless: Each request is independent, server stores no session


• Resource-based: URLs represent resources (/users, /orders)
• Uses HTTP methods: GET, POST, PUT, PATCH, DELETE
• Returns JSON: Standard response format
// REST API example
GET /users -> get all users
GET /users/1 -> get user with id 1
POST /users -> create new user
PUT /users/1 -> update user 1 completely
PATCH /users/1 -> update user 1 partially
DELETE /users/1 -> delete user 1

Q: What is JWT Authentication?


JWT (JSON Web Token) is a way to securely transmit information between client and server. It has 3 parts:
Header, Payload, Signature — separated by dots.
const jwt = require('jsonwebtoken');
// Create token on login
[Link]('/login', (req, res) => {
const user = { id: 1, name: 'Adnan' };
const token = [Link](user, 'SECRET_KEY', { expiresIn: '1h' });
[Link]({ token });
});
// Verify token middleware
function verifyToken(req, res, next) {
const token = [Link]['authorization'];
if (!token) return [Link](401).send('Access denied');
try {
const verified = [Link](token, 'SECRET_KEY');
[Link] = verified;
next();
} catch (err) {
[Link](400).send('Invalid token');
}
}
// Protected route
[Link]('/profile', verifyToken, (req, res) => {
[Link]({ user: [Link] });
});
■ JWT = eyJhbGciOi... — 3 base64 parts joined by dots. Never store secrets in payload — it's not encrypted,
only signed!

Q: What is the difference between require and import?


// CommonJS (require) - older, [Link] default
const express = require('express');
[Link] = { add };
// ES Modules (import) - modern
import express from 'express';
export function add(a, b) { return a + b; }
• require: synchronous, loads at runtime, works everywhere in Node by default
• import: asynchronous, static analysis possible, needs 'type: module' in [Link]
Q: How do you handle errors in Express?
// Try-catch in async routes
[Link]('/users', async (req, res, next) => {
try {
const users = await [Link]();
[Link](users);
} catch (err) {
next(err); // passes to error middleware
}
});
// Central error handler
[Link]((err, req, res, next) => {
[Link]([Link]);
[Link]([Link] || 500).json({
message: [Link] || 'Internal Server Error'
});
});

Q: What is [Link] and how do you use .env files?


// .env file
PORT=3000
DB_URL=mongodb://localhost:27017/mydb
JWT_SECRET=mysecretkey
// [Link]
require('dotenv').config(); // reads .env and loads into [Link]
const port = [Link] || 3000;
const dbUrl = [Link].DB_URL;
■ Always add .env to .gitignore — never push secrets to GitHub!
Chapter 2

SQL & Databases


Queries · JOINs · Indexes · Transactions

Q: What is SQL and what are the basic commands?


SQL (Structured Query Language) is used to interact with relational databases like PostgreSQL, MySQL,
SQLite.
-- Create table
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(100) UNIQUE,
age INTEGER
);
-- Insert
INSERT INTO users (name, email, age) VALUES ('Adnan', 'adnan@[Link]', 25);
-- Read
SELECT * FROM users;
SELECT name, email FROM users WHERE age > 20;
-- Update
UPDATE users SET age = 26 WHERE id = 1;
-- Delete
DELETE FROM users WHERE id = 1;

Q: Explain different types of JOINs with examples


JOINs combine rows from two or more tables based on a related column.
-- Tables:
-- users: id, name
-- orders: id, user_id, amount
-- INNER JOIN: only rows that match in BOTH tables
SELECT [Link], [Link]
FROM users
INNER JOIN orders ON [Link] = orders.user_id;
-- LEFT JOIN: all rows from LEFT table + matching from right
-- (shows users even if they have no orders)
SELECT [Link], [Link]
FROM users
LEFT JOIN orders ON [Link] = orders.user_id;
-- RIGHT JOIN: all rows from RIGHT table + matching from left
SELECT [Link], [Link]
FROM users
RIGHT JOIN orders ON [Link] = orders.user_id;
-- FULL OUTER JOIN: all rows from both tables
SELECT [Link], [Link]
FROM users
FULL OUTER JOIN orders ON [Link] = orders.user_id;
• INNER JOIN: Only matched rows (intersection)
• LEFT JOIN: All from left, matched from right (nulls if no match)
• RIGHT JOIN: All from right, matched from left
• FULL OUTER JOIN: Everything from both tables

Q: What is the difference between WHERE and HAVING?


-- WHERE: filters ROWS before grouping
SELECT * FROM orders WHERE amount > 100;
-- HAVING: filters GROUPS after GROUP BY
SELECT user_id, SUM(amount) as total
FROM orders
GROUP BY user_id
HAVING SUM(amount) > 500;
-- Combined example
SELECT user_id, SUM(amount) as total
FROM orders
WHERE status = 'completed' -- filter rows first
GROUP BY user_id
HAVING SUM(amount) > 500; -- then filter groups
■ Simple rule: WHERE = before grouping, HAVING = after grouping

Q: What are indexes and why are they used?


An index is like a book's index — it helps the database find rows faster without scanning the entire table.
-- Without index: database scans ALL rows (slow for large tables)
SELECT * FROM users WHERE email = 'adnan@[Link]';
-- Create an index
CREATE INDEX idx_users_email ON users(email);
-- Now the same query is MUCH faster ■
-- Unique index (also enforces uniqueness)
CREATE UNIQUE INDEX idx_email ON users(email);
• Pro: Faster SELECT queries
• Con: Slower INSERT/UPDATE/DELETE (index must be updated too)
• Use indexes on: columns you frequently search/filter/join on

Q: What are transactions in SQL?


A transaction is a group of SQL operations that either ALL succeed or ALL fail together. This ensures data
consistency.
-- Example: transferring money between accounts
BEGIN; -- start transaction
UPDATE accounts SET balance = balance - 500 WHERE id = 1; -- debit
UPDATE accounts SET balance = balance + 500 WHERE id = 2; -- credit
COMMIT; -- save both changes if all went well
-- ROLLBACK; -- undo everything if something failed
Transactions follow ACID properties:

• Atomicity: All operations succeed or all fail


• Consistency: Database stays in valid state
• Isolation: Transactions don't interfere with each other
• Durability: Committed data is permanently saved

Q: What is the difference between SQL and NoSQL?


Feature SQL (PostgreSQL) NoSQL (MongoDB)

Structure Tables with rows/columns Collections with documents

Schema Fixed, defined upfront Flexible, dynamic

Query SQL language JSON-like queries

Relationships JOINs between tables Embedded or referenced

Best for Structured, relational data Unstructured, flexible data

Q: Write a query to find the top 3 users by total order amount


SELECT [Link], SUM([Link]) as total_spent
FROM users
INNER JOIN orders ON [Link] = orders.user_id
GROUP BY [Link]
ORDER BY total_spent DESC
LIMIT 3;
Chapter 3

Docker & Containers


Images · Containers · Dockerfile · Compose

Q: What is Docker and why is it used?


Docker is a tool that packages your application and all its dependencies into a container — a lightweight,
portable unit that runs the same everywhere.

• Problem without Docker: 'It works on my machine but not on the server' ■
• With Docker: The app runs identically on every machine ■
• Containers are like shipping containers — standardized, portable, isolated

Q: What is the difference between an Image and a Container?


Image = Blueprint / Recipe (read-only template)
Container = Running instance of an image (like a running process)
// Analogy:
Image = Cookie cutter ■
Container = Actual cookie made from that cutter
• Image: Static snapshot of app + dependencies + config
• Container: Live, running instance created from an image
• You can run multiple containers from the same image

Q: Explain Dockerfile and its common instructions


# Dockerfile for a [Link] app
FROM node:18-alpine # base image to start from
WORKDIR /app # set working directory inside container
COPY package*.json ./ # copy package files first (for caching)
RUN npm install # install dependencies
COPY . . # copy all source code
EXPOSE 3000 # document the port (doesn't actually open it)
CMD ["node", "[Link]"] # command to run when container starts
• FROM: Which base image to build on
• WORKDIR: Directory inside container to work in
• COPY: Copy files from host into container
• RUN: Execute commands during build (install packages)
• EXPOSE: Document which port the app uses
• CMD: What to run when container starts

Q: What are common Docker commands?


# Build an image
docker build -t myapp:1.0 .
# Run a container
docker run -d -p 3000:3000 --name mycontainer myapp:1.0
# ^ ^ ^ ^
# detach port-map name image
# List running containers
docker ps
# List all containers (including stopped)
docker ps -a
# View logs
docker logs mycontainer
# Stop a container
docker stop mycontainer
# Remove a container
docker rm mycontainer
# List images
docker images
# Remove an image
docker rmi myapp:1.0
# Execute command in running container
docker exec -it mycontainer bash

Q: What is docker-compose and when do you use it?


docker-compose lets you define and run multiple containers together using a single YAML file. Perfect for
apps that need a database, cache, and server all running together.
# [Link]
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
environment:
- DB_URL=mongodb://mongo:27017/mydb
depends_on:
- mongo
mongo:
image: mongo:6
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db
volumes:
mongo_data:
# Start all services
docker-compose up -d
# Stop all services
docker-compose down
# View logs
docker-compose logs -f

Q: What is the difference between CMD and ENTRYPOINT?


# CMD: default command, can be overridden when running container
CMD ["node", "[Link]"]
docker run myapp python [Link] # overrides CMD
# ENTRYPOINT: always runs, cannot be easily overridden
ENTRYPOINT ["node"]
CMD ["[Link]"] # becomes argument to ENTRYPOINT
# Result: node [Link]
■ Use ENTRYPOINT when the container has one main purpose. Use CMD for default args that might change.
Chapter 4

Apache Kafka
Messaging · Topics · Producers · Consumers

Q: What is Apache Kafka and why is it used?


Kafka is a distributed messaging system that lets different parts of your application communicate
asynchronously by sending and receiving messages through topics. Think of it as a postal system for
microservices.

• Problem: Service A needs to send data to Services B, C, D — direct API calls = tight coupling ■
• Solution: A publishes to Kafka, B/C/D subscribe and read independently ■
• Use cases: Real-time analytics, event streaming, microservice communication, logs

Q: Explain Kafka core concepts: Topics, Producers, Consumers


PRODUCER ■■publishes■■> TOPIC ■■subscribes■■ CONSUMER
(like a queue/channel)
Example: E-commerce order system
OrderService (Producer)
|
|-- publishes "[Link]" event to Kafka topic
|
v
Kafka Topic: "orders"
|
|-- EmailService (Consumer) reads → sends confirmation email
|-- InventoryService (Consumer) reads → reduces stock
|-- AnalyticsService (Consumer) reads → updates dashboard
• Topic: Named channel where messages are published (like a category)
• Producer: Service that sends/publishes messages to a topic
• Consumer: Service that reads/subscribes to messages from a topic
• Broker: Kafka server that stores and manages messages
• Partition: Topics are split into partitions for scalability

Q: What is the difference between Kafka and REST API?


Feature REST API Kafka

Communication Synchronous (wait for response) Asynchronous (fire and forget)

Coupling Tight (caller knows receiver) Loose (publisher unaware of consumers)

Speed Slower under load Very high throughput

Use case Request-response Event streaming, real-time


Reliability Response confirms delivery Messages persisted in log

Q: What is a Consumer Group in Kafka?


A consumer group is a set of consumers that work together to read from a topic. Each partition is read by
only one consumer in the group — enabling parallel processing.
Topic: "orders" with 3 partitions
Consumer Group: "email-service"
Consumer 1 → reads Partition 0
Consumer 2 → reads Partition 1
Consumer 3 → reads Partition 2
Benefits:
- Parallel processing (faster)
- If Consumer 1 dies, Consumer 2 takes over (fault tolerant)

Q: What happens to messages if a consumer is down?


Kafka stores messages on disk for a configurable retention period (default 7 days). When the consumer
comes back online, it reads from where it left off using an offset — a pointer to the last read message.
Kafka Topic Messages:
[msg1] [msg2] [msg3] [msg4] [msg5]
^
offset = 3 (consumer read up to here)
Consumer goes down...
Consumer comes back → resumes from offset 3 → reads msg4, msg5 ■
Chapter 5

Linux
Commands · Permissions · Processes · Networking

Q: What are the most important Linux commands to know?


# Navigation
pwd # print working directory
ls -la # list files with details + hidden
cd /var/log # change directory
mkdir myapp # create directory
rm -rf mydir # remove directory and contents
# File operations
cat [Link] # view file content
less [Link] # view large files (q to quit)
grep "error" [Link] # search for text in file
grep -r "error" ./ # search recursively in folder
tail -f [Link] # live follow a log file
head -n 20 [Link] # first 20 lines
# File editing
nano [Link] # simple editor
vi [Link] # advanced editor (i=insert, :wq=save&quit;)
# Copy / Move
cp [Link] [Link] # copy file
mv [Link] [Link] # move/rename
scp [Link] user@server:/path # copy to remote server

Q: How do you manage processes in Linux?


# View processes
ps aux # all running processes
top # live process monitor
htop # better live monitor (if installed)
# Find a process
ps aux | grep node # find node processes
pgrep node # get PID of node
# Kill a process
kill 1234 # graceful stop (PID 1234)
kill -9 1234 # force kill
pkill node # kill by name
# Run in background
node [Link] & # run in background
nohup node [Link] & # run even after logout
Q: How do file permissions work in Linux?
ls -la output:
-rwxr-xr-- 1 adnan users 1024 May 1 [Link]
^ ^ ^ ^
| | | |__ others: r-- (read only)
| | |____ group: r-x (read + execute)
| |______ owner: rwx (read + write + execute)
|________ file type: - = file, d = directory
# Permission numbers
r = 4, w = 2, x = 1
rwx = 7, rw- = 6, r-x = 5, r-- = 4
chmod 755 [Link] # owner=rwx, group=r-x, others=r-x
chmod 644 [Link] # owner=rw-, group=r--, others=r--
chmod +x [Link] # add execute permission
# Change ownership
chown adnan:users [Link]

Q: How do you check disk usage and system resources?


# Disk usage
df -h # disk free space (human readable)
du -sh ./myapp # size of a directory
# Memory
free -h # RAM usage
cat /proc/meminfo # detailed memory info
# CPU
top # real-time CPU usage
lscpu # CPU info
# Network
ifconfig # network interfaces
ip addr # modern alternative
netstat -tulpn # open ports and listening services
curl [Link] # test HTTP endpoint

Q: How do you view and manage application logs in Linux?


# View logs
tail -f /var/log/[Link] # live follow
tail -n 100 /var/log/[Link] # last 100 lines
grep "ERROR" /var/log/[Link] # filter errors
grep -i "error" [Link] | wc -l # count error lines
# Systemd service logs
journalctl -u myapp # logs for a service
journalctl -u myapp -f # live follow service logs
journalctl --since "2024-01-01" # logs since date
# Redirect output to log file
node [Link] >> [Link] 2>&1 &
# ^ ^
# append stdout stderr too
Chapter 6

Cloud (AWS / Azure)


Compute · Storage · Deployment · Services

Q: What is cloud computing and what are the main service types?
Cloud computing means renting computing resources (servers, storage, databases) from providers like AWS
or Azure instead of owning physical hardware.

• IaaS (Infrastructure as a Service): Raw infrastructure — VMs, networking, storage. You manage OS and
above. Example: AWS EC2, Azure VMs
• PaaS (Platform as a Service): Platform to deploy apps — no OS management. Example: AWS Elastic
Beanstalk, Azure App Service
• SaaS (Software as a Service): Ready-to-use software. Example: Gmail, Slack

Q: What are the key AWS/Azure services you should know?


Category AWS Azure

Compute (VMs) EC2 Virtual Machines

App Hosting Elastic Beanstalk App Service

Serverless Lambda Azure Functions

File Storage S3 Blob Storage

Database RDS Azure SQL

NoSQL DB DynamoDB Cosmos DB

Container ECS / EKS AKS

API Gateway API Gateway API Management

Secrets Secrets Manager Key Vault

Q: What is a serverless function and when would you use it?


Serverless functions (AWS Lambda / Azure Functions) let you run code without managing a server. You just
upload your function and it runs in response to events.
// AWS Lambda example
[Link] = async (event) => {
const name = [Link];
return {
statusCode: 200,
body: [Link]({ message: `Hello ${name}` })
};
};
• Use when: infrequent tasks, event-triggered tasks, auto-scaling needs
• Billed per execution (very cheap for low traffic)
• No server management — provider handles scaling

Q: What is an environment variable in cloud deployment?


Instead of hardcoding secrets in code, cloud providers let you set environment variables in the platform
dashboard. Your app reads them via [Link].
// Azure App Service → Configuration → Application Settings
// Add: DB_URL = mongodb://...
// JWT_SECRET = mysecret
// Your app reads it the same way
const dbUrl = [Link].DB_URL;
■ Never commit secrets to code. Cloud env vars are the secure way to inject them at runtime.
Chapter 7

System Design & Microservices


Architecture · Patterns · APIs

Q: What is a microservices architecture?


Microservices is an architecture where a large application is split into small, independent services. Each
service does one thing and communicates with others via APIs or messaging.
Monolith (old way):
[One giant app: auth + orders + users + payments + emails]
- One codebase, one deployment
- If payments crashes, EVERYTHING crashes ■
Microservices (new way):
[Auth Service] [Order Service] [Payment Service] [Email Service]
- Each deploys independently ■
- One crashes, others keep running ■
- Each can scale individually ■
• Pros: Independent deployment, scalability, fault isolation, team autonomy
• Cons: Network complexity, harder debugging, data consistency challenges

Q: What is an API Gateway?


An API Gateway is a single entry point for all client requests. It routes requests to the right microservice,
handles authentication, rate limiting, and logging.
Client
|
v
API Gateway (single entry point)
|
|--/auth/* --> Auth Service
|--/orders/* --> Order Service
|--/users/* --> User Service
|--/payments/--> Payment Service
■ Think of it as a receptionist who directs all visitors to the right department.

Q: What is load balancing?


Load balancing distributes incoming requests across multiple server instances to prevent any single server
from being overwhelmed.
Without load balancing:
All 1000 users --> Server 1 (overloaded, crashes) ■
With load balancing:
--> Server 1 (333 users)
1000 users --> Server 2 (333 users) ■
--> Server 3 (334 users)
• Round Robin: Each server gets requests in turns
• Least Connections: Route to server with fewest active connections
• IP Hash: Same client always goes to same server

Q: What is caching and how does it improve performance?


Caching stores frequently accessed data in fast memory (like Redis) so the app doesn't hit the database
every time.
// Without cache
Client --> API --> Database (slow, every request)
// With Redis cache
Client --> API --> Cache HIT? --> Return from cache (fast!)
|
MISS? --> Database --> Save to cache --> Return
// [Link] + Redis example
const redis = require('redis');
const client = [Link]();
async function getUser(id) {
const cached = await [Link](`user:${id}`);
if (cached) return [Link](cached); // cache hit!
const user = await [Link]('SELECT * FROM users WHERE id = ?', [id]);
await [Link](`user:${id}`, 3600, [Link](user)); // cache 1hr
return user;
}
Chapter 8

JavaScript Core Concepts


Closures · Async · Promises · Prototypes

Q: What is a closure?
A closure is when an inner function remembers variables from its outer function even after the outer function
has finished executing.
function outer() {
let count = 0; // lives in outer's scope
return function inner() { // inner function = closure
count++;
[Link](count);
};
}
const increment = outer(); // outer() ran and returned inner
increment(); // 1 ← still remembers count!
increment(); // 2
increment(); // 3
■ Real use case: Memoization, data privacy, factory functions, event handlers

Q: Explain the difference between var, let, and const


// var: function-scoped, hoisted, can be re-declared
var x = 1;
if (true) { var x = 2; }
[Link](x); // 2 (same variable!)
// let: block-scoped, not re-declarable
let y = 1;
if (true) { let y = 2; } // different y
[Link](y); // 1 ■
// const: block-scoped, cannot be reassigned
const z = 1;
z = 2; // TypeError! ■
// But const objects can be mutated:
const obj = { name: "Adnan" };
[Link] = "Updated"; // OK ■
obj = {}; // TypeError ■

Q: What are Promises and how do they work?


function fetchUser(id) {
return new Promise((resolve, reject) => {
fetch(`/api/users/${id}`)
.then(res => [Link]())
.then(data => resolve(data)) // success
.catch(err => reject(err)); // failure
});
}
// Consuming
fetchUser(1)
.then(user => [Link](user)) // runs on resolve
.catch(err => [Link](err)); // runs on reject
// 3 states: pending → fulfilled OR rejected

Q: What is async/await?
// Promises with .then chains
fetchUser(1)
.then(user => fetchOrders([Link]))
.then(orders => [Link](orders))
.catch(err => [Link](err));
// Same thing with async/await (cleaner!)
async function getData() {
try {
const user = await fetchUser(1); // waits here
const orders = await fetchOrders([Link]); // waits here
[Link](orders);
} catch (err) {
[Link](err); // handles all errors
}
}
■ await can only be used inside async functions. It pauses only that function, not the whole program.

Q: What are common array methods?


const nums = [1, 2, 3, 4, 5];
// map: transform each element, returns new array
[Link](n => n * 2); // [2, 4, 6, 8, 10]
// filter: keep elements that pass condition
[Link](n => n > 2); // [3, 4, 5]
// reduce: accumulate into single value
[Link]((sum, n) => sum + n, 0); // 15
// find: first matching element
[Link](n => n > 3); // 4
// some: true if ANY element matches
[Link](n => n > 4); // true
// every: true if ALL elements match
[Link](n => n > 0); // true
// forEach: loop (no return value)
[Link](n => [Link](n));
Chapter 9

Data Structures & Algorithms


Arrays · Objects · Sorting · Common Problems

Q: How do you find duplicates in an array?


// Method 1: Using Set
function findDuplicates(arr) {
const seen = new Set();
const duplicates = [];
for (let item of arr) {
if ([Link](item)) {
[Link](item);
} else {
[Link](item);
}
}
return duplicates;
}
findDuplicates([1, 2, 3, 2, 4, 3]); // [2, 3]
// Method 2: Using filter
const arr = [1, 2, 3, 2, 4, 3];
const duplicates = [Link]((item, index) => [Link](item) !== index);

Q: How do you reverse a string?


// Method 1: Built-in
function reverse(str) {
return [Link]('').reverse().join('');
}
// Method 2: Loop
function reverse(str) {
let result = '';
for (let i = [Link] - 1; i >= 0; i--) {
result += str[i];
}
return result;
}
reverse("hello"); // "olleh"

Q: How do you check if a string is a palindrome?


function isPalindrome(str) {
const cleaned = [Link]().replace(/[^a-z0-9]/g, '');
return cleaned === [Link]('').reverse().join('');
}
isPalindrome("racecar"); // true
isPalindrome("hello"); // false
isPalindrome("A man a plan a canal Panama"); // true

Q: How do you find the most frequent element in an array?


function mostFrequent(arr) {
const freq = {};

// Count frequencies
for (let item of arr) {
freq[item] = (freq[item] || 0) + 1;
}

// Find max
let maxItem = arr[0];
let maxCount = 0;
for (let key in freq) {
if (freq[key] > maxCount) {
maxCount = freq[key];
maxItem = key;
}
}
return maxItem;
}
mostFrequent([1, 2, 2, 3, 3, 3, 4]); // 3

Q: What is Big O notation?


Big O describes how an algorithm's time or space grows as the input grows. It helps compare efficiency.
O(1) - Constant: array[0] (always same speed)
O(log n)- Logarithmic: binary search (halves each step)
O(n) - Linear: loop through array
O(n^2) - Quadratic: nested loops
O(2^n) - Exponential: very slow, avoid!
// Example
function findItem(arr, target) {
for (let item of arr) { // O(n) - loops n times
if (item === target) return true;
}
return false;
}
Chapter 10

Python Basics
Syntax · Functions · OOP · FastAPI

Q: What are key Python concepts you should know?


# Lists (like JS arrays)
nums = [1, 2, 3, 4, 5]
[Link](6) # add to end
[Link]() # remove last
evens = [n for n in nums if n % 2 == 0] # list comprehension
# Dictionaries (like JS objects)
user = {"name": "Adnan", "age": 25}
user["email"] = "adnan@[Link]" # add key
[Link]("phone", "N/A") # safe access
# Functions
def add(a, b=0): # b has default value
return a + b
# Lambda
square = lambda x: x ** 2
# f-strings
name = "Adnan"
print(f"Hello {name}") # Hello Adnan

Q: What is FastAPI and how do you create a simple endpoint?


from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
# Request body schema
class User(BaseModel):
name: str
age: int
# GET endpoint
@[Link]("/users/{user_id}")
async def get_user(user_id: int):
return {"id": user_id, "name": "Adnan"}
# POST endpoint
@[Link]("/users")
async def create_user(user: User):
return {"message": f"Created {[Link]}", "data": user}
# Run: uvicorn main:app --reload
• FastAPI auto-generates docs at /docs (Swagger UI)
• Uses Python type hints for automatic validation
• Async by default — great for high performance APIs

Q: What is OOP in Python?


class Animal:
def __init__(self, name): # constructor
[Link] = name
def eat(self):
print(f"{[Link]} is eating")
class Dog(Animal): # inheritance
def bark(self):
print("Woof!")
dog = Dog("Bruno")
[Link]() # Bruno is eating (inherited)
[Link]() # Woof!
Chapter 11

[Link] (Good to Have)


Components · Hooks · State · API Calls

Q: What are React hooks and the most important ones?


import { useState, useEffect } from 'react';
function UserCard() {
// useState: manage component state
const [user, setUser] = useState(null);
const [loading, setLoading] = useState(true);
// useEffect: run side effects (API calls, subscriptions)
useEffect(() => {
fetch('/api/user/1')
.then(res => [Link]())
.then(data => {
setUser(data);
setLoading(false);
});
}, []); // [] = run once on mount
if (loading) return <div>Loading...</div>;
return <div>{[Link]}</div>;
}
• useState: Store and update component data
• useEffect: Run code when component mounts, updates, or unmounts
• useContext: Access global state without prop drilling
• useRef: Reference DOM elements or persist values

Q: What is the difference between props and state?


// Props: data passed FROM parent TO child (read-only)
function Greeting({ name }) { // name is a prop
return <h1>Hello {name}</h1>;
}
<Greeting name="Adnan" /> // parent passes it
// State: data managed INSIDE the component (mutable)
function Counter() {
const [count, setCount] = useState(0); // internal state
return (
<button onClick={() => setCount(count + 1)}>
Count: {count}
</button>
);
}
■ Props flow DOWN (parent to child). State lives inside the component. When state changes, component
re-renders.
Chapter 12

HR & Behavioural Questions


Common Questions · How to Answer

Q: Tell me about yourself


Keep it professional, under 2 minutes. Follow this structure:

• Current role + what you do


• Key achievement or project
• Why you're interested in this role
Sample answer:
"I'm a Full Stack Developer with nearly 2 years of experience
building web apps and AI-powered microservices. In my current
role at Grocliq, I built a production FastAPI service that
processes 10,000+ queries daily using LLM integration.
I'm excited about this role because SechPoint's product
focus and international scale align with where I want
to grow as an engineer."

Q: Where do you see yourself in 5 years?


Focus on growth within the technical domain. Be honest but professional.
Sample answer:
"In 5 years I want to be a senior engineer who can
design and own large-scale backend systems. I want to
go deeper into distributed systems, cloud architecture,
and system design. I see SechPoint as a great place
to develop those skills given the international
client base and product complexity."

Q: Tell me about a challenge you faced and how you solved it


Use the STAR method: Situation → Task → Action → Result
S - Situation: "At Grocliq, our LLM microservice had
inconsistent parse rates dropping to 60%"
T - Task: "I needed to improve accuracy for production reliability"
A - Action: "I implemented a RAG architecture combining
web search retrieval with better prompt engineering
and added async retry logic with structured logging"
R - Result: "Parse accuracy went from 60% to 95%
across 10,000+ production queries"

Q: Why do you want to join SechPoint Tech?


Sample answer:
"SechPoint serves government-level clients across UAE,
Kenya, and Turkey — that scale and responsibility
is something I want to be part of. Being a product
company competing with Cisco means the engineering
challenges are real and impactful. I also have
hands-on Azure cloud experience that aligns with
the tech stack you're using."

Q: What is your biggest weakness?


Be honest but pick something you are actively improving.
Sample answer:
"I sometimes go deep into debugging an issue
on my own before asking for help. I've been
improving this by setting a personal time limit —
if I can't solve something in 30 minutes, I ask
a colleague or check documentation, which has
made me more collaborative and faster overall."

Good luck, Adnan! You've got this ■


Your experience with [Link], Docker, Azure, FastAPI, and Microservices is a strong fit for SechPoint.

You might also like