Skip to main content

Questions tagged [interview-questions]

This tag is for questions that came up in an interview.

Filter by
Sorted by
Tagged with
10 votes
3 answers
2k views

I'm preparing for entry-level C++ developer interview and decided to implement some of std:: members. Here's my implementation of std::optional. I would be grateful ...
BreamLashed's user avatar
0 votes
3 answers
241 views

I’m working with custom exceptions in Java for stack operations. However, I’m unsure if the exception handling is being handled properly, especially in terms of how exceptions are thrown and caught. ...
Somesh's user avatar
  • 11
4 votes
1 answer
118 views

I recently was given a take home assignment for a job interview. The task was specified like so: ...
genghiskhan's user avatar
5 votes
2 answers
260 views

I would appreciate feedback on the code below which I created during an one-hour live interview session. In particular, while the interviewer pretty much said nothing during the interview, their ...
charlielao's user avatar
5 votes
2 answers
699 views

The code below was written for an interview question of designing a load balancer with only a register() method. ...
drets's user avatar
  • 313
13 votes
8 answers
2k views

I was asked this problem in an interview, and this is the solution I came up with. I was told it's not the most efficient solution, but I can't think of any other solution. This is the problem. ...
Jacob's user avatar
  • 133
4 votes
4 answers
245 views

I got this task to evaluate my knowledges in PHP. I was asked to avoid using functions like strrev() or array_reverse(). ...
user avatar
2 votes
2 answers
175 views

This is a popular interview question. It is meant to be done within 30 minutes. The task is to implement a thread-safe performant Bank Account API that allows to transfer, deposit, withdraw and check ...
Sasha Shpota's user avatar
7 votes
2 answers
1k views

This is a popular interview question. It is meant to be done within 45 minutes. The task is to implement a thread-safe performant in-memory URL Shortener. My implementation is based on two maps that ...
Sasha Shpota's user avatar
5 votes
1 answer
547 views

I recently received the following code challenge in connection with a job interview. After submitting, I was rejected. I want to know what (if anything) I could have done better here. Task Your task ...
Russ J's user avatar
  • 201
5 votes
1 answer
300 views

I saw this question on one of the socials, presented as an Apple interview question. I have had to paraphrase as it was not given in text format. (Credit: Instagram @greghogg5) Given a string (S) ...
Romeo Lima's user avatar
4 votes
1 answer
227 views

