-
In this section, you will find a collection of interview coding questions specifically tailored for ALX. These questions cover various topics and are designed to help you prepare for interviews, improve your problem-solving skills, and enhance your understanding of algorithms and programming concepts.
Feel free to explore the questions, work on the solutions, and contribute to the repository. Good luck with your preparation!
-
- Create a function
def pascal_triangle(n):
that returns a list of lists of integers representing the Pascal’s triangle of n.
- Create a function
-
- Implement a Python function
def canUnlockAll(boxes):
to determine if all the locked boxes can be opened. Given a list of locked boxes, each containing keys to other boxes, the function checks whether it's possible to open all the boxes. ReturnTrue
if all boxes can be opened, andFalse
otherwise.
- Implement a Python function
-
- Implement
minOperations(n)
in0-minoperations.py
, which calculates the minimum operations to obtain n 'H' characters using a text editor capable of Copy All and Paste. Return the minimum number of operations or 0 if it's impossible.
- Implement
-
- Implement a log parsing script in Python. The goal is to read input from standard input (stdin) line by line, processing the data, and calculating various metrics. The input format involves lines containing IP addresses, dates, HTTP requests, status codes, and file sizes. The script prints statistics after every 10 lines or upon a keyboard interruption (CTRL + C).
-
- It involves the implementation of a Python script creating a method,
validUTF8(data)
, the method overall checks whether a given data set is a valid UTF-8 encoding or not.
- It involves the implementation of a Python script creating a method,
-
- Implement a Python program
0-nqueens.py
that solves the N queens puzzle. The program takes an integer N (≥4) as a command-line argument and prints all non-attacking queen placements on anN×N
chessboard. If input is incorrect, appropriate error messages are displayed. The solution format is alist
of queen positions for each valid configuration. The program adheres to specified requirements, using only thesys
module for imports.
- Implement a Python program
-
- Implement a JavaScript script
0-starwars_characters.js
for the Star Wars Characters project. The script interacts with the Star Wars API to fetch and print character names from a specifiedmovie ID
passed as a command-line argument. The characters are displayed in the same order as the characters list in the/films/ endpoint
. The script adheres to specified requirements, using therequest
module for HTTP requests and following semistandard JavaScript style.
- Implement a JavaScript script
-
- Implement a Python script
0-rotate_2d_matrix.py
for the Rotate 2D Matrix project. The script uses an in-place algorithm to rotate ann x n
2D matrix by 90 degrees clockwise. It adheres to specified requirements, includingpycodestyle
for style compliance, no external module imports, and proper documentation. The script takes a2D matrix
as input, rotates it in-place, and does notreturn
anything. Test cases inmain_0.py
validate the correctness of the rotation algorithm.
- Implement a Python script
⭐ If you find these coding problems useful in your journey of software engineer, please consider giving me a star on GitHub! Your support helps me continue to innovate and share.
If you have a new coding question to add or if you find any issues with existing questions, please feel free to contribute by opening an issue, and don't forget to follow me on my github Josh-Techie
-
@Josh-techie
| Software Engineer StudentReach out to me if you need any help or have any questions.