Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
GeekyAnts is a renowned software development company specializing in web and mobile app development. They offer innovative solutions and a collaborative work environment. To join GeekyAnts, you need to successfully navigate their rigorous interview process.
In this article, we'll cover some common Geekyants interview questions & what you can expect.
Beginner-Level Geekyants Interview Questions
1. Explain the concept of variables in JavaScript.
Variables in JavaScript are used to store and manipulate data. They are essentially named containers that hold values.
Key points about variables in JavaScript:
Declared using the keywords var, let, or const.
Can hold different types of data, such as numbers, strings, booleans, objects, or arrays.
Variable names are case-sensitive and must follow certain naming conventions.
Variables declared with var have function scope or global scope, while let and const have block scope.
Variables declared with const cannot be reassigned, while var and let allow reassignment.
2. What is the difference between SQL and NoSQL databases?
Aspect
SQL Databases
NoSQL Databases
Data Model
Structured, table-based
Unstructured or semi-structured
Schema
Fixed schema
Flexible or schema-less
Scalability
Vertical scaling
Horizontal scaling
Query Language
SQL (Structured Query Language)
Varies (e.g., JSON, key-value)
ACID Compliance
Typically ACID compliant
Varies, some provide eventual consistency
3. Write a basic SQL query to select all records from a table.
SELECT * FROM table_name;
4. What is a REST API?
A REST (Representational State Transfer) API is an architectural style for designing networked applications. It defines a set of constraints and principles for building web services that are lightweight, scalable, and easy to maintain.
Key characteristics of a REST API:
Uses HTTP methods (GET, POST, PUT, DELETE) to perform operations on resources.
Employs a stateless client-server communication model.
Utilizes unique URLs (endpoints) to identify resources.
Returns data in formats like JSON or XML.
5. Write a JavaScript function to add two numbers.
function addNumbers(num1, num2) {
return num1 + num2;
}
6. Describe the concept of multitasking.
Multitasking refers to the ability of an operating system to execute multiple tasks or processes concurrently. It allows multiple programs or threads to run simultaneously, sharing the system's resources efficiently.
Key points about multitasking:
Enables concurrent execution of tasks, improving overall system performance.
Achieved through time-sharing, where each task is allocated a small time slice to execute.
Managed by the operating system's scheduler, which determines the order and priority of task execution.
Can be preemptive (OS interrupts tasks) or cooperative (tasks voluntarily yield control).
7. Explain the role of a version control system like Git.
A version control system (VCS) like Git is a tool that helps manage and track changes to files and projects over time.
Key roles of a VCS:
Keeps a historical record of all changes made to files, allowing easy tracking and reverting if needed.
Facilitates collaboration by enabling multiple people to work on the same project simultaneously.
Provides branching and merging capabilities to manage different versions and features of a project.
Acts as a central repository to store and share code among team members.
8. What is an IP address?
An IP (Internet Protocol) address is a unique numerical identifier assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves as a logical address that enables devices to communicate and be identified on the network.
Key points about IP addresses:
Consists of a series of numbers separated by dots (e.g., 192.168.0.1).
Can be either IPv4 (32-bit) or IPv6 (128-bit) format.
Assigned dynamically (DHCP) or statically to devices.
Used for routing and delivering data packets between devices on a network.
9. What is the function of a router?
A router is a networking device that connects multiple networks and forwards data packets between them.
Key functions of a router:
Determines the optimal path for data packets to reach their destination based on network addresses.
Enables communication between devices on different networks by forwarding packets across network boundaries.
Provides network address translation (NAT) to allow multiple devices to share a single public IP address.
Can act as a firewall to enhance network security by filtering incoming and outgoing traffic.
10. Explain the difference between LAN and WAN.
Aspect
LAN (Local Area Network)
WAN (Wide Area Network)
Coverage
Covers a small geographic area (e.g., office, building)
Covers a large geographic area (e.g., cities, countries)
Ownership
Owned and managed by a single organization
Owned and managed by multiple organizations or service providers
Speed
High-speed connections (e.g., Ethernet, Wi-Fi)
Varies, typically slower than LAN due to distance and infrastructure
Cost
Relatively inexpensive to set up and maintain
More expensive due to the need for leased lines or specialized equipment
Intermediate Level Geekyants Interview Questions
11. Explain the concept of responsive design.
Responsive design is an approach to web design that aims to create websites that adapt and provide an optimal viewing experience across a wide range of devices, including desktops, tablets, and mobile phones.
Key principles of responsive design:
Flexible layouts that adjust to different screen sizes using relative units and media queries.
Fluid images and media that scale proportionally to fit the available space.
Media queries to apply different styles based on the device's screen size and resolution.
Prioritized content and navigation for smaller screens, ensuring usability on mobile devices.
12. What is a CSS preprocessor?
A CSS preprocessor is a tool that extends the capabilities of traditional CSS by introducing additional features and syntax. It allows developers to write more maintainable, reusable, and efficient CSS code.
Key features of CSS preprocessors:
Variables for storing and reusing values throughout the stylesheet.
Nesting selectors to create more readable and hierarchical code structure.
Mixins for encapsulating and reusing sets of CSS properties.
Functions and operators for performing calculations and manipulating values.
Imports and partials for modularizing and organizing CSS code into smaller, manageable files.
13. Explain the concept of promises in JavaScript.
Promises in JavaScript provide a way to handle asynchronous operations and manage their results or errors. They represent a value that may not be available immediately but will be resolved at some point in the future.
Key points about promises:
It was created using the Promise constructor, which takes a callback function (executor) as an argument.
The executor function receives two arguments: resolve and reject, used to control the promise's outcome.
Promises have three states: pending (initial state), fulfilled (operation completed successfully), or rejected (operation encountered an error).
It can be chained using .then() and .catch() methods to handle the fulfilled and rejected states, respectively.
Enable cleaner and more readable asynchronous code compared to nested callbacks.
14. Describe how inter-process communication works.
Inter-process communication (IPC) refers to the mechanisms and techniques used by processes to exchange data and coordinate their activities.
Key points about IPC:
Enables processes to share information, synchronize actions, and collaborate on tasks.
Can be achieved through various methods, such as:
Shared memory: Processes access a common region of memory to read and write data.
Message passing: Processes send and receive messages through communication channels (e.g., pipes, sockets).
Signals: Processes send and receive system-level notifications to convey information or trigger actions.
15. What is the purpose of a firewall?
A firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules.
Key purposes of a firewall:
Establishes a barrier between a trusted internal network and an untrusted external network (e.g., the internet).
Filters and restricts network traffic based on specified rules and policies.
Prevents unauthorized access, malicious attacks, and data breaches from external sources.
Can be hardware-based (separate device) or software-based (running on a server or individual computer).
Helps enforce network security policies and protect the confidentiality, integrity, and availability of network resources.
16. Explain the concept of closures in JavaScript.
Closures in JavaScript are a fundamental concept that allows a function to access variables from its outer (enclosing) lexical scope even after the outer function has finished executing.
Key points about closures:
A closure is created when a function is defined within another function, allowing the inner function to access variables and parameters of the outer function.
The inner function retains access to the outer function's scope, even after the outer function has returned.
Closures provide a way to create private variables and encapsulate data, as the enclosed variables are not accessible from outside the closure.
Closures are commonly used for data privacy, event handlers, and creating function factories.
17. Explain the difference between a process and a thread.
Aspect
Process
Thread
Definition
An instance of a program being executed
A lightweight unit of execution within a process
Memory
Has its own memory space
Shares the same memory space with other threads of the same process
Communication
Communicates through inter-process communication (IPC) mechanisms
Communicates through shared memory and synchronization primitives
Context Switching
Requires more overhead due to memory and resource allocation
Requires less overhead as threads share the same memory space
Control
Independently controlled by the operating system
Manaaged by the process that created it
18. Describe how you would handle authentication in a web application.
Authentication is the process of verifying the identity of users and granting access to protected resources based on their credentials.
User Registration: Provide a registration form for users to create an account, validate inputs, and securely store user credentials (e.g., hashed passwords) in a database.
User Login: Present a login form for users to enter their credentials, validate the provided credentials against the stored user information, and establish an authenticated session upon successful login.
Session Management: Store the session or token securely on the server-side, include it in subsequent requests to identify the authenticated user, and implement session expiration and logout mechanisms.
Access Control: Define user roles and permissions, protect sensitive routes and resources by verifying authentication and authorization, and implement server-side checks to ensure only authorized users can access protected resources.
Secure Communication: Use HTTPS to encrypt data transmission, implement secure cookie settings, and follow security best practices to protect sensitive information.
Password Security: Encourage strong passwords, implement password complexity requirements, and use secure password hashing algorithms to store passwords in the database.
19. How does DHCP work?
DHCP (Dynamic Host Configuration Protocol) is a network protocol that automatically assigns IP addresses and other network configuration parameters to devices on a network.
Let’s see how it works :
DHCP Discovery: The device broadcasts a DHCP discovery message to locate available DHCP servers.
DHCP Offer: DHCP servers respond with a DHCP offer message containing an available IP address and other configuration parameters.
DHCP Request: The device selects an offer and sends a DHCP request message to the chosen server, requesting the offered IP address.
DHCP Acknowledgement: The server sends a DHCP acknowledgment message to the device, confirming the IP address assignment and lease duration.
20. Explain how a scheduler works in an operating system.
A scheduler in an operating system is responsible for determining which processes or threads should be executed by the CPU at any given time.
Let’s see how it works :
Process States: The scheduler keeps track of the state of each process (running, ready, waiting, or terminated) and manages their transitions.
Scheduling Algorithms: The scheduler uses algorithms like FCFS, SJF, Priority, or Round Robin to determine the order and priority of process execution.
Context Switching: The scheduler saves the current state of a process and loads the state of the next process to be executed.
Process Creation and Termination: The scheduler handles the creation and initialization of new processes and cleans up resources when a process completes or terminates.
Advanced Level Geekyants Interview Questions
21. Explain the concept of network topology.
Network topology refers to the physical or logical layout of a network, describing how devices are connected and how data flows between them.
Physical Topology: Describes the physical arrangement of devices, cables, and network components (e.g., bus, star, ring, mesh).
Logical Topology: Describes how data flows between devices, regardless of their physical arrangement (e.g., Ethernet, Token Ring).
Hybrid Topology: Combines elements of different physical and logical topologies for flexibility and scalability.
22. Write a JavaScript function to perform a deep copy of an object.
function deepCopy(obj) {
if (typeof obj !== 'object' || obj === null) {
return obj;
}
let copy = Array.isArray(obj) ? [] : {};
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
copy[key] = deepCopy(obj[key]);
}
}
return copy;
}
The deepCopy function recursively copies an object and its nested objects, creating a new object with the same structure and values.
23. Describe the role of the kernel in an operating system.
The kernel is the core component of an operating system that acts as an interface between the hardware and the software.
Kernel plays a crucial role in OS like :
Resource Management: The kernel manages system resources (CPU, memory, I/O devices) and allocates them to processes.
Process Management: The kernel creates, schedules, and terminates processes, and provides inter-process communication mechanisms.
Memory Management: The kernel manages memory allocation, protection, and virtual memory mechanisms.
Device Drivers: The kernel includes drivers that facilitate communication between the operating system and hardware devices.
System Calls: The kernel provides system calls that allow user-level processes to request services from the operating system.
24. What is the difference between paging and segmentation?
Aspect
Paging
Segmentation
Unit of Memory
Fixed-size pages
Variable-size segments
Fragmentation
Suffers from internal fragmentation
Suffers from external fragmentation
Allocation
Non-contiguous allocation of pages
Contiguous allocation of segments
Address Translation
Page table maps virtual page numbers to physical frame numbers
Segment table maps segment names to base addresses and limits
Flexibility
More flexible as pages can be allocated from anywhere in physical memory
Less flexible as segments must be contiguous in physical memory
Sharing and Protection
Pages can be shared and protected at a fine-grained level
Segments can be shared and protected at a fine-grained level, allowing for precise access control.
25. Write a function to perform binary search on a sorted array.
SSL (Secure Sockets Layer) and its successor TLS (Transport Layer Security) are cryptographic protocols that provide secure communication over a network.
It works in the below mentioned manner :
Handshake: The client and server establish a secure connection by exchanging digital certificates and generating a session key.
Key Exchange: The client encrypts the session key using the server's public key, and the server decrypts it using its private key.
Data Encryption: The client and server use the shared session key to encrypt and decrypt the data exchanged between them.
Message Authentication: SSL/TLS uses hash functions to ensure the integrity of the transmitted data and detect tampering.
Improved support with flow labels and traffic classes
Broadcast
Supported
Not supported (replaced by multicast)
28. How do you perform a breadth-first search (BFS) on a graph?
Steps to perform BFS on a graph:
Choose a starting node and add it to a queue.
Mark the starting node as visited.
While the queue is not empty, do the following:
Dequeue a node from the queue.
Process the dequeued node (e.g., print its value).
Enqueue all the unvisited neighbors of the dequeued node.
Mark the visited neighbors as visited.
Repeat step 3 until the queue is empty.
Example of BFS in python :
from collections import deque
def bfs(graph, start):
visited = set()
queue = deque([start])
visited.add(start)
while queue:
node = queue.popleft()
print(node)
for neighbor in graph[node]:
if neighbor not in visited:
queue.append(neighbor)
visited.add(neighbor)
29. What is a deadlock in databases, and how can it be prevented?
A deadlock in databases occurs when two or more transactions are waiting for each other to release locks on resources, resulting in a circular dependency.
We can prevent deadlock in below mentioned ways :
Timeout mechanism: Set a timeout period for transactions to acquire locks, and abort if exceeded.
Resource ordering: Define a specific order in which resources must be acquired to avoid circular wait.
Deadlock detection and resolution: Periodically check for deadlocks and resolve by aborting one or more transactions.
Two-phase locking (2PL): Transactions acquire all necessary locks before executing and release them only after completing.
Optimistic concurrency control: Allow transactions to execute without locks and check for conflicts at commit time.
30. Write a program to check if the strings are rotations of each other or not
def are_rotations(str1, str2):
if len(str1) != len(str2):
return False
concatenated = str1 + str1
if str2 in concatenated:
return True
else:
return False
# Example usage
string1 = "waterbottle"
string2 = "erbottlewat"
result = are_rotations(string1, string2)
print(result)
Output:
True
The program checks if two strings are rotations of each other by concatenating the first string with itself and checking if the second string is a substring of the concatenated string. If the lengths of the strings are different, they cannot be rotations of each other.
Conclusion
We hope you have gained some insights on Geekyants Interview Questions through this article. We hope this will help you excel in your interviews for Geekyants.
You can also practice coding questions commonly asked in interviews on Coding Ninjas Code360.