# Questions tagged [interview-questions]

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

28 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
450 views

### Find redundant braces in an input string

I am solving interview questions from here. Problem : Write a program to validate if the input string has redundant braces Return 0/1 : ...
3k views

### Merge k sorted array in python

I got asked this following interview for the following problem. Wondering if you have any thought and feedback for 3 solutions below: Merge k sorted linked lists and return it as one sorted list. ...
324 views

### Merge two sorted linked lists in C++

Should I be using std::move or copy when passing LNode in the LinkedList constructor instead ...
255 views

### Event management system in C++

I have this question asked as home assignment for an interview. I submitted my solution and did not get selected. Wanted to know your feedback for the solution. Question: Write a very simple ...
62 views

### Implementing key map with expire and size limit

Recently I have been asked to implement a key map with expire time for each key and possibility to limit the number of keys, in Python. I've used a dictionary + heap to store the entries, e.g.: ...
116 views

### Interview: Appointment reservations

I have received this question during an interview I did earlier, but I found that my solution might not be correct. And I would like to know whatever there is a better way to solve this. Question: ...
679 views

### Robot on a Grid: Find a path between two corners with forbidden cells on the road

Problem statement The problem is defined in the book as following: 8.2 Robot in a Grid Imagine a robot sitting on the upper left corner of grid with r rows and <...
495 views

### Three sum using binary search

Given an array and a value, find all the triplets in the array whose sum is equal to the given value. For example, if the given array is {12, 3, 4, 1, 6, 9} and the ...
471 views

### Leetcode 10: Regular Expression Matching

Problem statement Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching ...
246 views

### Learn trie through Leetcode 212

Problem statement: Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentially adjacent cell, where "...
71 views

### Time Schedule Intersection version 2

Time schedule intersection in my original question I gave an answer which has $O(n^2)$ complexity. Here is the new version of the same problem. I'm trying to get to O(N+K). please review the code ...
115 views

### JavaScript Node/React web developer interview code part 2 RESTful API

I recently applied for a job as a Node/React developer. I'm attempting to cross over from a research position to web development. I didn't get the job but all the feedback I got was that my code was ...
228 views

### Javascript node/react web developer interview code

I recently applied for a job as a node/react developer. I'm attempting to cross over from a research position to web development. I didn't get the job but all the feedback I got was that my code was ...
212 views

### Improving time efficiency of finding maximum area rectangles in a histogram

Here's my solution but I am looking for ways to improve the time complexity of solution. Also this question is categorized as being solved by stack so I would like to know how to approach it using ...
51 views

### Tic-tac-toe vanilla js

I'm trying to improve my interview skills so I wrote one of the typical assignments - tic-tac-toe game. The main goals are: time limit: 30 minutes - 1h use only vanilla js I'll attach source but I ...
86 views

### Automating A Workflow Using Selenium - Best Way To Fetch Elements & Make Code More Generic

I'm a newbie to Selenium and I'm trying to get better at it by taking up interview assignments. This YouTube link describes the workflow that needs to be automated. The following points are worth ...
71 views

### Count Substrings for a binary string

Problem is taken from leet code. Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings ...
77 views

### KMP algorithm in scala

I implemented KMP pattern matching algorithm in Scala. My code works but it looks more imperative and a scala translation of C/C++ implementation. I am not able to figure out how to manage multiple ...
59 views

### Closest 3Sum in Scala

This question is taken from Leet code. Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three ...
102 views

### Symfony controller to register and activate users

I've been in an interview some time ago. They objected my Symfony API code with following line: Too much code in controller actions. Can be moved to services to keep the business logic apart ...
217 views

### Longest Substring Without Repeating Characters in Scala

Question is taken from Leetcode and solution works for their test cases. I do see a scope of improvement and make it more functional (getting rid of vars and mutables data structures). Please suggest ...
4k views

### Find the shortest path between two points in a 2D matrix with obstacles

I need to find shortest path between two points in a grid given an obstacles.. Given a 2 dimensional matrix where some of the elements are filled with 1 and rest of the elements are filled. Here ...
56 views

### Design a system for renting digital movies/books

During an interview I was asked to do an OO design for a digital renting system for books/movies. This is the design that I came up with. My assumptions: When the customer has downloaded a list of ...
536 views

### Electricity billing system for home in OOP

I recently appeared for interview for code-pairing round and I was asked following question: Electricity Billing System for home. The corresponding power usage of home appliances (Fan, AC, Fridge, ...
86 views

### System on Chip Validator

With reference to my source files, published in the git repository soc-testing I did my best effort at coding, based on 30 years of experience, so I would like to know what I did wrong with my ...
471 views

### binary search tree Inorder successor to test candidate confidence

Problem statement Given the root node and a node in the binary search tree, find the inorder successor of the given node. Here is the example of binary search tree, Given the node with ...