interviews | Everything you need to know to get the job | Learning library
kandi X-RAY | interviews Summary
kandi X-RAY | interviews Summary
Your personal guide to Software Engineering technical interviews. Video solutions to the following interview problems with detailed explanations can be found here. Maintainer - Kevin Naughton Jr.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Decodes a string .
- Returns the minimal window .
- Get the vertical order of the node in the tree
- Generate matrix .
- Returns a list of integers .
- Returns the level order in the tree rooted at the tree
- Merge k lists .
- Group an array of Strings
- Determine how many substrings are unique
- Return the minimum cost of an array of costs .
interviews Key Features
interviews Examples and Code Snippets
function performOperation(secondInteger, secondDecimal, secondString) {
// Declare a variable named 'firstInteger' and initialize with integer value 4.
const firstInteger = 4;
// Declare a variable named 'firstDecimal' and initialize wit
function reverseStringHalfIndex(str) {
let strArr = str.split('');
let len = strArr.length;
let halfIndex = Math.floor(len / 2) - 1;
let tmp = [];
for (var i = 0; i <= halfIndex; i++) {
tmp = strArr[len - i - 1];
strArr[len - i
function inPlaceReverse(arr) {
var i = 0;
while (i < arr.length - 1 ) {
arr.splice(i, 0, arr.pop());
i++;
}
return arr;
}
Community Discussions
Trending Discussions on interviews
QUESTION
I want to get 20 most common words from the descriptions of top 10 longest movies from data.csv, by using Python. So far, I got top 10 longest movies, however I am unable to get most common words from those specific movies, my code just gives most common words from whole data.csv itself. I tried Counter, Pandas, Numpy, Mathlib, but I have no idea how to make Python look exactly for most common words in the specific rows and column (description of movies) of the data table
My code:
...ANSWER
Answered 2022-Mar-03 at 20:05You can select the first 10 rows of your dataframe with iloc[0:10]
.
In this case, the solution would look like this, with the least modification to your existing code:
QUESTION
I am preparing for interviews and came across this question while practicing some SQL questions recently asked in Amazon. I could not find the table though, but the question is as follows:
Find the cumulative sum of the top 10 most profitable products of the last 6 months for customers in Seattle.
Does the approach to solving this type of query look correct? If not, what would be the best way to approach this problem?
...ANSWER
Answered 2022-Feb-21 at 07:02use this
QUESTION
I have a css grid layout that looks like this,
When a box is clicked is grows in height to show information about the service. What I was hoping to be able to do was the "relayout" the grid so grid wrapped around the tallest item? Instead what I have is when I an item grows that row and it's children grow with it.
What I was hoping for was if report writing was clicked it would grow and take up benchmarking space, benchmarking would move left and consultancy would wrap onto a new line?
I am using tailwind so my HTML looks like this,
...ANSWER
Answered 2022-Jan-21 at 17:51A couple of things.
You can make the clicked item span two rows by setting grid-row: span 2
This will have the effect of 'pushing' other grid items around.
In the JS you had a call to remove
which I think should have been removeClass
Here's a (slightly messy) SO snippet created from your codepen:
QUESTION
This question is an extension to this one (Is there a technical reason why it would be better for the COM DLL to delete the passed in temporary JSON when it is finished with it?) where it was suggested I pass JSON content as a BSTR
to my C# COM DLL.
Here is an example of the type of data being passed:
...ANSWER
Answered 2022-Jan-21 at 05:06You could always write a test program if you don't know the answer. Here's one that verifies 1 megabyte BSTR
which is way more than your example. You could change the amount allocated to whatever you want. At some point it will break.
QUESTION
I came across a problem while doing technical interviews for matrix pattern matching. I was able to solve the problem using brute force but wonder if there is a more efficient solution as I only got about half credit for efficiency. Thank you in advanced for your input.
Given a matrix containing the numbers 0, 1, 2 and the pattern [1, 2, 0, 2, 0, 2, 0] find the max length of the matching pattern starting from any point in the matrix but can only travel diagonally.
here is an example of where we would expect the function to return 12.
here is where we would expect the function to return 7.
and empty matrix should return 0.
Here is my code, like I said previously it does work and passed all the tests but I got docked points.
...ANSWER
Answered 2022-Jan-15 at 22:48Building on the accept answer to this question. It's based on a few key ideas:
You can use np.diagonal
over a range to slice every possible diagonal out of the array. You can flip the array around to make sure you get all angles.
You can tile
the pattern to make sure it's at least as long or longer than the largest diagonal.
You can zip
the diagonal and the pattern and the extra values in the pattern will be dropped automatically due to the way zip works.
Then you can use takewhile
on the zipped (diag,pattern) to check how many consecutive matches there are len(set(x))==1
.
If you do this for all the possible combinations and take the max, you should have your answer.
QUESTION
I have this array that combines different data and then if the array contains true, then I'm showing some text. So for example, even if video is the only one that has a length greater than 0 (true), and the rest are false, the text 'Click to go to list' will be still shown. Is there a clean/simplier way of doing this check?
...ANSWER
Answered 2021-Dec-23 at 20:38You can check to see if atleast one length property in the array is truthy
QUESTION
Below is a table that has candidate_id, two interviews they attended with the interviewer's name, and results for each interview.
candidate_id interview_1 interview_2 result_1 result_2 1 Interviewer_A Interviewer_B Pass Pass 2 Interviewer_C Interviewer_D Pass RejectI need help to combine column interview_1 and interview_2 into one column, and count how many pass and reject each interviewer gave to the candidate, the result I expected to see as below:
interviewer_name pass_count reject_count Interviewer_A 1 0 Interviewer_B 1 0 Interviewer_C 1 0 Interviewer_D 0 1SQL or Python either would work for me! Much appreciated!
...ANSWER
Answered 2021-Dec-08 at 21:00In SQL Server, it becomes a small matter for a CROSS APPLY
Example
QUESTION
I have transcriptions of interviews that are partly irregularly formed:
...ANSWER
Answered 2021-Nov-27 at 13:41You could update your pattern to use your 4 capture groups, and make the last part optional by optionally matching the 3rd group and then the 4th group and assert the end of the string:
QUESTION
Hello, (apologies for my bad English) I made the previous table I'm a new at SQL and wondering to how can I make a query that will return the names of the people who had interviews in different rooms regardless of the day so will would not come up since he had interviews in the same rooms
my approach
...ANSWER
Answered 2021-Nov-24 at 13:22In addition to @Beso answer I would also use DISTINCT in COUNT to be sure there are different rooms.
QUESTION
I'm trying to understand the time and space complexity of an algorithm for generating an array's permutations. Given a partially built permutation where k
out of n
elements are already selected, the algorithm selects element k+1
from the remaining n-k
elements and calls itself to select the remaining n-k-1
elements:
ANSWER
Answered 2021-Nov-14 at 15:07The time complexity of this algorithm, counted by the number of basic operations performed, is Θ(n * n!)
. Think about the size of the result
list when the algorithm terminates-- it contains n!
permutations, each of length n
, and we cannot create a list with n * n!
total elements in less than that amount of time. The space complexity is the same, since the recursion stack only ever has O(n)
calls at a time, so the size of the output list dominates the space complexity.
If you count only the number of recursive calls to permutations()
, the function is called O(n!)
times, although this is usually not what is meant by 'time complexity' without further specification. In other words, you can generate all permutations in O(n!)
time, as long as you don't read or write those permutations after they are generated.
The part where your derivation of run-time breaks down is in the definition of T(n). If you define T(n) as 'the run-time of permutations(A, start)
when the input, A, has length n
', then you can not define it recursively in terms of T(n-1) or any other function of T(), because the length of the input in all recursive calls is n
, the length of A.
A more useful way to define T(n) is by specifying it as the run-time of permutations(A', start)
, when A' is any permutation of a fixed, initial array A, and A.length - start == n. It's easy to write the recurrence relation here:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install interviews
You can use interviews like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the interviews component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page