ByteDance·Software Engineer·Technical Phone Screen
- Write a SQL query to find users with consecutive login days, and explain your approach.
“The classic consecutive days problem.”
159 Software Engineers have shared notes from their ByteDance interviews, with the questions they were asked in each round. That is 71% of the 223 ByteDance interview notes on Screna AI.
159 Software Engineer interview notes
“The classic consecutive days problem.”
“This is where I fumbled a bit.”
“This is where I fumbled a bit.”
“Knew the sort-then-two-pointer approach going in, but the duplicate-skipping part is where I always fumble a little.”
“Pretty standard sliding window once you see it.”
“I knew this problem but knowing it and coding it cleanly are two different things.”
“I went with counter plus base62 encoding first because it's predictable and collision-free, then they pushed me on what happens when the counter resets or you're running multiple nodes.”
“The example they gave was something like [0,1,0,0,0,0,0,1,1,1,1] with an expected output of 6, which I stared at for a solid 20 seconds trying to manually verify.”
“Split, reverse, join.”
“I got the iterative version down pretty fast, three pointers, nothing fancy.”