technical questions Flashcards
What is URI
A URI (Uniform Resource Identifier) is a string of characters used to uniquely identify a resource on the internet or a local system. It provides a way to locate and access resources, such as web pages, files, or services. A URI can be classified into two types:
URL (Uniform Resource Locator): A specific type of URI that not only identifies a resource but also provides a way to locate it (e.g., an address to access a resource on the web). For example, https://www.example.com is a URL.
URN (Uniform Resource Name): A URI that uniquely identifies a resource but doesn’t give its location. An example could be urn:isbn:0451450523, which identifies a book by its ISBN but doesn’t tell you where to find it.
What are examples of block elements in HTML?
H1/2 etc., li, p, div
What are examples of inline elements in HTML?
img, span, text formatting elements, a, button
What is an operating system?
Interface between the human and the machine. The software that allows normal human beings to use the computer hardware. It also provides a software development kit (or SDK) that allows other developers to create programs/applications for the computer
What is Linux?
Open-source operating system mainly used on servers and to manage servers. Also manages multi-users environment - supports many users logging in at the same time
What’s a virtual machine?
An operating system running on top of your existing operating system as an independent program. E.g. VMWare, WINE, Repl.it
what is sudo
sudo basically means “run as Administrator”.
What is the “native language” of a computer?
Electrical signals
What is a kernel (in an OS)?
A kernel is the core component of an operating system (OS) that manages communication between hardware and software. It acts as a bridge between applications and the computer’s hardware, handling process management, memory management, device drivers, and system security.
What is async?
where a program can perform tasks concurrently, without waiting for one task to complete before starting another.
tasks can run in the background, allowing the program to continue executing other operations while waiting for slower tasks to finish.
What is a server?
A server is a specialized computer or system that provides services or resources to other computers (clients) over a network. It listens for requests from clients and responds with the requested data or action.
What is JSX?
JSX looks like HTML and has the same functionality as HTML elements but they are JavaScript in disguise. When you run a React program, the JSX will be converted to JavaScript.
What is transpilation in the context of React?
Process where React code is translated into browser-compatible JS
How is the JS in Express and React different?
Express uses CommonJS, while React uses ES6 JavaScript
When does a React component re-render itself?
Whenever the component’s state or prop changes
What does strongly typed mean?
In a strongly typed language, the type of a variable is explicitly defined, and you cannot perform operations that are inconsistent with the variable’s type.
What is assembly?
Assembly, or assembly language, is a low-level programming language that is closely related to the machine code specific to a computer’s architecture.
What’s the difference between compiled and interpreted languages
For compiled, the code is translated to machine code before execution. For interpreted, code is executed line by line at runtime. For compiled, errors are detected at compilation time. For interpreted, errors are detected at runtime.
How is Java different from traditional compiled languages?
Java uses a virtual machine for each operating system. Java code is compiled for the virtual machine instead. So any Java code you write works for any operating system that supports Java
What executes Java code?
The Java Virtual Machine, aka the Java Runtime Environment (JRE)
What are frequent uses of Java?
Backend operations, big data processing
What’s the difference between primitive and reference data types?
Primitive:
- Actual values stored directly in memory
- Not objects, hence no methods
Reference
- Stores memory reference to an object
- Has methods
What is UML?
A standardised visual language used to model and design software systems e.g. class diagram
What are the four access modifiers in Java and how are they different?
Package (None specified): any functions in the same package can access
Private: Only functions in the same class can access
Protected: Only functions in the same class or children classes can access
Public: Any functions can access
What is a static method?
A method that belongs to a class and can be called without creating an instance
What is constructor overloading in Java?
Constructor overloading in Java allows a class to have multiple constructors with the same name but different parameter lists.
What is method overloading in Java?
A feature that allows multiple methods in the same class to have the same name but different parameter lists.
What are the 5 pillars of OOP and describe each of them
Encapsulation:
- Refers to integrating data (variables) and code (methods) into a single unit.
- Class variables (fields) are kept private to prevent direct access from outside the class.
- Public methods (get and set) are used to access and modify private fields in a controlled manner.
Abstraction:
- Hiding of implementation details from users to prevent direct manipulation of data. For example, a vehicle class with an abstract Stop method
Inheritance:
- Concept in Java that allows one class to inherit the properties (fields) and behaviors (methods) of another class. For example, a car class inherits from a vehicle class
Polymorphism:
- An OOP concept that allows objects of different classes to be treated as objects of a common super class. Through method over-riding, methods inherited from the super class can perform different tasks depending on the class. Example, if we have a cat class and dog class inheriting from an animal class. And all three have a method called Sound, method overriding can happen such that the cat object’s sound can be meow and the dog object’s sound is woof.
Composition:
- Concept where a class contains objects of other classes as it’s instance variables, rather than inheriting from them. Example, car class with an instance variable of an engine object
What are the 5 HTTP methods?
GET, POST, PUT, PATCH, DELETE
What is a client?
A client is a device, application, or user that requests services or resources from a server over a network. The client sends a request, and the server processes it and responds with the requested data or service.
What is a http protocol?
Protocol used for transferring data over the web. It defines the rules for how clients (like browsers) and servers communicate with each other to request and transfer data (like web pages, images, videos, etc.). HTTP is the foundation of data communication on the World Wide Web.
What does a RESTFul API consist of?
Many URLs (each known as an endpoint)
Each URL is associated with a function
What is a RESTFUl API?
- Uses the five HTTP verbs (i.e methods) to perform operations on resources
- Accepts data payload in the JSON format (XML is a possible choice)
- Returns a HTTP status code to indicate success or failure
- Returns JSON as response (XML is a possible choice)
What are examples of GET endpoints?
- Retrieving a website by it’s URL
- Finding data records via a search engine
- Viewing detailed information of a product
What are examples of POST endpoints?
- Creating a new account
- Adding a comment to a social media post
- Placing a new order
What is an endpoint in the context of RESTFul API
In the context of a RESTful API, an endpoint refers to a specific URL or URI (Uniform Resource Identifier) where an API can access the resources it needs to perform an action (such as fetching, creating, updating, or deleting data).
what’s the difference between PUT and PATCH
PUT: Updates/replaces the entire resource
PATCH: Partially updates the resource
what are the 5 categories of HTTP responses?
100s - request is on-going
200s - OK
300s - redirects (trying a different URL)
400s - not found or authorization errors
500s - internal server errors (something
went wrong at the server side)
What is NodeJS and how is it different from browser-based JavaScript?
Node.js® is a JavaScript runtime environment built on Chrome’s V8 JavaScript engine. It allows you to run JavaScript on the server-side. Chrome V8 Engine is a standalone JavaScript interpreter
Browser-based JavaScript runs within a browser
What is NPM in NodeJS?
Node Package Manager. It’s used to create a new Node Application, and installs modules, which are 3rd party source code that can be reused
What is a package in the context of NodeJs?
A package is a bundle of code made that:
- Solves a specific problem or provides some general functionalities
- Can be imported into new NodeJS applications to use
What is the package.json file?
- Stores decisions made while setting up the application
- Stores the dependencies (third party modules) you are going to use
What’s the difference between IP address and port number?
IP address: Identifies the device on the network
Port Number: Identifies the specific application/service on the device
what’s the difference between dynamic and static sites?
Static:
- Each page is a HTML file
- Adding new content of modifying existing content requires programmer to step in
Dynamic
- Each page generated by JS code
- No updating of HTML file required to show new content
- New content can be added or existing content modified without programmer’s intervention
What is express?
Express.js (or simply Express) is a web application framework for Node.js.
what’s the difference between undefined and null in javascript?
Undefined
- Indicates a variable has been declared but not initialized or has no value assigned.
Null
- Variable has been declared and given the value of null.
What does JSON stand for?
JavaScript Object Notation
How does using Axios load a file?
By using a GET request
What is Model View Controller?
MVC (Model-View-Controller) is a design pattern used to organize code in web applications. It separates an application into three interconnected components:
1️⃣ Model – Handles the data and business logic.
2️⃣ View – Handles the UI (User Interface).
3️⃣ Controller – Handles user input and updates the Model & View.
What is an API?
An API (Application Programming Interface) is a set of rules that allows different software applications to communicate with each other. It defines how requests and responses should be structured, enabling applications to exchange data and functionality.
What does statelessness mean in the context of RESTful API?
Statelessness means that each request from a client to the server is independent and contains all the necessary information to process it. The server does not store any session-related data between requests. This makes things more scalable.
What’s the difference between authentication and authorisation?
Authentication: Verifies who you are
Authorisation: Determine what you can do
What is React?
React is a JavaScript library for building user interfaces. It allows developers to create reusable UI components and efficiently manage the state and rendering of components through the Virtual DOM.
how does await relate to async?
The await keyword is used inside an async function to tell JavaScript to pause the execution of that function until the promise is resolved or rejected. It makes the code more readable and easier to manage.
What’s the difference between relational and non-relational databases
Relational:
- Store data in structured tables with rows and columns
- Tables schema must be pre-defined
- They use keys (primary, foreign) to maintain relationships between tables, ensuring data integrity and consistency
- Best for structured data with complex queries, transactions, and data integrity (e.g., banking systems, CRMs).
Non- relational:
- Data can be stored in various formats, e.g. key-value pairs, documents, graphs etc.
- Schema-less, more flexible in how data is stored
- Ideal for unstructured or semi-structured data, fast-growing applications, or where flexibility and scalability are key (e.g., social media platforms, big data analytics).
What is ACID?
Set of properties to help guarantee reliable processing of data base transactions:
- Atomicity: All the operations in a transaction are executed successfully, or none are. E.g. In a bank transfer, if money is deducted from one account but not added to the other, the transaction will be aborted to avoid inconsistencies.
- Consistency: Only valid data is saved. A transaction takes the database from one valid state to another, ensuring all data integrity rules are maintained (e.g. foreign keys, constraints) If you have a rule that the balance of an account cannot be negative, the transaction will be rejected if it violates that rule.
- Isolation: Transactions are isolated from one another. Even if transactions are happening concurrently, they don’t interfere with or affect one another. the results of one transaction are not visible to others until it is fully completed. E.g. If two users are transferring money from the same account at the same time, each transaction will be executed as if it were the only one in progress
- Durability: Once a transaction is committed, its results are permanent, even if the system crashes immediately afterward. The changes made by the transaction are stored in a non-volatile memory, ensuring they survive power outages or failures. E.g. After a bank transfer transaction is successfully completed, the money transfer remains recorded in the database, even if the server goes down right after the transaction.
What is AJAX?
Stands for Asynchronous JavaScript and XML. It’s a technique used in web development to create dynamic, interactive web pages. It allows a web page to request and receive data from a server asynchronously, without needing to reload the entire page. This improves the user experience by making web applications faster and more responsive.
What is Java Reflection?
Reflection is a feature in the Java programming language. It allows an executing Java program to examine or “introspect” upon itself, and manipulate internal properties of the program. For example, it’s possible for a Java class to obtain the names of all its members and display them.
What is closure in javascript?
A closure occurs when a function is able to remember and use variables from the scope in which it was created, even after that scope has been finished or returned.
EXAMPLE:
function greet(name) {
let greeting = “Hello, “;
return function() {
console.log(greeting + name); // This function remembers greeting
and name
};
}
const sayHello = greet(“Alice”); // greet
returns a function with access to greeting
and name
sayHello(); // Logs: “Hello, Alice”
Explanation:
- greet is a function that takes name as an argument and defines a local variable greeting.
- greet returns a new function that, when called, accesses both greeting and name to log a greeting.
- When you call greet(“Alice”), it returns a new function (sayHello) that “remembers” the greeting and name variables.
- When you call sayHello(), it still remembers the values of greeting and name (even though greet has already finished executing) and logs the message “Hello, Alice”.
What’s the difference between encryption and hashing?
- Encryption is used to protect data by converting it into a secure format that can only be read or decrypted by someone with the correct decryption key. It is reversible.
- Hashing is used to verify data integrity. It converts data into a fixed-size string of characters (a hash value), which represents the original data but cannot be reversed to retrieve the original data. E.g. When you store a password in a database, it is hashed. When you log in again, the system hashes the input password and compares it with the stored hash to verify if it matches.
What is test-driven development?
A software development methodology where tests are written before the actual code.
- The process follows a repetitive cycle of writing tests, writing the minimum code to pass the tests, and refactoring the code for improvement.
- The idea is to ensure that code works as expected from the beginning and that it continues to work as new features or changes are added.
What is spring boot?
Open-source framework used to simplify the development of Java-based applications, especially for microservices and web applications. It is a part of the Spring Framework ecosystem, and it makes it easier to set up, configure, and deploy Java applications with minimal effort.
What is multi-threading in Java?
Multithreading in Java is a concurrent execution technique that allows multiple threads to run simultaneously within a single program. A thread is a lightweight process that runs a part of the program code. By using multiple threads, Java applications can perform several tasks concurrently, improving the efficiency and performance of programs, especially for tasks that are I/O-bound or computationally intensive.
What is the SOLID principle?
Five object-oriented design (OOD) principles to help developers write more maintainable, flexible, and scalable code.
S - Single Responsibility: A class should have only one reason to change, meaning it should have only one job or responsibility.
O - Open/Closed: Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.
L - Liskov Substitution: Objects of a superclass should be replaceable with objects of a subclass without affecting the correctness of the program. If you have a Bird class and a Penguin subclass, you should be able to replace a Bird object with a Penguin object without introducing bugs
I - Interface Segregation: A client should never be forced to implement an interface that it doesn’t use. Example: Instead of having a large Machine interface with methods like print(), scan(), fax(), a Printer interface should only include the print() method, and a Scanner interface should only include the scan() method. Classes can implement just the interfaces they need.
D - Dependency Inversion: High-level modules should not depend on low-level modules. They should depend on abstractions. E.g. Instead of a class like OrderProcessor directly creating an instance of a PaymentGateway, you would pass an interface (e.g., PaymentProcessor) to OrderProcessor. This way, OrderProcessor can work with any payment system that implements the PaymentProcessor interface, making it easier to change payment systems in the future.
What is the purpose of jwt and what does it consists of?
Used for Authentication, authorization, secure data exchange (data is in the payload). Without use of sessions
Contains header (metadata about token), payload (e.g. user info and expiry), and signature to ensure it hasn’t been tampered with (created by signing the header and payload with a secret key)
What is CI/CD?
CI/CD stands for Continuous Integration and Continuous Delivery/Continuous Deployment.
Continuous integration (CI) refers to the practice of automatically and frequently integrating code changes into a shared source code repository.
Continuous delivery stops short of automatic production deployment, while continuous deployment automatically releases the updates into the production environment.
What happens when go to an address via the browser?
- DNS Lookup: The browser resolves the domain name to an IP address.
- Once the browser finds the IP address of the server, it will create a TCP/IP connection with the server
- HTTP Request: Browser asks the server for the HTML document
- Server Response: Browser receives the HTML file and starts processing.
- Parsing HTML: Browser creates the DOM.
- CSS and JavaScript: The browser loads and applies CSS and runs JavaScript.
- Render Tree: Combining the DOM and CSSOM to render the page.
- Layout: The browser calculates the size and position of elements.
- Paint: Visual details are filled in.
- Compositing: The browser puts layers together for efficient rendering.
- Event Handling: JavaScript enables interactivity.
- Rendering: Final page is displayed.
What is TCP/IP?
TCP/IP (Transmission Control Protocol/Internet Protocol) is a set of communication protocols used to interconnect devices on the internet and local networks. It is the foundational suite of protocols that enables devices to send and receive data over the network.
What is whitebox testing
software testing method where the internal structure, code, and logic of an application are tested. Unlike Blackbox Testing, which focuses on functionality without looking at the code, Whitebox Testing requires knowledge of the source code.
What is a constructor and destructor?
In object-oriented programming (OOP), constructors and destructors are special functions used to initialize and clean up objects when they are created and destroyed, respectively.
Constructor: Initialised the objects and it’s data members
Destructor: Cleans up resources (e.g. deallocates memory)
What is CORS for in express
In Express.js, CORS (Cross-Origin Resource Sharing) is used to allow or restrict requests from different origins (domains).
what are hooks in react and what are some examples?
Hooks are functions that let you “hook into” React state and lifecycle features from function components
Examples: useState, useEffect
Why do we need to catch exceptions?
It prevents applications from crashing unexpectedly and allows us to handle errors gracefully (through meaningful error messages).
What is method overloading vs overriding.
What are checked and unchecked exceptions in Java. Give a few examples.
What is JDK, JRE and JVM
What is the difference between == and .equals() in Java
How does garbage collection work in Java
Explain the difference between Abstraction and Encapsulation in Java
Can you explain what lambda expressions are in Java 8 and how they can be used with functional interfaces? Provide a simple example
How to handle null pointer exception?
Use try-catch blocks when you expect NPR in specific scenarios
What are the main features of Java
Platform independence (JVM), OOP principles, automatic memory management (Garbage Collection), robustness, multithreading,