These are answers to some questions that I have come across.
These questions tend to be used in coding interviews when you apply for SWE positions.
Some of them are quite similar to questions that you come across in LeetCode or HackerRank.
In this repository there are two different types of questions. Questions asked in Java, and questions answered in Python.
Both types of questions can be answered in both Python and Java.
If you are asked any of these questions, please do not copy the ones in this repository. This repository exists to provide help for preparation.
These are your simple Java questions that you come across tutorials.
One question requires to create of a Doubly Linked List. The list must be able to add new elements at the start and end of the list. As well as delete referred elements node objects from the list. Additionally, the data in the head and tail of the list must be able to be read quickly.
The second question was a LeetCode question. Requires to find whether the number of brackets in a string is balanced. Meaning that the number of opening brackets is the same as the number of closing ones. Additionally, they are positioned in such a way that they close meaning that they do not remain open inside another pair of brackets. If the brackets are balanced, then true is returned otherwise false is returned. Additionally, any string inside the brackets is not taken into consideration.
The answers can be found here.
Different LeetCode questions are found in this section. They examine how well you can optimize the code and use the built-in features of Python to your advantage. The questions and answers can be found here.
Some of the questions are the following:
Create a function that takes a decimal digit X as input and returns the sum of X, XX, XXX, and XXXX. For example, if the input is 3, the output should be 3702 (3 + 33 + 333 + 3333). Answer
Write a program that takes a positive integer as input and returns "true" if the decimal representation of that integer doesn't have any odd digits, or "false" otherwise. Answer
Write a program to calculate the sum of the first 100 even-valued Fibonacci numbers. Answer
Create a program that takes two sorted arrays of integers as inputs and outputs an array of numbers that are present in both arrays. The returned array should not have duplicate values. Answer