237. Delete Node in a Linked List

My Submissions
Total Accepted: 73455 Total Submissions: 168454 Difficulty: Easy

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.

Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3, the linked list should become 1 -> 2 -> 4 after calling your function.

Subscribe to see which companies asked this question

Show Tags
Linked List
Show Similar Problems
(E) Remove Linked List Elements
Have you met this question in a real interview?
Yes
No
When did you meet this question?
1 week ago
1 month ago
3 months ago
6 months ago
More than 6 months ago
How long have you been interviewing?
Not yet started
1 month
3 months
6 months
More than 6 months
Which company asked you this question?
Adobe
Airbnb
Alation
Alibaba
Amazon
Apple
Arista
Baidu
Blend Labs
Blizzard
Bloomberg
Box
Bungie
Cisco
Conviva
Coursera
CreditEase
Deutsche Bank
Dropbox
eBay
Electronic Arts
EMC
Epic Systems
Expedia
Facebook
Flipkart
Fortinet
FreeWheel
Goldman Sachs
Google
GrabTaxi
Groupon
Hedvig
Hulu
Intel
Jane Street
JPMorgan
Jump Trading
Lending Club
LinkedIn
LiveRamp
Marvel
Matlab
McKesson
Microsoft
Morgan Stanley
Nvidia
Oracle
Orbitz
Palantir
Paypal
Pinterest
Pocket Gems
Qualtrics
Qumulo
Quora
Rackspace
Salesforce
Sina
Snapchat
Square
Sumologic
Symantec
Tencent
TinyCo
Tradeshift
TripAdvisor
Twitter
Two Sigma
Uber
VMware
Walmart
Yahoo!
Yandex
Yelp
Zenefits
Zynga

Discuss


Send Feedback