Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Frontend Algorithm and Web Basics

MediumPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Frontend Algorithm and Web Basics. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Tell me about the two frontend questions you expect: one algorithm problem and one HTML/CSS question.

For the algorithm portion, implement a function that returns the length of the longest substring without repeated characters. For the HTML/CSS portion, explain how to center a component horizontally and vertically using modern CSS, including relevant trade-offs.

Input is a string, and output is an integer.

Constraints

  • 0 <= len(s) <= 10^5
  • s contains printable ASCII characters
  • Return 0 when s is empty

Function Signature

def longest_unique_substring(s):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output