Background Saw this problem on TheJobOverflow which seems to be a LeetCode question. It bothered me that the "challenge" of this problem was to recognize the need for a specific data-type (...
WesAtWork's user avatar
  • 171
11 votes
4 answers
2k views

I was recently doing an assignment for a job interview, which asked to create a simple key value database with 4 command line operations: create key value: Adds a key value pair/updates an existing ...
P4PL4's user avatar
  • 111
3 votes
3 answers
291 views

Recently I had an interview question about extracting records that matched certain criteria from a 2D List of strings. The premise was a CSV file was parsed into a ...
Dragonrage's user avatar
2 votes
1 answer
141 views

This is a interview practice question from BFE.dev. Currying is a useful technique used in JavaScript applications. Please implement a curry() function, which ...
Christopher Fimbel's user avatar
3 votes
2 answers
138 views

A firm gave me a small take home assignment which asks you to implement text formatter. Given some text which only contains alphanumerics and spaces (only one space between words), we should align it ...
Rohith Uppala's user avatar
4 votes
7 answers
323 views

Requesting for a code review for a scala implementation. Problem Given an expression string made of numbers and operators +,-,/,* , break it in a list of Integer or ...
vikrant's user avatar
  • 405
4 votes
2 answers
6k views

I was recently presented with the following problem... You are given a collection of singly-linked lists (SLLs). Return true if any of them share a common node (or “intersect”), or false otherwise. ...
James Law's user avatar
  • 489
2 votes
1 answer
265 views

I'm trying to come up with a solution to this interview question: You have a stream of RPC requests coming into a server which is being logged. Each log entry is of the form [id, timestamp, type ('...
Eugene Yarmash's user avatar
4 votes
2 answers
272 views

I was given a test assignment for the interview of the company and below is the code that I shared with them. I developed it using .NET 6 (Core) Console application. Actual problem statement: Coding ...
user19031158's user avatar
5 votes
1 answer
294 views

The elevator system has the following functions: There is one building, and the number of elevators can be set arbitrarily. Requests can be sent from outside the elevators, in this case the request ...
Hangji He's user avatar
2 votes
1 answer
336 views

I wrote this code as a refactor of code I saw on Programiz. I thought about this refactor before going to bed and implemented it successfully in code. ...
dylanm's user avatar
  • 23
3 votes
2 answers
264 views

This is a continuation of Goat racing up a hill (C++ hiring take-home) . This is an interview take-home challenge that has been translated to avoid compromising the company's question. Problem ...
Reinderien's user avatar
  • 71.2k
6 votes
4 answers
1k views

I am solving this problem where the function returns the number of times a pattern is found in a said string word. It could be easily solved via ...
xyf's user avatar
  • 508
12 votes
3 answers
4k views

This is an interview take-home challenge that has been translated to avoid compromising the company's question. Problem statement You are a goat that needs to race up a hill. Designated waypoint rocks ...
Reinderien's user avatar
  • 71.2k
2 votes
3 answers
1k views

I recently had a programming interview with a Silicon Valley tech company and wanted some different opinions on one of the problems they had me solve and how others might complete it. Essentially, ...
MaWinf98's user avatar
4 votes
6 answers
2k views

This is interview question Reverse string with identical spaces as in original String using Java For example Original String : best in the world and is greatest and is making sure the world goes well ...
Sreedhar Danturthi's user avatar
3 votes
1 answer
1k views

I've recently had a technical interview where I had to identify code smells and refactor an existing code by applying the SOLID principles and implementing unit tests. It is a small shopping cart ...
Laila Campos's user avatar
2 votes
1 answer
66 views

I attended job interview and on live codeing session was asked to implement code based on some requirements. There are quite long text description but idea that we have to accept some file system path ...
gstackoverflow's user avatar
1 vote
2 answers
194 views

Task I was asked to write a function, which can determine (return a bool) whether 2 given strings are anagrams of each other? That function should have the following constraints: Upper and lowercase ...
theateist's user avatar
  • 263
2 votes
1 answer
351 views

Practicing objected oriented design. This time, it's designing the TicTacToe game. One difference between the real TicTacToe game is that I've made my TicTacToe game to have variable sized board. ...
whiteSkar's user avatar
  • 165
4 votes
1 answer
2k views

Just practicing some objected oriented design questions. Please let me know what can be improved to be more OOD and extensible. Thank you. Functional Requirements Cart can hold multiple products A ...
whiteSkar's user avatar
  • 165
3 votes
0 answers
681 views

One of the companies I was recently interviewing with gave me a following task to implement in a day or two using .Net, just to see where my coding abilities are at: Implement a Web API that gets ...
mi105's user avatar
  • 31
1 vote
6 answers
305 views

I needed a function to find the first and last indices into a sorted list corresponding to a given value (roughly similar to C++'s equal_range()). This is the ...
ajax333221's user avatar
1 vote
1 answer
339 views

Working on the problem Find Winner on a Tic Tac Toe Game, I took several hours longer than an artificial time constraint the site had for mock interview purposes. This leads me to wonder if my ...
Curious's user avatar
  • 113
2 votes
1 answer
166 views

Just started learning Go recently. Did some questions from Cracking the Coding Interview book. Wrote the solutions in Go. Let me know what you think. https://github.com/samjingwen/ctci Below is ...
Sam Jing Wen's user avatar
10 votes
6 answers
5k views

I have designed Conway's Game of Life in Java, the solution follows Object Oriented design and paradigm, please review and let me know the feedback Class Cell Cell ...
HariHaravelan's user avatar
2 votes
1 answer
1k views

This is a follow-up to https://stackoverflow.com/questions/71194832/converting-json-based-log-into-column-format-i-e-one-file-per-column . My task is to optimize this code whose function is to convert ...
Sparsh Saxena's user avatar
1 vote
1 answer
328 views

I previously asked for a review for a Vending Machine implementing State Pattern in this linked post. And received an answer from @radarbob. The code below is my revised attempt based on some of @...
fourbeatcoder's user avatar
5 votes
1 answer
622 views

I was asked to implement a Vending Machine in a recent interview coding challenge. My attempt at a solution is based on the state pattern. I would like to get some code reviews on this bearing in mind ...
fourbeatcoder's user avatar
2 votes
0 answers
103 views

"Regular Expression Matching" is a hard problem on LeetCode (problem #10): Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where: ...
AlwaysLearning's user avatar
4 votes
2 answers
945 views

"Word Search II" is a hard problem on LeetCode (problem #212): Given an m x n board of characters and a list of strings words, return all words on the board. Each word must be constructed ...
AlwaysLearning's user avatar
1 vote
1 answer
116 views

So I found this funky programming challenge somewhere on Quora. The idea is to take the head of a singly-linked list, and reverse a specific sublist. The requirements are: runs in constant space, ...
coderodde's user avatar
  • 32.3k
3 votes
3 answers
499 views

In this code the angle between the minute and hour hands of an analog clock are found and calculated and the smaller angle between them returned. This code works perfectly and I am getting back the ...
Conor's user avatar
  • 33
4 votes
1 answer
220 views

A hiring company gave me the following challenge: We want a function which accepts a very large list of prices (pricesLst) and returns the largest possible loss a ...
Nour's user avatar
  • 43
3 votes
1 answer
97 views

I made a weather app in react and redux for an interview. The response was that I didn't use redux properly, and that it has unnecessary props. I'm not sure what they meant. The app is on github https:...
s-e1's user avatar
  • 33
4 votes
4 answers
3k views

Yesterday I posted my first solution to an interview problem here. I am now aware that I have many weak spots in Java and need to do extensive review before tackling any more interviews. Having said ...
apex2022's user avatar
  • 161
1 vote
1 answer
506 views

I was assigned the following problem: You've gone back in time to 500BC Athens and Socrates wants you to build him an app to help classify animals. Build the classes ...
apex2022's user avatar
  • 161
1 vote
1 answer
929 views

I recently saw a youtube video on printing even and odd numbers from 0 to 100 in Java. https://www.youtube.com/watch?v=eRNTx8k5cmA Thread 1 prints even numbers and thread 2 prints odd numbers. Both ...
elMuon's user avatar
  • 11
3 votes
2 answers
215 views

Got this problem in a coding interview - Get the max value of a stack in O(1). The stack contains numbers only. Please review my solution. ...
G.R's user avatar
  • 39

1
2 3 4 5
20